I'm having some trouble running deployments that o...
# prefect-community
o
I'm having some trouble running deployments that override a flow's default parameters, has anyone bumped into the same issue? • I have a flow that takes a parameter, the parameter has a default value (let's call it False). • Before running deployment apply, I modify the deployment.yaml file so that the parameter has the value True instead. • When viewing the deployment in the GUI, it correctly states that the parameters default value is True (based on what was in deployment.yaml) • However, when I run the deployment and log the parameter, the flow run reports the parameter value as being False. I have tried a few different data types in order to see if the behavior changes, such as bool and str, but it makes no difference. I'm using Prefect cloud and I'm on 2.0.4 with a fresh venv.
1
k
Hmm that’s weird. I just tested with 2.0.4 and it works. Did you see something like this when clicking the flow run?
Copy code
{
  "param": True
}
o
Interesting! No, it just looks like {}
I took a few screenshots, not sure if they are of any help.
k
Did you click now with defaults when running a flow?
o
Yeah, I did!
k
Do you have this in your yaml file?
Copy code
parameters:
  trigger_masterflow_test: true
You are not supposed to change the lines of code after
Copy code
###
### DO NOT EDIT BELOW THIS LINE
###
o
Oh, that's fair, I am aware of that text after all.. My bad, not sure why I ignored that. Is there another way I can change the default parameters for deployments, or can it only be changed on the flow level at the moment?
I know I can override parameters for specific/custom runs, but I was hoping to have multiple deployments deployed with different parameters. For example, so that flow runs on different schedules can run with different options.
k
yes you can change it in your yaml file next to the
parameters
option
For example:
Copy code
name: test-flow3
description: null
version: 41a3efe1d7dc91d994def63d690ae676
tags:
- dev
parameters:
  number: 2
o
Oh, wow. Okay, awesome! Sorry about the false alarm, this is the last piece of the puzzle before we can get our whole setup into production running Prefect 2, getting a bit ahead of myself.
k
hope it answer your question. Let me know if you have other questions in the future
👍 1
o
It worked! 🎉
🎉 1