https://prefect.io logo
Title
o

Oscar Björhn

08/15/2022, 2:22 PM
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

Khuyen Tran

08/15/2022, 3:14 PM
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?
{
  "param": True
}
o

Oscar Björhn

08/15/2022, 3:16 PM
Interesting! No, it just looks like {}
I took a few screenshots, not sure if they are of any help.
k

Khuyen Tran

08/15/2022, 3:23 PM
Did you click now with defaults when running a flow?
o

Oscar Björhn

08/15/2022, 3:25 PM
Yeah, I did!
k

Khuyen Tran

08/15/2022, 3:27 PM
Do you have this in your yaml file?
parameters:
  trigger_masterflow_test: true
You are not supposed to change the lines of code after
###
### DO NOT EDIT BELOW THIS LINE
###
o

Oscar Björhn

08/15/2022, 3:29 PM
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

Khuyen Tran

08/15/2022, 3:31 PM
yes you can change it in your yaml file next to the
parameters
option
For example:
name: test-flow3
description: null
version: 41a3efe1d7dc91d994def63d690ae676
tags:
- dev
parameters:
  number: 2
o

Oscar Björhn

08/15/2022, 3:35 PM
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

Khuyen Tran

08/15/2022, 3:35 PM
hope it answer your question. Let me know if you have other questions in the future
👍 1
o

Oscar Björhn

08/15/2022, 3:43 PM
It worked! 🎉
🎉 1