kevin
12/30/2020, 5:37 PMdefaults_from_attrs
decorator on PostgresFetch.run()
allow me to build a bunch of queries out like this:
with Flow('foo') as flow:
pw = PrefectSecret('pass')
pg_template = PostgresFetch(host='host',user='user',db_name='name', port=1234)
pg_query1 = pg_template(password=pw, query='select * from foo;')
pg_query2 = pg_template(password=pw, query='select * from bar;')
josh
12/30/2020, 6:08 PMkevin
12/30/2020, 6:09 PMkevin
12/30/2020, 6:10 PMrun()
method on the task rather than at instantiationjosh
12/30/2020, 6:11 PMPrefectSecret
task is a preferred way of passing sensitive information to the task and for the value to be read it needs to be passed in at runtimekevin
12/30/2020, 6:12 PMPrefectSecret(os.environ.get('db_pw'))
?josh
12/30/2020, 6:13 PMdb_pw
is the name of the secret then you should be good to go. Take a look at this doc on secrets for some more information about how they are used: https://docs.prefect.io/core/concepts/secrets.htmlkevin
12/30/2020, 6:14 PM