Evan Curtin
04/21/2023, 1:48 PMList[str]
and the UI is a bit confusing, Ideally for me it would be individual str
rows, with the ability to +
and add more / delete
• Nesting: I have structs that are somewhat nested 3/4 levels, it looks like after a few levels it just gives up and prompts me for JSON, this is ok, but it means I have to lookup the schema of the fields in the codebase, is there a workaround, or even a way to get a popup showing which fields are expected?Nate
04/21/2023, 8:28 PMdict
of values that you'd want to render in the template? also, just to be clear, are you asking about flow run parameters here?
• thanks for the feedback here!
• would you be open to defining a Pydantic model for the nested structure? that way you could do something like
from pydantic import BaseModel
from prefect import flow
class Level3Model(BaseModel):
some_str: str
some_int: int
class Level2Model(BaseModel):
level3: Level3Model
class ParentModel(BaseModel):
level2: Level2Model
@flow
def accepts_nested_model(model: ParentModel):
print(model)
if __name__ == "__main__":
accepts_nested_model(
{
"level2": {
"level3": {
"some_str": "hello",
"some_int": 42
}
}
}
)