Hi folks, what is the current approach for specifying a custom prefect context (to be used as a default) when registering a flow ?
z
Zanie
03/04/2021, 4:34 PM
I'd set environment variables in the
RunConfig
for your flow
upvote 1
m
Marwan Sarieddine
03/04/2021, 4:35 PM
I see - thanks for the prompt response
Marwan Sarieddine
03/05/2021, 1:34 PM
@Zanie - following up as I am in the process of implementing your suggested approach - and it seems to me that using environment variables is a bit limiting (doesn’t allow for setting values as lists or dicts - i.e. doesn’t allow to fully leverage what a context is capable of) - so I am wondering what you’re thoughts are on this
Marwan Sarieddine
03/05/2021, 1:43 PM
ah nevermind - just saw this in the docs about automatic type casting
Automatic type casting
Prefect will do its best to detect the type of your environment variable and cast it appropriately.
"true" (with any capitalization) is converted to True
"false" (with any capitalization) is converted to False
strings that parse as integers, floats, None, lists, dictionaries, etc. are all converted to their respective Python type
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.