Nicholas Thompson
07/18/2023, 11:29 PMInputModel
, which has one required parameter. This input model is then used as an optional parameter in my flow. Up to and including prefect version 2.10.18, I've been able to run a flow with the optional_input_model
parameter set to none, which by extension means the required_field
on the input model is also left unspecified.
from typing import Optional
import prefect
from pydantic import BaseModel
class InputModel(BaseModel):
required_field: int
@prefect.flow(name="test-flow")
def flow(
required_integer: int,
optional_input_model: Optional[InputModel] = None,
) -> None:
logger = prefect.get_run_logger()
<http://logger.info|logger.info>(f"{required_integer=}")
<http://logger.info|logger.info>(f"{optional_input_model=}")
After trying to upgrade to the latest version, 2.10.21, I'm finding that I can't run the flow from the UI, because prefect complains that the required_field
in the input model is required (see my screenshot). Previously this wasn't the case, the flow would have optional_input_model
set to None, and you'd still be able to run the deployment from the UI. Interestingly, when I try run the flow from a python terminal with the input model left as None, things work fine. It also works fine when I switch to the json view in run tab, so I think this is an issue on the UI endChristopher Boyd
07/19/2023, 12:46 AMNicholas Thompson
07/19/2023, 1:07 AMChristopher Boyd
07/21/2023, 12:29 AMNicholas Thompson
07/21/2023, 12:45 AM