Tom Jordahl
01/24/2025, 7:50 PMfrom prefect.deployments import run_deployment
run_deployment(name="my_function/My Sample Deployment", parameters={}, job_variables={"image": image})
The error is:
pydantic.errors.PydanticUserError: State
is not fully defined; you should define all referenced types, then call State.model_rebuild()
.Marvin
01/24/2025, 7:50 PMState
model is not fully defined, which is usually a sign that there's a mismatch or issue with the Pydantic model definitions in your Prefect setup.
Here are a few points to consider:
1. Prefect 3.x Changes: Prefect 3.x uses Pydantic 2, which might have introduced some changes in how models are validated or rebuilt. Ensure that your Prefect version is compatible with your code. More details can be found in the Prefect 3.x release notes.
2. State Model: The error suggests the need to rebuild the State
model. This could be due to a missing or outdated model definition. It might be worth checking if there are any updates or patches related to this issue in the Prefect GitHub repository.
3. Deployment Changes: In Prefect 3.x, the Deployment.build_from_flow()
method was removed. Make sure that your deployment code is updated to reflect the new API changes.
4. Work Pools: Prefect 3.x replaced agents with workers and introduced work pools. Ensure that your deployment configuration aligns with these changes.
For more detailed information, you can explore Prefect's documentation on deployments and review the Prefect GitHub issues for any related updates or patches. If the problem persists, you might consider reaching out to the Prefect community or support for more specific guidance.Alexander Azzam
01/24/2025, 8:11 PMTom Jordahl
01/24/2025, 8:15 PMAlexander Azzam
01/24/2025, 8:16 PMTom Jordahl
01/24/2025, 8:16 PMTom Jordahl
01/24/2025, 8:19 PMTom Jordahl
01/24/2025, 9:08 PMmain.__all__
in my script. However I was using logging
in my script, but after including main the Prefect logging init that is executed seems to supress all of my messages.
I was doing:
logging.basicConfig(level=print, format='%(asctime)s - %(levelname)s - %(message)s')
<http://logging.info|logging.info>("Hello")
and now it doesn’t work