You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If no state variable is provided, Prefect will automatically call prefect.states.Scheduled(). For whatever reason, this function call will result in a model validation error starting in Pydantic 2.10.
Traceback (most recent call last):
File "/home/ubuntu/prefect-poc/perf/test.py", line 153, in
asyncio.run(run_deployments())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/ubuntu/prefect-poc/perf/test.py", line 138, in run_deployments
scheduled_state = prefect.states.Scheduled()
File "/home/ubuntu/prefect-poc/.venv/lib/python3.10/site-packages/prefect/states.py", line 608, in Scheduled
return cls(type=StateType.SCHEDULED, state_details=state_details, **kwargs)
File "/home/ubuntu/prefect-poc/.venv/lib/python3.10/site-packages/pydantic/main.py", line 214, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
File "/home/ubuntu/prefect-poc/.venv/lib/python3.10/site-packages/pydantic/_internal/_mock_val_ser.py", line 100, in getattr
raise PydanticUserError(self._error_message, code=self._code)
pydantic.errors.PydanticUserError: State is not fully defined; you should define all referenced types, then call State.model_rebuild().
Version info
Version: 3.1.4
API version: 0.8.4
Python version: 3.10.12
Git commit: 78ee41cb
Built: Wed, Nov 20, 2024 7:37 PM
OS/Arch: linux/x86_64
Profile: local
Server type: server
Pydantic version: 2.10.0
Integrations:
prefect-ray: 0.4.3
Additional context
No response
The text was updated successfully, but these errors were encountered:
nithinkrishnamurthi
changed the title
create_flow_run_from_deployment breaks with default state parameter for Pydantic >2.10
create_flow_run_from_deployment breaks with default state parameter for Pydantic >=2.10
Dec 16, 2024
Bug summary
If no state variable is provided, Prefect will automatically call prefect.states.Scheduled(). For whatever reason, this function call will result in a model validation error starting in Pydantic 2.10.
Traceback (most recent call last):
File "/home/ubuntu/prefect-poc/perf/test.py", line 153, in
asyncio.run(run_deployments())
File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/ubuntu/prefect-poc/perf/test.py", line 138, in run_deployments
scheduled_state = prefect.states.Scheduled()
File "/home/ubuntu/prefect-poc/.venv/lib/python3.10/site-packages/prefect/states.py", line 608, in Scheduled
return cls(type=StateType.SCHEDULED, state_details=state_details, **kwargs)
File "/home/ubuntu/prefect-poc/.venv/lib/python3.10/site-packages/pydantic/main.py", line 214, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
File "/home/ubuntu/prefect-poc/.venv/lib/python3.10/site-packages/pydantic/_internal/_mock_val_ser.py", line 100, in getattr
raise PydanticUserError(self._error_message, code=self._code)
pydantic.errors.PydanticUserError:
State
is not fully defined; you should define all referenced types, then callState.model_rebuild()
.Version info
Additional context
No response
The text was updated successfully, but these errors were encountered: