Hi folks, what is the current approach for specify...
# ask-community
m
Hi folks, what is the current approach for specifying a custom prefect context (to be used as a default) when registering a flow ?
z
I'd set environment variables in the
RunConfig
for your flow
upvote 1
m
I see - thanks for the prompt response
@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
ah nevermind - just saw this in the docs about automatic type casting
https://docs.prefect.io/core/concepts/configuration.html#automatic-type-casting
Copy code
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