Hello, a dumb question, I am aware that prefect Pa...
# ask-community
a
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
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)
upvote 2
a
So, for a Prefect core user, it makes no differences?
c
I don't feel confident saying there are no other differences, but that was one I could think of!
🙂 1
👍 1
a
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.:
Copy code
flow.run(parameters=dict(x=2))
or CLI:
Copy code
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/
a
This actually makes me stick to Parameter, thanks!
👍 2