m

    Marwan Sarieddine

    1 year ago
    Hi folks, what is the current approach for specifying a custom prefect context (to be used as a default) when registering a flow ?
    Michael Adkins

    Michael Adkins

    1 year ago
    I'd set environment variables in the
    RunConfig
    for your flow
    m

    Marwan Sarieddine

    1 year ago
    I see - thanks for the prompt response
    @Michael Adkins - 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
    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