Antonio Manuel BR

    Antonio Manuel BR

    7 months ago
    Hello, a dumb question, I am aware that prefect Parameters are used to define flow inputs. What would happen if I use python variables that were defined out of the flow instead of define Parameters and adding the variables in flow.run?
    c

    Christopher

    7 months ago
    You lose the ability to define them when the flow is executed in different ways (e.g. triggered by an Agent on a schedule or through the web UI)
    Antonio Manuel BR

    Antonio Manuel BR

    7 months ago
    So, for a Prefect core user, it makes no differences?
    c

    Christopher

    7 months ago
    I don't feel confident saying there are no other differences, but that was one I could think of!
    Anna Geller

    Anna Geller

    7 months ago
    Even if you run it locally, using Parameters makes it easy to replace the parameter values at runtime without having to implement any argparser e.g.:
    flow.run(parameters=dict(x=2))
    or CLI:
    prefect run -p parametrized_flow.py --param x=3
    This post dives deeper into the topic if you're interested https://www.prefect.io/blog/how-to-make-your-data-pipelines-more-dynamic-using-parameters-in-prefect/
    Antonio Manuel BR

    Antonio Manuel BR

    7 months ago
    This actually makes me stick to Parameter, thanks!