https://prefect.io logo
Title
b

Blake Hamm

08/12/2022, 10:24 PM
Hey all! I'm very impressed with prefect 2! It's been a learning curve, but it definitely feels more pythonic to create flows! Question regarding parameters: I'm passing in a parameter as a python dictionary. It works great with the default settings (although a little unclear on the docs how to define a dictionary parameter in the deploy yaml). However, I would like to have the ability to change the dictionary parameter through the UI on runs. I can't seem to get it to run as expected. Even though I have defined the parameter as a
dict
, it still reads it in as a string in the UI and can't seem to parse it out. I'm pretty much stuck with the default dictionary parameter or I can trigger it from the CLI. Do I essentially have to use
pydantic
and explicitly specify the model when working with dictionary parameters? Some other funny parameter behavior, the UI displays the default parameter as
[object Object]
when I'm creating a custom flow run. But on the flow run (with defaults), it looks like more like a dictionary.
🙌 2
a

Anna Geller

08/12/2022, 10:47 PM
What Prefect version do you use? We've released several improvements to parametrized runs from the UI recently
Upgrading to the latest version may already fix it for you
And correct, Pydantic is how you define the schema for your parameters in Python, the API uses this Pydantic model to validate JSON payload from the API request against that model
b

Blake Hamm

08/12/2022, 10:50 PM
I hopped right on with 2.0.4. Updated my ECR and everything.
That sounds good. I was kind of hoping to avoid pydantic, but I'll play with that and see if I can address it.
*also, I'm using cloud
a

Anna Geller

08/13/2022, 11:48 AM
Pydantic is only for validation of your data types on your flow function arguments aka parameters, you don't need to know or use Pydantic
✅ 1