prefect-client 3.2.0__tar.gz → 3.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {prefect-client-3.2.0/src/prefect_client.egg-info → prefect-client-3.2.2}/PKG-INFO +1 -1
- {prefect-client-3.2.0 → prefect-client-3.2.2}/requirements-dev.txt +1 -1
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/schemas/bases.py +4 -7
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/schemas/validators.py +5 -6
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_result_records.py +6 -1
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_version.py +3 -3
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/__init__.py +4 -3
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/schemas/schedules.py +2 -2
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/asyncio.py +4 -3
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/sync.py +3 -3
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/v1/asyncio.py +3 -3
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/v1/sync.py +3 -3
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/flow_runs.py +2 -2
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/docker/docker_image.py +2 -3
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/engine.py +1 -1
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/clients.py +4 -3
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/related.py +3 -5
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/flow_engine.py +11 -2
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/flows.py +34 -5
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/locking/filesystem.py +8 -8
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/logging/handlers.py +7 -11
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runtime/flow_run.py +10 -17
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/sources.py +4 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/states.py +3 -3
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/task_engine.py +3 -3
- prefect-client-3.2.2/src/prefect/types/_datetime.py +125 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/dockerutils.py +2 -2
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/workers/base.py +5 -5
- {prefect-client-3.2.0 → prefect-client-3.2.2/src/prefect_client.egg-info}/PKG-INFO +1 -1
- prefect-client-3.2.0/src/prefect/types/_datetime.py +0 -46
- {prefect-client-3.2.0 → prefect-client-3.2.2}/LICENSE +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/MANIFEST.in +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/README.md +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/requirements-client.txt +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/requirements.txt +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/setup.cfg +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/setup.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/.prefectignore +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/__main__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_experimental/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_experimental/lineage.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_experimental/sla/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_experimental/sla/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_experimental/sla/objects.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/_logging.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/compatibility/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/compatibility/async_dispatch.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/compatibility/deprecated.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/compatibility/migration.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/api.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/calls.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/cancellation.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/event_loop.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/inspection.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/primitives.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/services.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/threads.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/concurrency/waiters.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/integrations.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/pydantic/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/pydantic/schemas.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/pytz.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/retries.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/schemas/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/schemas/fields.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/_internal/schemas/serializers.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/agent.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/artifacts.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/automations.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/blocks/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/blocks/abstract.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/blocks/core.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/blocks/fields.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/blocks/notifications.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/blocks/redis.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/blocks/system.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/blocks/webhook.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/cache_policies.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/base.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/cloud.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/collections.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/constants.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_artifacts/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_artifacts/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_automations/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_automations/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_blocks_documents/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_blocks_documents/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_blocks_schemas/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_blocks_schemas/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_blocks_types/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_blocks_types/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_concurrency_limits/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_concurrency_limits/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_deployments/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_deployments/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_flow_runs/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_flow_runs/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_flows/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_flows/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_logs/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_logs/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_variables/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_variables/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_work_pools/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/_work_pools/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/base.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/orchestration/routes.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/schemas/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/schemas/actions.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/schemas/filters.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/schemas/objects.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/schemas/responses.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/schemas/sorting.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/subscriptions.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/types/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/types/flexible_schedule_list.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/client/utilities.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/_asyncio.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/_events.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/context.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/services.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/v1/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/v1/_asyncio.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/v1/_events.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/v1/context.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/concurrency/v1/services.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/context.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/base.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/deployments.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/runner.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/schedules.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/steps/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/steps/core.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/steps/pull.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/deployments/steps/utility.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/docker/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/actions.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/cli/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/cli/automations.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/filters.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/schemas/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/schemas/automations.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/schemas/deployment_triggers.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/schemas/events.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/schemas/labelling.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/utilities.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/events/worker.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/exceptions.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/filesystems.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/flow_runs.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/futures.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/infrastructure/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/infrastructure/base.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/infrastructure/provisioners/coiled.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/infrastructure/provisioners/modal.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/input/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/input/actions.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/input/run_input.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/locking/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/locking/memory.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/locking/protocol.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/logging/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/logging/configuration.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/logging/filters.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/logging/formatters.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/logging/highlighters.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/logging/loggers.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/logging/logging.yml +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/main.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/plugins.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/py.typed +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/results.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runner/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runner/runner.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runner/server.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runner/storage.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runner/submit.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runner/utils.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runtime/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runtime/deployment.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/runtime/task_run.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/schedules.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/serializers.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/base.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/constants.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/context.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/legacy.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/api.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/cli.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/client.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/cloud.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/deployments.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/experiments.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/flows.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/internal.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/logging.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/results.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/root.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/runner.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/api.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/database.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/deployments.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/ephemeral.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/events.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/flow_run_graph.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/root.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/services.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/tasks.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/server/ui.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/tasks.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/testing.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/models/worker.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/profiles.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/settings/profiles.toml +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/task_runners.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/task_runs.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/task_worker.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/tasks.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/telemetry/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/telemetry/bootstrap.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/telemetry/instrumentation.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/telemetry/logging.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/telemetry/processors.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/telemetry/run_telemetry.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/telemetry/services.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/transactions.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/types/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/types/entrypoint.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/_deprecated.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/_engine.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/_git.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/annotations.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/asyncutils.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/callables.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/collections.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/compat.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/context.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/dispatch.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/engine.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/filesystem.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/generics.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/hashing.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/importtools.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/math.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/names.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/processutils.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/pydantic.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/render_swagger.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/schema_tools/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/schema_tools/hydration.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/schema_tools/validation.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/services.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/slugify.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/templating.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/text.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/timeout.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/urls.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/utilities/visualization.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/variables.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/workers/__init__.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/workers/block.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/workers/cloud.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/workers/process.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/workers/server.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect/workers/utilities.py +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect_client.egg-info/SOURCES.txt +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect_client.egg-info/dependency_links.txt +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect_client.egg-info/requires.txt +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/src/prefect_client.egg-info/top_level.txt +0 -0
- {prefect-client-3.2.0 → prefect-client-3.2.2}/versioneer.py +0 -0
@@ -3,15 +3,14 @@ Utilities for creating and working with Prefect REST API schemas.
|
|
3
3
|
"""
|
4
4
|
|
5
5
|
import datetime
|
6
|
-
from typing import Any, ClassVar, Optional, TypeVar
|
6
|
+
from typing import Any, ClassVar, Optional, TypeVar
|
7
7
|
from uuid import UUID, uuid4
|
8
8
|
|
9
|
-
import pendulum
|
10
9
|
from pydantic import BaseModel, ConfigDict, Field
|
11
10
|
from rich.repr import RichReprResult
|
12
11
|
from typing_extensions import Self
|
13
12
|
|
14
|
-
from prefect.types import DateTime
|
13
|
+
from prefect.types._datetime import DateTime, create_datetime_instance
|
15
14
|
from prefect.utilities.generics import validate_list
|
16
15
|
|
17
16
|
T = TypeVar("T")
|
@@ -73,11 +72,9 @@ class PrefectBaseModel(BaseModel):
|
|
73
72
|
and name == "timestamp"
|
74
73
|
and value
|
75
74
|
):
|
76
|
-
value =
|
75
|
+
value = create_datetime_instance(value).isoformat()
|
77
76
|
elif isinstance(field.annotation, datetime.datetime) and value:
|
78
|
-
value =
|
79
|
-
pendulum.DateTime, pendulum.instance(value)
|
80
|
-
).diff_for_humans()
|
77
|
+
value = create_datetime_instance(value).diff_for_humans()
|
81
78
|
|
82
79
|
yield name, value, field.get_default()
|
83
80
|
|
@@ -19,9 +19,8 @@ from typing import TYPE_CHECKING, Any, Optional, TypeVar, Union, overload
|
|
19
19
|
from uuid import UUID
|
20
20
|
|
21
21
|
import jsonschema
|
22
|
-
import pendulum
|
23
|
-
import pendulum.tz
|
24
22
|
|
23
|
+
from prefect.types._datetime import DateTime, create_datetime_instance, get_timezones
|
25
24
|
from prefect.utilities.collections import isiterable
|
26
25
|
from prefect.utilities.filesystem import relative_path_to_current_platform
|
27
26
|
from prefect.utilities.importtools import from_qualified_name
|
@@ -253,8 +252,8 @@ def reconcile_paused_deployment(values: MM) -> MM:
|
|
253
252
|
return values
|
254
253
|
|
255
254
|
|
256
|
-
def default_anchor_date(v:
|
257
|
-
return
|
255
|
+
def default_anchor_date(v: DateTime) -> DateTime:
|
256
|
+
return create_datetime_instance(v)
|
258
257
|
|
259
258
|
|
260
259
|
@overload
|
@@ -271,7 +270,7 @@ def default_timezone(
|
|
271
270
|
v: Optional[str], values: Optional[Mapping[str, Any]] = None
|
272
271
|
) -> Optional[str]:
|
273
272
|
values = values or {}
|
274
|
-
timezones =
|
273
|
+
timezones = get_timezones()
|
275
274
|
|
276
275
|
if v is not None:
|
277
276
|
if v and v not in timezones:
|
@@ -283,7 +282,7 @@ def default_timezone(
|
|
283
282
|
|
284
283
|
# anchor schedules
|
285
284
|
elif "anchor_date" in values:
|
286
|
-
anchor_date:
|
285
|
+
anchor_date: DateTime = values["anchor_date"]
|
287
286
|
tz = "UTC" if anchor_date.tz is None else anchor_date.tz.name
|
288
287
|
# sometimes anchor dates have "timezones" that are UTC offsets
|
289
288
|
# like "-04:00". This happens when parsing ISO8601 strings.
|
@@ -9,6 +9,7 @@ from typing import (
|
|
9
9
|
Optional,
|
10
10
|
TypeVar,
|
11
11
|
Union,
|
12
|
+
cast,
|
12
13
|
)
|
13
14
|
from uuid import UUID
|
14
15
|
|
@@ -146,6 +147,8 @@ class ResultRecord(BaseModel, Generic[R]):
|
|
146
147
|
@classmethod
|
147
148
|
def coerce_old_format(cls, value: dict[str, Any] | Any) -> dict[str, Any]:
|
148
149
|
if isinstance(value, dict):
|
150
|
+
if TYPE_CHECKING: # TODO: # isintance doesn't accept generic parameters
|
151
|
+
value = cast(dict[str, Any], value)
|
149
152
|
if "data" in value:
|
150
153
|
value["result"] = value.pop("data")
|
151
154
|
if "metadata" not in value:
|
@@ -232,4 +235,6 @@ class ResultRecord(BaseModel, Generic[R]):
|
|
232
235
|
def __eq__(self, other: Any | "ResultRecord[Any]") -> bool:
|
233
236
|
if not isinstance(other, ResultRecord):
|
234
237
|
return False
|
235
|
-
return self.metadata
|
238
|
+
return self.model_dump(include={"metadata", "result"}) == other.model_dump(
|
239
|
+
include={"metadata", "result"}
|
240
|
+
)
|
@@ -8,11 +8,11 @@ import json
|
|
8
8
|
|
9
9
|
version_json = '''
|
10
10
|
{
|
11
|
-
"date": "2025-02-
|
11
|
+
"date": "2025-02-13T10:53:49-0500",
|
12
12
|
"dirty": true,
|
13
13
|
"error": null,
|
14
|
-
"full-revisionid": "
|
15
|
-
"version": "3.2.
|
14
|
+
"full-revisionid": "d982c69a8bd4fb92cb250bc91dea25d361601260",
|
15
|
+
"version": "3.2.2"
|
16
16
|
}
|
17
17
|
''' # END VERSION_JSON
|
18
18
|
|
@@ -11,7 +11,7 @@ from uuid import UUID
|
|
11
11
|
import certifi
|
12
12
|
import httpcore
|
13
13
|
import httpx
|
14
|
-
|
14
|
+
|
15
15
|
import pydantic
|
16
16
|
from asgi_lifespan import LifespanManager
|
17
17
|
from packaging import version
|
@@ -130,6 +130,7 @@ from prefect.settings import (
|
|
130
130
|
PREFECT_SERVER_ALLOW_EPHEMERAL_MODE,
|
131
131
|
PREFECT_TESTING_UNIT_TEST_MODE,
|
132
132
|
)
|
133
|
+
from prefect.types._datetime import now
|
133
134
|
|
134
135
|
if TYPE_CHECKING:
|
135
136
|
from prefect.tasks import Task as TaskObject
|
@@ -148,7 +149,7 @@ T = TypeVar("T")
|
|
148
149
|
|
149
150
|
|
150
151
|
@overload
|
151
|
-
def get_client(
|
152
|
+
def get_client( # type: ignore # TODO
|
152
153
|
*,
|
153
154
|
httpx_settings: Optional[dict[str, Any]] = ...,
|
154
155
|
sync_client: Literal[False] = False,
|
@@ -607,7 +608,7 @@ class PrefectClient(
|
|
607
608
|
List[FlowRun]: a list of FlowRun objects read from the queue
|
608
609
|
"""
|
609
610
|
if scheduled_before is None:
|
610
|
-
scheduled_before =
|
611
|
+
scheduled_before = now("UTC")
|
611
612
|
|
612
613
|
try:
|
613
614
|
response = await self._client.post(
|
@@ -30,7 +30,7 @@ def is_valid_timezone(v: str) -> bool:
|
|
30
30
|
Validate that the provided timezone is a valid IANA timezone.
|
31
31
|
|
32
32
|
Unfortunately this list is slightly different from the list of valid
|
33
|
-
timezones
|
33
|
+
timezones we use for cron and interval timezone validation.
|
34
34
|
"""
|
35
35
|
from prefect._internal.pytz import HAS_PYTZ
|
36
36
|
|
@@ -309,7 +309,7 @@ class RRuleSchedule(PrefectBaseModel):
|
|
309
309
|
Validate that the provided timezone is a valid IANA timezone.
|
310
310
|
|
311
311
|
Unfortunately this list is slightly different from the list of valid
|
312
|
-
timezones
|
312
|
+
timezones we use for cron and interval timezone validation.
|
313
313
|
"""
|
314
314
|
if v is None:
|
315
315
|
return "UTC"
|
@@ -3,7 +3,8 @@ from contextlib import asynccontextmanager
|
|
3
3
|
from typing import Optional, Union
|
4
4
|
|
5
5
|
import anyio
|
6
|
-
|
6
|
+
|
7
|
+
from prefect.types._datetime import now
|
7
8
|
|
8
9
|
from ._asyncio import (
|
9
10
|
AcquireConcurrencySlotTimeoutError as AcquireConcurrencySlotTimeoutError,
|
@@ -69,13 +70,13 @@ async def concurrency(
|
|
69
70
|
max_retries=max_retries,
|
70
71
|
strict=strict,
|
71
72
|
)
|
72
|
-
acquisition_time =
|
73
|
+
acquisition_time = now("UTC")
|
73
74
|
emitted_events = emit_concurrency_acquisition_events(limits, occupy)
|
74
75
|
|
75
76
|
try:
|
76
77
|
yield
|
77
78
|
finally:
|
78
|
-
occupancy_period =
|
79
|
+
occupancy_period = now("UTC") - acquisition_time
|
79
80
|
try:
|
80
81
|
await arelease_concurrency_slots(
|
81
82
|
names, occupy, occupancy_period.total_seconds()
|
@@ -2,10 +2,10 @@ from collections.abc import Generator
|
|
2
2
|
from contextlib import contextmanager
|
3
3
|
from typing import Optional, TypeVar, Union
|
4
4
|
|
5
|
-
import pendulum
|
6
5
|
from typing_extensions import Literal
|
7
6
|
|
8
7
|
from prefect.client.schemas.responses import MinimalConcurrencyLimitResponse
|
8
|
+
from prefect.types._datetime import now
|
9
9
|
from prefect.utilities.asyncutils import run_coro_as_sync
|
10
10
|
|
11
11
|
from ._asyncio import (
|
@@ -98,13 +98,13 @@ def concurrency(
|
|
98
98
|
strict=strict,
|
99
99
|
max_retries=max_retries,
|
100
100
|
)
|
101
|
-
acquisition_time =
|
101
|
+
acquisition_time = now("UTC")
|
102
102
|
emitted_events = emit_concurrency_acquisition_events(limits, occupy)
|
103
103
|
|
104
104
|
try:
|
105
105
|
yield
|
106
106
|
finally:
|
107
|
-
occupancy_period =
|
107
|
+
occupancy_period = now("UTC") - acquisition_time
|
108
108
|
_release_concurrency_slots(names, occupy, occupancy_period.total_seconds())
|
109
109
|
emit_concurrency_release_events(limits, occupy, emitted_events)
|
110
110
|
|
@@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Optional, Union
|
|
4
4
|
from uuid import UUID
|
5
5
|
|
6
6
|
import anyio
|
7
|
-
import pendulum
|
8
7
|
|
9
8
|
from prefect.concurrency.v1._asyncio import (
|
10
9
|
acquire_concurrency_slots,
|
@@ -15,6 +14,7 @@ from prefect.concurrency.v1._events import (
|
|
15
14
|
emit_concurrency_release_events,
|
16
15
|
)
|
17
16
|
from prefect.concurrency.v1.context import ConcurrencyContext
|
17
|
+
from prefect.types._datetime import now
|
18
18
|
|
19
19
|
from ._asyncio import (
|
20
20
|
AcquireConcurrencySlotTimeoutError as AcquireConcurrencySlotTimeoutError,
|
@@ -67,13 +67,13 @@ async def concurrency(
|
|
67
67
|
if TYPE_CHECKING:
|
68
68
|
assert not isinstance(acquire_slots, list)
|
69
69
|
limits = await acquire_slots
|
70
|
-
acquisition_time =
|
70
|
+
acquisition_time = now("UTC")
|
71
71
|
emitted_events = emit_concurrency_acquisition_events(limits, task_run_id)
|
72
72
|
|
73
73
|
try:
|
74
74
|
yield
|
75
75
|
finally:
|
76
|
-
occupancy_period =
|
76
|
+
occupancy_period = now("UTC") - acquisition_time
|
77
77
|
try:
|
78
78
|
release_slots = release_concurrency_slots(
|
79
79
|
names_normalized, task_run_id, occupancy_period.total_seconds()
|
@@ -4,7 +4,7 @@ from contextlib import contextmanager
|
|
4
4
|
from typing import Optional, TypeVar, Union
|
5
5
|
from uuid import UUID
|
6
6
|
|
7
|
-
import
|
7
|
+
from prefect.types._datetime import now
|
8
8
|
|
9
9
|
from ._asyncio import acquire_concurrency_slots, release_concurrency_slots
|
10
10
|
from ._events import (
|
@@ -59,13 +59,13 @@ def concurrency(
|
|
59
59
|
)
|
60
60
|
assert not asyncio.iscoroutine(result)
|
61
61
|
limits = result
|
62
|
-
acquisition_time =
|
62
|
+
acquisition_time = now("UTC")
|
63
63
|
emitted_events = emit_concurrency_acquisition_events(limits, task_run_id)
|
64
64
|
|
65
65
|
try:
|
66
66
|
yield
|
67
67
|
finally:
|
68
|
-
occupancy_period =
|
68
|
+
occupancy_period = now("UTC") - acquisition_time
|
69
69
|
release_concurrency_slots(
|
70
70
|
names, task_run_id, occupancy_period.total_seconds(), **force
|
71
71
|
)
|
@@ -3,7 +3,6 @@ from typing import TYPE_CHECKING, Any, Iterable, Optional, Union
|
|
3
3
|
from uuid import UUID
|
4
4
|
|
5
5
|
import anyio
|
6
|
-
import pendulum
|
7
6
|
|
8
7
|
import prefect
|
9
8
|
from prefect._result_records import ResultRecordMetadata
|
@@ -16,6 +15,7 @@ from prefect.tasks import Task
|
|
16
15
|
from prefect.telemetry.run_telemetry import (
|
17
16
|
LABELS_TRACEPARENT_KEY,
|
18
17
|
)
|
18
|
+
from prefect.types._datetime import now
|
19
19
|
from prefect.utilities.asyncutils import sync_compatible
|
20
20
|
from prefect.utilities.slugify import slugify
|
21
21
|
|
@@ -96,7 +96,7 @@ async def run_deployment(
|
|
96
96
|
raise ValueError("`timeout` cannot be negative")
|
97
97
|
|
98
98
|
if scheduled_time is None:
|
99
|
-
scheduled_time =
|
99
|
+
scheduled_time = now("UTC")
|
100
100
|
|
101
101
|
parameters = parameters or {}
|
102
102
|
|
@@ -1,11 +1,10 @@
|
|
1
1
|
from pathlib import Path
|
2
2
|
from typing import Any, Optional
|
3
3
|
|
4
|
-
from pendulum import now as pendulum_now
|
5
|
-
|
6
4
|
from prefect.settings import (
|
7
5
|
PREFECT_DEFAULT_DOCKER_BUILD_NAMESPACE,
|
8
6
|
)
|
7
|
+
from prefect.types._datetime import now
|
9
8
|
from prefect.utilities.dockerutils import (
|
10
9
|
PushError,
|
11
10
|
build_image,
|
@@ -54,7 +53,7 @@ class DockerImage:
|
|
54
53
|
# join the namespace and repository to create the full image name
|
55
54
|
# ignore namespace if it is None
|
56
55
|
self.name: str = "/".join(filter(None, [namespace, repository]))
|
57
|
-
self.tag: str = tag or image_tag or slugify(
|
56
|
+
self.tag: str = tag or image_tag or slugify(now("UTC").isoformat())
|
58
57
|
self.dockerfile: str = dockerfile
|
59
58
|
self.build_kwargs: dict[str, Any] = build_kwargs
|
60
59
|
|
@@ -2,6 +2,7 @@ import abc
|
|
2
2
|
import asyncio
|
3
3
|
import os
|
4
4
|
import ssl
|
5
|
+
from datetime import timedelta
|
5
6
|
from types import TracebackType
|
6
7
|
from typing import (
|
7
8
|
TYPE_CHECKING,
|
@@ -21,7 +22,6 @@ from urllib.request import proxy_bypass
|
|
21
22
|
from uuid import UUID
|
22
23
|
|
23
24
|
import orjson
|
24
|
-
import pendulum
|
25
25
|
from cachetools import TTLCache
|
26
26
|
from prometheus_client import Counter
|
27
27
|
from python_socks.async_.asyncio import Proxy
|
@@ -44,6 +44,7 @@ from prefect.settings import (
|
|
44
44
|
PREFECT_DEBUG_MODE,
|
45
45
|
PREFECT_SERVER_ALLOW_EPHEMERAL_MODE,
|
46
46
|
)
|
47
|
+
from prefect.types._datetime import add_years, now
|
47
48
|
|
48
49
|
if TYPE_CHECKING:
|
49
50
|
from prefect.events.filters import EventFilter
|
@@ -653,8 +654,8 @@ class PrefectEventSubscriber:
|
|
653
654
|
from prefect.events.filters import EventOccurredFilter
|
654
655
|
|
655
656
|
self._filter.occurred = EventOccurredFilter(
|
656
|
-
since=
|
657
|
-
until=
|
657
|
+
since=now("UTC") - timedelta(minutes=1),
|
658
|
+
until=add_years(now("UTC"), 1),
|
658
659
|
)
|
659
660
|
|
660
661
|
logger.debug(" filtering events since %s...", self._filter.occurred.since)
|
@@ -14,9 +14,7 @@ from typing import (
|
|
14
14
|
)
|
15
15
|
from uuid import UUID
|
16
16
|
|
17
|
-
import
|
18
|
-
|
19
|
-
from prefect.types import DateTime
|
17
|
+
from prefect.types._datetime import DateTime, now
|
20
18
|
|
21
19
|
from .schemas.events import RelatedResource
|
22
20
|
|
@@ -79,7 +77,7 @@ async def related_resources_from_run_context(
|
|
79
77
|
|
80
78
|
related_objects: List[ResourceCacheEntry] = []
|
81
79
|
|
82
|
-
async def dummy_read():
|
80
|
+
async def dummy_read() -> ResourceCacheEntry:
|
83
81
|
return {}
|
84
82
|
|
85
83
|
if flow_run_context:
|
@@ -207,7 +205,7 @@ async def _get_and_cache_related_object(
|
|
207
205
|
"object": obj_,
|
208
206
|
}
|
209
207
|
|
210
|
-
cache[cache_key] = (entry,
|
208
|
+
cache[cache_key] = (entry, now("UTC"))
|
211
209
|
|
212
210
|
# In the case of a worker or agent this cache could be long-lived. To keep
|
213
211
|
# from running out of memory only keep `MAX_CACHE_SIZE` entries in the
|
@@ -49,12 +49,18 @@ from prefect.context import (
|
|
49
49
|
)
|
50
50
|
from prefect.exceptions import (
|
51
51
|
Abort,
|
52
|
+
MissingFlowError,
|
52
53
|
Pause,
|
53
54
|
PrefectException,
|
54
55
|
TerminationSignal,
|
55
56
|
UpstreamTaskError,
|
56
57
|
)
|
57
|
-
from prefect.flows import
|
58
|
+
from prefect.flows import (
|
59
|
+
Flow,
|
60
|
+
load_flow_from_entrypoint,
|
61
|
+
load_flow_from_flow_run,
|
62
|
+
load_function_and_convert_to_flow,
|
63
|
+
)
|
58
64
|
from prefect.futures import PrefectFuture, resolve_futures_to_states
|
59
65
|
from prefect.logging.loggers import (
|
60
66
|
flow_run_logger,
|
@@ -125,7 +131,10 @@ def load_flow(flow_run: FlowRun) -> Flow[..., Any]:
|
|
125
131
|
|
126
132
|
if entrypoint:
|
127
133
|
# we should not accept a placeholder flow at runtime
|
128
|
-
|
134
|
+
try:
|
135
|
+
flow = load_flow_from_entrypoint(entrypoint, use_placeholder_flow=False)
|
136
|
+
except MissingFlowError:
|
137
|
+
flow = load_function_and_convert_to_flow(entrypoint)
|
129
138
|
else:
|
130
139
|
flow = run_coro_as_sync(
|
131
140
|
load_flow_from_flow_run(flow_run, use_placeholder_flow=False)
|
@@ -2080,6 +2080,29 @@ def load_flow_from_entrypoint(
|
|
2080
2080
|
return flow
|
2081
2081
|
|
2082
2082
|
|
2083
|
+
def load_function_and_convert_to_flow(entrypoint: str) -> Flow[P, Any]:
|
2084
|
+
"""
|
2085
|
+
Loads a function from an entrypoint and converts it to a flow if it is not already a flow.
|
2086
|
+
"""
|
2087
|
+
|
2088
|
+
if ":" in entrypoint:
|
2089
|
+
# split by the last colon once to handle Windows paths with drive letters i.e C:\path\to\file.py:do_stuff
|
2090
|
+
path, func_name = entrypoint.rsplit(":", maxsplit=1)
|
2091
|
+
else:
|
2092
|
+
path, func_name = entrypoint.rsplit(".", maxsplit=1)
|
2093
|
+
try:
|
2094
|
+
func = import_object(entrypoint) # pyright: ignore[reportRedeclaration]
|
2095
|
+
except AttributeError as exc:
|
2096
|
+
raise RuntimeError(
|
2097
|
+
f"Function with name {func_name!r} not found in {path!r}."
|
2098
|
+
) from exc
|
2099
|
+
|
2100
|
+
if isinstance(func, Flow):
|
2101
|
+
return func
|
2102
|
+
else:
|
2103
|
+
return Flow(func, log_prints=True)
|
2104
|
+
|
2105
|
+
|
2083
2106
|
def serve(
|
2084
2107
|
*args: "RunnerDeployment",
|
2085
2108
|
pause_on_shutdown: bool = True,
|
@@ -2337,11 +2360,17 @@ async def load_flow_from_flow_run(
|
|
2337
2360
|
import_path = relative_path_to_current_platform(deployment.entrypoint)
|
2338
2361
|
run_logger.debug(f"Importing flow code from '{import_path}'")
|
2339
2362
|
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2363
|
+
try:
|
2364
|
+
flow = await run_sync_in_worker_thread(
|
2365
|
+
load_flow_from_entrypoint,
|
2366
|
+
str(import_path),
|
2367
|
+
use_placeholder_flow=use_placeholder_flow,
|
2368
|
+
)
|
2369
|
+
except MissingFlowError:
|
2370
|
+
flow = await run_sync_in_worker_thread(
|
2371
|
+
load_function_and_convert_to_flow,
|
2372
|
+
str(import_path),
|
2373
|
+
)
|
2345
2374
|
|
2346
2375
|
return flow
|
2347
2376
|
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import time
|
2
|
+
from datetime import timedelta
|
2
3
|
from logging import Logger
|
3
4
|
from pathlib import Path
|
4
5
|
from typing import Optional
|
5
6
|
|
6
7
|
import anyio
|
7
|
-
import pendulum
|
8
8
|
import pydantic_core
|
9
9
|
from typing_extensions import TypedDict
|
10
10
|
|
11
11
|
from prefect.logging.loggers import get_logger
|
12
|
-
from prefect.types._datetime import DateTime,
|
12
|
+
from prefect.types._datetime import DateTime, now, parse_datetime
|
13
13
|
|
14
14
|
from .protocol import LockManager
|
15
15
|
|
@@ -27,7 +27,7 @@ class _LockInfo(TypedDict):
|
|
27
27
|
"""
|
28
28
|
|
29
29
|
holder: str
|
30
|
-
expiration: Optional[
|
30
|
+
expiration: Optional[DateTime]
|
31
31
|
path: Path
|
32
32
|
|
33
33
|
|
@@ -64,7 +64,7 @@ class FileSystemLockManager(LockManager):
|
|
64
64
|
lock_info["path"] = lock_path
|
65
65
|
expiration = lock_info.get("expiration")
|
66
66
|
lock_info["expiration"] = (
|
67
|
-
|
67
|
+
parse_datetime(expiration) if expiration is not None else None
|
68
68
|
)
|
69
69
|
self._locks[key] = lock_info
|
70
70
|
return lock_info
|
@@ -86,7 +86,7 @@ class FileSystemLockManager(LockManager):
|
|
86
86
|
lock_info["path"] = lock_path
|
87
87
|
expiration = lock_info.get("expiration")
|
88
88
|
lock_info["expiration"] = (
|
89
|
-
|
89
|
+
parse_datetime(expiration) if expiration is not None else None
|
90
90
|
)
|
91
91
|
self._locks[key] = lock_info
|
92
92
|
return lock_info
|
@@ -117,7 +117,7 @@ class FileSystemLockManager(LockManager):
|
|
117
117
|
)
|
118
118
|
return self.acquire_lock(key, holder, acquire_timeout, hold_timeout)
|
119
119
|
expiration = (
|
120
|
-
|
120
|
+
now("UTC") + timedelta(seconds=hold_timeout)
|
121
121
|
if hold_timeout is not None
|
122
122
|
else None
|
123
123
|
)
|
@@ -166,7 +166,7 @@ class FileSystemLockManager(LockManager):
|
|
166
166
|
)
|
167
167
|
return self.acquire_lock(key, holder, acquire_timeout, hold_timeout)
|
168
168
|
expiration = (
|
169
|
-
|
169
|
+
now("UTC") + timedelta(seconds=hold_timeout)
|
170
170
|
if hold_timeout is not None
|
171
171
|
else None
|
172
172
|
)
|
@@ -208,7 +208,7 @@ class FileSystemLockManager(LockManager):
|
|
208
208
|
if (expiration := lock_info.get("expiration")) is None:
|
209
209
|
return True
|
210
210
|
|
211
|
-
expired = expiration <
|
211
|
+
expired = expiration < now("UTC")
|
212
212
|
if expired:
|
213
213
|
Path(lock_info["path"]).unlink()
|
214
214
|
self._locks.pop(key, None)
|
@@ -8,9 +8,8 @@ import traceback
|
|
8
8
|
import uuid
|
9
9
|
import warnings
|
10
10
|
from contextlib import asynccontextmanager
|
11
|
-
from typing import TYPE_CHECKING, Any, Dict,
|
11
|
+
from typing import TYPE_CHECKING, Any, Dict, TextIO, Type
|
12
12
|
|
13
|
-
import pendulum
|
14
13
|
from rich.console import Console
|
15
14
|
from rich.highlighter import Highlighter, NullHighlighter
|
16
15
|
from rich.theme import Theme
|
@@ -35,6 +34,7 @@ from prefect.settings import (
|
|
35
34
|
PREFECT_LOGGING_TO_API_MAX_LOG_SIZE,
|
36
35
|
PREFECT_LOGGING_TO_API_WHEN_MISSING_FLOW,
|
37
36
|
)
|
37
|
+
from prefect.types._datetime import from_timestamp
|
38
38
|
|
39
39
|
if sys.version_info >= (3, 12):
|
40
40
|
StreamHandler = logging.StreamHandler[TextIO]
|
@@ -47,7 +47,7 @@ else:
|
|
47
47
|
|
48
48
|
class APILogWorker(BatchedQueueService[Dict[str, Any]]):
|
49
49
|
@property
|
50
|
-
def _max_batch_size(self):
|
50
|
+
def _max_batch_size(self) -> int:
|
51
51
|
return max(
|
52
52
|
PREFECT_LOGGING_TO_API_BATCH_SIZE.value()
|
53
53
|
- PREFECT_LOGGING_TO_API_MAX_LOG_SIZE.value(),
|
@@ -55,10 +55,10 @@ class APILogWorker(BatchedQueueService[Dict[str, Any]]):
|
|
55
55
|
)
|
56
56
|
|
57
57
|
@property
|
58
|
-
def _min_interval(self):
|
58
|
+
def _min_interval(self) -> float | None:
|
59
59
|
return PREFECT_LOGGING_TO_API_BATCH_INTERVAL.value()
|
60
60
|
|
61
|
-
async def _handle_batch(self, items:
|
61
|
+
async def _handle_batch(self, items: list[dict[str, Any]]):
|
62
62
|
try:
|
63
63
|
await self._client.create_logs(items)
|
64
64
|
except Exception as e:
|
@@ -229,9 +229,7 @@ class APILogHandler(logging.Handler):
|
|
229
229
|
worker_id=worker_id,
|
230
230
|
name=record.name,
|
231
231
|
level=record.levelno,
|
232
|
-
timestamp=
|
233
|
-
getattr(record, "created", None) or time.time()
|
234
|
-
),
|
232
|
+
timestamp=from_timestamp(getattr(record, "created", None) or time.time()),
|
235
233
|
message=self.format(record),
|
236
234
|
).model_dump(mode="json")
|
237
235
|
|
@@ -272,9 +270,7 @@ class WorkerAPILogHandler(APILogHandler):
|
|
272
270
|
worker_id=worker_id,
|
273
271
|
name=record.name,
|
274
272
|
level=record.levelno,
|
275
|
-
timestamp=
|
276
|
-
getattr(record, "created", None) or time.time()
|
277
|
-
),
|
273
|
+
timestamp=from_timestamp(getattr(record, "created", None) or time.time()),
|
278
274
|
message=self.format(record),
|
279
275
|
).model_dump(mode="json")
|
280
276
|
|