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
Attempting to import from prefect.utilities.schema_tools raises an ImportError due to circular imports.
Steps
Run python -c "import prefect.utilities.schema_tools"
Raises:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/utilities/schema_tools/__init__.py", line 1, in <module>
from .hydration import HydrationContext, HydrationError, hydrate
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/utilities/schema_tools/hydration.py", line 11, in <module>
from prefect.server.utilities.user_templates import (
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/server/__init__.py", line 1, in <module>
from . import models, orchestration, schemas, services
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/server/models/__init__.py", line 1, in <module>
from . import (
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/server/models/agents.py", line 14, in <module>
import prefect.server.schemas as schemas
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/server/schemas/__init__.py", line 1, in <module>
from . import (
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/server/schemas/sorting.py", line 9, in <module>
from prefect.server.database import orm_models
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/server/database/orm_models.py", line 34, in <module>
from prefect.server.events.actions import ServerActionTypes
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/server/events/actions.py", line 83, in <module>
from prefect.utilities.schema_tools.hydration import (
ImportError: cannot import name 'HydrationContext' from partially initialized module 'prefect.utilities.schema_tools.hydration' (most likely due to a circular import) (/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/utilities/schema_tools/hydration.py)
Version info
Version: 3.1.7
API version: 0.8.4
Python version: 3.10.16
Git commit: c05ffa6d
Built: Mon, Dec 16, 2024 10:06 AM
OS/Arch: darwin/x86_64
Profile: ephemeral
Server type: ephemeral
Pydantic version: 2.10.3
Server:
Database: sqlite
SQLite version: 3.43.2
Additional context
No response
The text was updated successfully, but these errors were encountered:
Additionally, a similar circular import from import prefect.infrastructure.provisioners:
> python -c "import prefect.infrastructure.provisioners"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/infrastructure/provisioners/__init__.py", line 4, in <module>
from .cloud_run import CloudRunPushProvisioner
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/infrastructure/provisioners/cloud_run.py", line 19, in <module>
from prefect.cli._prompts import prompt, prompt_select_from_table
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/cli/__init__.py", line 27, in <module>
import prefect.cli.work_pool
File "/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/cli/work_pool.py", line 24, in <module>
from prefect.infrastructure.provisioners import (
ImportError: cannot import name '_provisioners' from partially initialized module 'prefect.infrastructure.provisioners' (most likely due to a circular import) (/Users/jamesmarchant/.pyenv/versions/pf_pi/lib/python3.10/site-packages/prefect/infrastructure/provisioners/__init__.py)
Bug summary
Attempting to import from
prefect.utilities.schema_tools
raises anImportError
due to circular imports.Steps
python -c "import prefect.utilities.schema_tools"
Version info
Additional context
No response
The text was updated successfully, but these errors were encountered: