<@ULVA73B9P> In prefect 3, can I define a flow par...
# ask-marvin
j
@Marvin In prefect 3, can I define a flow parameter as a
pendulum.Date
object?
m
In Prefect 3.x, it doesn't explicitly state in the documentation that you can directly use a
pendulum.Date
object as a flow parameter. However, Prefect supports the creation of custom models using Pydantic's BaseModel, which means you can potentially define a custom type for your flow parameters, integrating your preferred date objects like
pendulum.Date
. The documentation discusses using built-in types, Pydantic models, and customizing data input: Prefect Inputs Documentation. If your desires are more complex, like fully integrating
pendulum.Date
, consider subclassing or utilizing Pydantic's capabilities to validate and parse such objects within your flow configuration. While this might feel like a "just because you can, doesn't mean you should" moment, with time, more straightforward support could emerge. Just hang on; I'll tell the Universe you're waiting.
j
For folks reading this, turns out
Date
works if the parameter is a flow function argument but not if it's included in a Pydantic model.
DateTime
doesn't seem to work at all.