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
❯ prefect version
Version: 3.1.13
API version: 0.8.4
Python version: 3.12.8
Git commit: 16e85ce3
Built: Fri, Jan 17, 2025 8:46 AM
OS/Arch: darwin/arm64
Profile: ephemeral
Server type: server
Pydantic version: 2.9.2
Additional context
As the imports are cached and I'm sure that the uuid package gets imported elsewhere regardless it feels like these inline imports just adds confusion.
The text was updated successfully, but these errors were encountered:
As the imports are cached and I'm sure that the uuid package gets imported elsewhere regardless it feels like these inline imports just adds confusion.
Yeah I can see that. We've chosen to keep some imports out of the type_checking guard (custom exception types, etc), and I get the argument that UUID is probably ubiquitous enough to be considered standard fare.
Bug summary
When calling
await client.find_automation(id_or_name="dd9465f4-2f1a-494e-b219-c05790b19f0a")
there's an exception due to a missing import:The bug was introduced in #16579. When finding automations we try to create a UUID from the provided string here:
https://github.com/PrefectHQ/prefect/blob/3.1.13/src/prefect/client/orchestration/_automations/client.py#L51
However the uuid library isn't imported aside from within the TYPE_CHECKING section: https://github.com/PrefectHQ/prefect/blob/3.1.13/src/prefect/client/orchestration/_automations/client.py#L11
As a note the create_automation works differently:
https://github.com/PrefectHQ/prefect/blob/3.1.13/src/prefect/client/orchestration/_automations/client.py#L24C9-L26
Version info
Additional context
As the imports are cached and I'm sure that the
uuid
package gets imported elsewhere regardless it feels like these inline imports just adds confusion.The text was updated successfully, but these errors were encountered: