Adam Eury
10/31/2024, 5:59 PMawait client.create_flow_run_from_deployment(deployment_id=deployment.id)
It is raising this error
pydantic.errors.PydanticUserError: `StateCreate` is not fully defined; you should define all referenced types, then call `StateCreate.model_rebuild()`.
I appear to be able to replicate the issue by running the following
import prefect.states
state = prefect.states.Scheduled()
state.to_state_create()
Is this an existing issue or am I calling the method incorrectly for Prefect 3.0?Marvin
10/31/2024, 5:59 PMPydanticUserError: StateCreate is not fully defined
in the Prefect GitHub repository, which suggests this might be related to changes in how Prefect's state management is handled internally.
For handling flow runs and deployment in Prefect 3.0, the method to create flow runs from deployments might slightly differ compared to Prefect 2.x. In Prefect 3.0, deployments are elevated entities with their own API, and handling them might require using updated methods or parameters. Information on running scheduled deployments can be found here in the Prefect documentation.
Regarding Pydantic and model changes introduced with Prefect 3, more information about adjustments required for Pydantic 2 can be found in Prefect's upgrade guide.
If the error persists, you might want to double-check the specific sections of your code that interact with StateCreate
or how you transition states using Prefect's new tooling to ensure compatibility with any API changes in the upgrade.Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by