prefect-client 3.1.6__tar.gz → 3.1.7__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.1.6/src/prefect_client.egg-info → prefect-client-3.1.7}/PKG-INFO +1 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/requirements-client.txt +1 -0
- prefect-client-3.1.7/src/prefect/_experimental/lineage.py +181 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/compatibility/async_dispatch.py +38 -9
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/pydantic/v2_validated_func.py +15 -10
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/retries.py +15 -6
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/schemas/bases.py +2 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/schemas/validators.py +5 -4
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_version.py +3 -3
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/blocks/core.py +144 -17
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/blocks/system.py +2 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/orchestration.py +88 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/schemas/actions.py +5 -5
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/schemas/filters.py +1 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/schemas/objects.py +5 -5
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/schemas/responses.py +1 -2
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/schemas/schedules.py +1 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/subscriptions.py +2 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/utilities.py +15 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/context.py +1 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/flow_runs.py +3 -3
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/runner.py +14 -14
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/steps/core.py +3 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/steps/pull.py +60 -12
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/clients.py +55 -4
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/filters.py +1 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/related.py +2 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/schemas/events.py +1 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/utilities.py +2 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/worker.py +8 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/flow_engine.py +41 -81
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/flow_runs.py +4 -2
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/flows.py +4 -6
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/results.py +43 -22
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runner/storage.py +3 -3
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/serializers.py +28 -24
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/experiments.py +5 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/task_engine.py +34 -26
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/task_worker.py +43 -25
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/tasks.py +118 -125
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/telemetry/instrumentation.py +1 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/telemetry/processors.py +10 -7
- prefect-client-3.1.7/src/prefect/telemetry/run_telemetry.py +231 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/types/__init__.py +4 -1
- prefect-client-3.1.7/src/prefect/utilities/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/variables.py +127 -19
- {prefect-client-3.1.6 → prefect-client-3.1.7/src/prefect_client.egg-info}/PKG-INFO +1 -1
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect_client.egg-info/SOURCES.txt +2 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect_client.egg-info/requires.txt +1 -0
- prefect-client-3.1.6/src/prefect/telemetry/run_telemetry.py +0 -107
- {prefect-client-3.1.6 → prefect-client-3.1.7}/LICENSE +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/MANIFEST.in +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/README.md +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/requirements-dev.txt +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/requirements.txt +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/setup.cfg +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/setup.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/.prefectignore +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/__init__.py +0 -0
- {prefect-client-3.1.6/src/prefect/_internal → prefect-client-3.1.7/src/prefect/_experimental}/__init__.py +0 -0
- {prefect-client-3.1.6/src/prefect/_internal/compatibility → prefect-client-3.1.7/src/prefect/_internal}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/_logging.py +0 -0
- {prefect-client-3.1.6/src/prefect/_internal/pydantic/annotations → prefect-client-3.1.7/src/prefect/_internal/compatibility}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/compatibility/deprecated.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/compatibility/migration.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/api.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/calls.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/cancellation.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/event_loop.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/inspection.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/primitives.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/services.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/threads.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/concurrency/waiters.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/integrations.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/pydantic/__init__.py +0 -0
- {prefect-client-3.1.6/src/prefect/_internal/schemas → prefect-client-3.1.7/src/prefect/_internal/pydantic/annotations}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/pydantic/schemas.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/pytz.py +0 -0
- {prefect-client-3.1.6/src/prefect/client/types → prefect-client-3.1.7/src/prefect/_internal/schemas}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/schemas/fields.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/schemas/serializers.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/agent.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/artifacts.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/automations.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/blocks/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/blocks/abstract.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/blocks/fields.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/blocks/notifications.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/blocks/redis.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/blocks/webhook.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/cache_policies.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/base.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/cloud.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/collections.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/constants.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/schemas/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/schemas/sorting.py +0 -0
- {prefect-client-3.1.6/src/prefect/concurrency → prefect-client-3.1.7/src/prefect/client/types}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/client/types/flexible_schedule_list.py +0 -0
- {prefect-client-3.1.6/src/prefect/concurrency/v1 → prefect-client-3.1.7/src/prefect/concurrency}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/asyncio.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/context.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/events.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/services.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/sync.py +0 -0
- {prefect-client-3.1.6/src/prefect/events/cli → prefect-client-3.1.7/src/prefect/concurrency/v1}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/v1/asyncio.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/v1/context.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/v1/events.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/v1/services.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/concurrency/v1/sync.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/base.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/deployments.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/schedules.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/steps/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/deployments/steps/utility.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/docker/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/docker/docker_image.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/engine.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/actions.py +0 -0
- {prefect-client-3.1.6/src/prefect/events/schemas → prefect-client-3.1.7/src/prefect/events/cli}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/cli/automations.py +0 -0
- {prefect-client-3.1.6/src/prefect/locking → prefect-client-3.1.7/src/prefect/events/schemas}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/schemas/automations.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/schemas/deployment_triggers.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/events/schemas/labelling.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/exceptions.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/filesystems.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/futures.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/infrastructure/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/infrastructure/base.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/infrastructure/provisioners/modal.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/input/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/input/actions.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/input/run_input.py +0 -0
- {prefect-client-3.1.6/src/prefect/settings/models → prefect-client-3.1.7/src/prefect/locking}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/locking/filesystem.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/locking/memory.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/locking/protocol.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/logging/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/logging/configuration.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/logging/filters.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/logging/formatters.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/logging/handlers.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/logging/highlighters.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/logging/loggers.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/logging/logging.yml +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/main.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/plugins.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/py.typed +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/records/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/records/base.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/records/filesystem.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/records/memory.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/records/result_store.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runner/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runner/runner.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runner/server.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runner/submit.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runner/utils.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runtime/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runtime/deployment.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runtime/flow_run.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/runtime/task_run.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/base.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/constants.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/context.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/legacy.py +0 -0
- {prefect-client-3.1.6/src/prefect/utilities → prefect-client-3.1.7/src/prefect/settings/models}/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/api.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/cli.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/client.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/cloud.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/deployments.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/flows.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/internal.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/logging.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/results.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/root.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/runner.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/api.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/database.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/deployments.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/ephemeral.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/events.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/flow_run_graph.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/root.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/services.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/tasks.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/server/ui.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/tasks.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/testing.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/models/worker.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/profiles.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/profiles.toml +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/settings/sources.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/states.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/task_runners.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/task_runs.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/telemetry/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/telemetry/bootstrap.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/telemetry/logging.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/transactions.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/types/entrypoint.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/_engine.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/annotations.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/asyncutils.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/callables.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/collections.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/compat.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/context.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/dispatch.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/dockerutils.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/engine.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/filesystem.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/hashing.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/importtools.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/math.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/names.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/processutils.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/pydantic.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/render_swagger.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/schema_tools/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/schema_tools/hydration.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/schema_tools/validation.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/services.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/slugify.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/templating.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/text.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/timeout.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/urls.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/utilities/visualization.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/workers/__init__.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/workers/base.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/workers/block.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/workers/cloud.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/workers/process.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/workers/server.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/workers/utilities.py +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect_client.egg-info/dependency_links.txt +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect_client.egg-info/top_level.txt +0 -0
- {prefect-client-3.1.6 → prefect-client-3.1.7}/versioneer.py +0 -0
@@ -26,6 +26,7 @@ pydantic_extra_types >= 2.8.2, < 3.0.0
|
|
26
26
|
pydantic_settings > 2.2.1
|
27
27
|
python_dateutil >= 2.8.2, < 3.0.0
|
28
28
|
python-slugify >= 5.0, < 9.0
|
29
|
+
python-socks[asyncio] >= 2.5.3, < 3.0
|
29
30
|
pyyaml >= 5.4.1, < 7.0.0
|
30
31
|
rfc3339-validator >= 0.1.4, < 0.2.0
|
31
32
|
rich >= 11.0, < 14.0
|
@@ -0,0 +1,181 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, Dict, Literal, Optional, Sequence, Union
|
2
|
+
|
3
|
+
from prefect.events.related import related_resources_from_run_context
|
4
|
+
from prefect.events.schemas.events import RelatedResource, Resource
|
5
|
+
from prefect.events.utilities import emit_event
|
6
|
+
from prefect.settings import get_current_settings
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from prefect.results import ResultStore
|
10
|
+
|
11
|
+
UpstreamResources = Sequence[Union[RelatedResource, dict[str, str]]]
|
12
|
+
DownstreamResources = Sequence[Union[Resource, dict[str, str]]]
|
13
|
+
|
14
|
+
# Map block types to their URI schemes
|
15
|
+
STORAGE_URI_SCHEMES = {
|
16
|
+
"local-file-system": "file://{path}",
|
17
|
+
"s3-bucket": "s3://{storage.bucket_name}/{path}",
|
18
|
+
"gcs-bucket": "gs://{storage.bucket}/{path}",
|
19
|
+
"azure-blob-storage": "azure-blob://{storage.container_name}/{path}",
|
20
|
+
}
|
21
|
+
|
22
|
+
|
23
|
+
def get_result_resource_uri(
|
24
|
+
store: "ResultStore",
|
25
|
+
key: str,
|
26
|
+
) -> Optional[str]:
|
27
|
+
"""
|
28
|
+
Generate a URI for a result based on its storage backend.
|
29
|
+
|
30
|
+
Args:
|
31
|
+
store: A `ResultStore` instance.
|
32
|
+
key: The key of the result to generate a URI for.
|
33
|
+
"""
|
34
|
+
storage = store.result_storage
|
35
|
+
if storage is None:
|
36
|
+
return
|
37
|
+
|
38
|
+
path = store._resolved_key_path(key)
|
39
|
+
|
40
|
+
block_type = storage.get_block_type_slug()
|
41
|
+
if block_type and block_type in STORAGE_URI_SCHEMES:
|
42
|
+
return STORAGE_URI_SCHEMES[block_type].format(storage=storage, path=path)
|
43
|
+
|
44
|
+
# Generic fallback
|
45
|
+
return f"prefect://{block_type}/{path}"
|
46
|
+
|
47
|
+
|
48
|
+
async def emit_lineage_event(
|
49
|
+
event_name: str,
|
50
|
+
upstream_resources: Optional[UpstreamResources] = None,
|
51
|
+
downstream_resources: Optional[DownstreamResources] = None,
|
52
|
+
direction_of_run_from_event: Literal["upstream", "downstream"] = "downstream",
|
53
|
+
) -> None:
|
54
|
+
"""Emit lineage events showing relationships between resources.
|
55
|
+
|
56
|
+
Args:
|
57
|
+
event_name: The name of the event to emit
|
58
|
+
upstream_resources: Optional list of RelatedResources that were upstream of
|
59
|
+
the event
|
60
|
+
downstream_resources: Optional list of Resources that were downstream
|
61
|
+
of the event
|
62
|
+
direction_of_run_from_event: The direction of the current run from
|
63
|
+
the event. E.g., if we're in a flow run and
|
64
|
+
`direction_of_run_from_event` is "downstream", then the flow run is
|
65
|
+
considered downstream of the resource's event.
|
66
|
+
"""
|
67
|
+
from prefect.client.orchestration import get_client # Avoid a circular import
|
68
|
+
|
69
|
+
if not get_current_settings().experiments.lineage_events_enabled:
|
70
|
+
return
|
71
|
+
|
72
|
+
upstream_resources = list(upstream_resources) if upstream_resources else []
|
73
|
+
downstream_resources = list(downstream_resources) if downstream_resources else []
|
74
|
+
|
75
|
+
async with get_client() as client:
|
76
|
+
related_resources = await related_resources_from_run_context(client)
|
77
|
+
|
78
|
+
# NOTE: We handle adding run-related resources to the event here instead of in
|
79
|
+
# the EventsWorker because not all run-related resources are upstream from
|
80
|
+
# every lineage event (they might be downstream). The EventsWorker only adds
|
81
|
+
# related resources to the "related" field in the event, which, for
|
82
|
+
# lineage-related events, tracks upstream resources only. For downstream
|
83
|
+
# resources, we need to emit an event for each downstream resource.
|
84
|
+
if direction_of_run_from_event == "downstream":
|
85
|
+
downstream_resources.extend(related_resources)
|
86
|
+
else:
|
87
|
+
upstream_resources.extend(related_resources)
|
88
|
+
|
89
|
+
# Emit an event for each downstream resource. This is necessary because
|
90
|
+
# our event schema allows one primary resource and many related resources,
|
91
|
+
# and for the purposes of lineage, related resources can only represent
|
92
|
+
# upstream resources.
|
93
|
+
for resource in downstream_resources:
|
94
|
+
# Downstream lineage resources need to have the
|
95
|
+
# prefect.resource.lineage-group label. All upstram resources from a
|
96
|
+
# downstream resource with this label will be considered lineage-related
|
97
|
+
# resources.
|
98
|
+
if "prefect.resource.lineage-group" not in resource:
|
99
|
+
resource["prefect.resource.lineage-group"] = "global"
|
100
|
+
|
101
|
+
emit_kwargs: Dict[str, Any] = {
|
102
|
+
"event": event_name,
|
103
|
+
"resource": resource,
|
104
|
+
"related": upstream_resources,
|
105
|
+
}
|
106
|
+
|
107
|
+
emit_event(**emit_kwargs)
|
108
|
+
|
109
|
+
|
110
|
+
async def emit_result_read_event(
|
111
|
+
store: "ResultStore",
|
112
|
+
result_key: str,
|
113
|
+
downstream_resources: Optional[DownstreamResources] = None,
|
114
|
+
cached: bool = False,
|
115
|
+
) -> None:
|
116
|
+
"""
|
117
|
+
Emit a lineage event showing a task or flow result was read.
|
118
|
+
|
119
|
+
Args:
|
120
|
+
store: A `ResultStore` instance.
|
121
|
+
result_key: The key of the result to generate a URI for.
|
122
|
+
downstream_resources: List of resources that were
|
123
|
+
downstream of the event's resource.
|
124
|
+
"""
|
125
|
+
if not get_current_settings().experiments.lineage_events_enabled:
|
126
|
+
return
|
127
|
+
|
128
|
+
result_resource_uri = get_result_resource_uri(store, result_key)
|
129
|
+
if result_resource_uri:
|
130
|
+
upstream_resources = [
|
131
|
+
RelatedResource(
|
132
|
+
root={
|
133
|
+
"prefect.resource.id": result_resource_uri,
|
134
|
+
"prefect.resource.role": "result",
|
135
|
+
}
|
136
|
+
)
|
137
|
+
]
|
138
|
+
event_name = "prefect.result.read"
|
139
|
+
if cached:
|
140
|
+
event_name += ".cached"
|
141
|
+
|
142
|
+
await emit_lineage_event(
|
143
|
+
event_name=event_name,
|
144
|
+
upstream_resources=upstream_resources,
|
145
|
+
downstream_resources=downstream_resources,
|
146
|
+
direction_of_run_from_event="downstream",
|
147
|
+
)
|
148
|
+
|
149
|
+
|
150
|
+
async def emit_result_write_event(
|
151
|
+
store: "ResultStore",
|
152
|
+
result_key: str,
|
153
|
+
upstream_resources: Optional[UpstreamResources] = None,
|
154
|
+
) -> None:
|
155
|
+
"""
|
156
|
+
Emit a lineage event showing a task or flow result was written.
|
157
|
+
|
158
|
+
Args:
|
159
|
+
store: A `ResultStore` instance.
|
160
|
+
result_key: The key of the result to generate a URI for.
|
161
|
+
upstream_resources: Optional list of resources that were
|
162
|
+
upstream of the event's resource.
|
163
|
+
"""
|
164
|
+
if not get_current_settings().experiments.lineage_events_enabled:
|
165
|
+
return
|
166
|
+
|
167
|
+
result_resource_uri = get_result_resource_uri(store, result_key)
|
168
|
+
if result_resource_uri:
|
169
|
+
downstream_resources = [
|
170
|
+
{
|
171
|
+
"prefect.resource.id": result_resource_uri,
|
172
|
+
"prefect.resource.role": "result",
|
173
|
+
"prefect.resource.lineage-group": "global",
|
174
|
+
}
|
175
|
+
]
|
176
|
+
await emit_lineage_event(
|
177
|
+
event_name="prefect.result.write",
|
178
|
+
upstream_resources=upstream_resources,
|
179
|
+
downstream_resources=downstream_resources,
|
180
|
+
direction_of_run_from_event="upstream",
|
181
|
+
)
|
{prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/compatibility/async_dispatch.py
RENAMED
@@ -1,11 +1,12 @@
|
|
1
1
|
import asyncio
|
2
2
|
import inspect
|
3
3
|
from functools import wraps
|
4
|
-
from typing import Any, Callable, Coroutine, Optional, TypeVar, Union
|
4
|
+
from typing import TYPE_CHECKING, Any, Callable, Coroutine, Optional, TypeVar, Union
|
5
5
|
|
6
6
|
from typing_extensions import ParamSpec
|
7
7
|
|
8
|
-
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from prefect.tasks import Task
|
9
10
|
|
10
11
|
R = TypeVar("R")
|
11
12
|
P = ParamSpec("P")
|
@@ -13,20 +14,46 @@ P = ParamSpec("P")
|
|
13
14
|
|
14
15
|
def is_in_async_context() -> bool:
|
15
16
|
"""
|
16
|
-
Returns True if called from within an async context
|
17
|
+
Returns True if called from within an async context.
|
18
|
+
|
19
|
+
An async context is one of:
|
20
|
+
- a coroutine
|
21
|
+
- a running event loop
|
22
|
+
- a task or flow that is async
|
17
23
|
"""
|
24
|
+
from prefect.context import get_run_context
|
25
|
+
from prefect.exceptions import MissingContextError
|
26
|
+
|
18
27
|
try:
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
28
|
+
run_ctx = get_run_context()
|
29
|
+
parent_obj = getattr(run_ctx, "task", None)
|
30
|
+
if not parent_obj:
|
31
|
+
parent_obj = getattr(run_ctx, "flow", None)
|
32
|
+
return getattr(parent_obj, "isasync", True)
|
33
|
+
except MissingContextError:
|
34
|
+
# not in an execution context, make best effort to
|
35
|
+
# decide whether to syncify
|
36
|
+
try:
|
37
|
+
asyncio.get_running_loop()
|
38
|
+
return True
|
39
|
+
except RuntimeError:
|
40
|
+
return False
|
23
41
|
|
24
42
|
|
25
|
-
def _is_acceptable_callable(
|
43
|
+
def _is_acceptable_callable(
|
44
|
+
obj: Union[Callable[P, R], "Task[P, R]", classmethod],
|
45
|
+
) -> bool:
|
26
46
|
if inspect.iscoroutinefunction(obj):
|
27
47
|
return True
|
28
|
-
|
48
|
+
|
49
|
+
# Check if a task or flow. Need to avoid importing `Task` or `Flow` here
|
50
|
+
# due to circular imports.
|
51
|
+
if (fn := getattr(obj, "fn", None)) and inspect.iscoroutinefunction(fn):
|
29
52
|
return True
|
53
|
+
|
54
|
+
if isinstance(obj, classmethod) and inspect.iscoroutinefunction(obj.__func__):
|
55
|
+
return True
|
56
|
+
|
30
57
|
return False
|
31
58
|
|
32
59
|
|
@@ -56,6 +83,8 @@ def async_dispatch(
|
|
56
83
|
|
57
84
|
if should_run_sync:
|
58
85
|
return sync_fn(*args, **kwargs)
|
86
|
+
if isinstance(async_impl, classmethod):
|
87
|
+
return async_impl.__func__(*args, **kwargs)
|
59
88
|
return async_impl(*args, **kwargs)
|
60
89
|
|
61
90
|
return wrapper # type: ignore
|
{prefect-client-3.1.6 → prefect-client-3.1.7}/src/prefect/_internal/pydantic/v2_validated_func.py
RENAMED
@@ -6,16 +6,17 @@ Specifically it allows for us to validate v2 models used as flow/task
|
|
6
6
|
arguments.
|
7
7
|
"""
|
8
8
|
|
9
|
-
from typing import TYPE_CHECKING, Any,
|
9
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Optional, Union
|
10
10
|
|
11
11
|
# importing directly from v2 to be able to create a v2 model
|
12
12
|
from pydantic import BaseModel, ConfigDict, create_model, field_validator
|
13
13
|
from pydantic.v1.decorator import ValidatedFunction
|
14
14
|
from pydantic.v1.errors import ConfigError
|
15
15
|
from pydantic.v1.utils import to_camel
|
16
|
+
from typing_extensions import TypeAlias
|
16
17
|
|
17
18
|
if TYPE_CHECKING:
|
18
|
-
ConfigType = Union[None,
|
19
|
+
ConfigType: TypeAlias = Union[None, type[Any], dict[str, Any]]
|
19
20
|
|
20
21
|
V_POSITIONAL_ONLY_NAME = "v__positional_only"
|
21
22
|
V_DUPLICATE_KWARGS = "v__duplicate_kwargs"
|
@@ -24,13 +25,17 @@ V_DUPLICATE_KWARGS = "v__duplicate_kwargs"
|
|
24
25
|
class V2ValidatedFunction(ValidatedFunction):
|
25
26
|
def create_model(
|
26
27
|
self,
|
27
|
-
fields:
|
28
|
+
fields: dict[str, Any],
|
28
29
|
takes_args: bool,
|
29
30
|
takes_kwargs: bool,
|
30
|
-
config:
|
31
|
+
config: "ConfigType",
|
31
32
|
) -> None:
|
32
33
|
pos_args = len(self.arg_mapping)
|
33
34
|
|
35
|
+
config = {} if config is None else config
|
36
|
+
if not isinstance(config, dict):
|
37
|
+
raise TypeError(f"config must be None or a dict, got {type(config)}")
|
38
|
+
|
34
39
|
if config.get("fields") or config.get("alias_generator"):
|
35
40
|
raise ConfigError(
|
36
41
|
'Setting the "fields" and "alias_generator" property on custom Config'
|
@@ -42,11 +47,11 @@ class V2ValidatedFunction(ValidatedFunction):
|
|
42
47
|
|
43
48
|
# This is the key change -- inheriting the BaseModel class from v2
|
44
49
|
class DecoratorBaseModel(BaseModel):
|
45
|
-
model_config = config
|
50
|
+
model_config: ClassVar[ConfigDict] = ConfigDict(**config)
|
46
51
|
|
47
52
|
@field_validator(self.v_args_name, check_fields=False)
|
48
53
|
@classmethod
|
49
|
-
def check_args(cls, v: Optional[
|
54
|
+
def check_args(cls, v: Optional[list[Any]]) -> Optional[list[Any]]:
|
50
55
|
if takes_args or v is None:
|
51
56
|
return v
|
52
57
|
|
@@ -58,8 +63,8 @@ class V2ValidatedFunction(ValidatedFunction):
|
|
58
63
|
@field_validator(self.v_kwargs_name, check_fields=False)
|
59
64
|
@classmethod
|
60
65
|
def check_kwargs(
|
61
|
-
cls, v: Optional[
|
62
|
-
) -> Optional[
|
66
|
+
cls, v: Optional[dict[str, Any]]
|
67
|
+
) -> Optional[dict[str, Any]]:
|
63
68
|
if takes_kwargs or v is None:
|
64
69
|
return v
|
65
70
|
|
@@ -69,7 +74,7 @@ class V2ValidatedFunction(ValidatedFunction):
|
|
69
74
|
|
70
75
|
@field_validator(V_POSITIONAL_ONLY_NAME, check_fields=False)
|
71
76
|
@classmethod
|
72
|
-
def check_positional_only(cls, v: Optional[
|
77
|
+
def check_positional_only(cls, v: Optional[list[str]]) -> None:
|
73
78
|
if v is None:
|
74
79
|
return
|
75
80
|
|
@@ -82,7 +87,7 @@ class V2ValidatedFunction(ValidatedFunction):
|
|
82
87
|
|
83
88
|
@field_validator(V_DUPLICATE_KWARGS, check_fields=False)
|
84
89
|
@classmethod
|
85
|
-
def check_duplicate_kwargs(cls, v: Optional[
|
90
|
+
def check_duplicate_kwargs(cls, v: Optional[list[str]]) -> None:
|
86
91
|
if v is None:
|
87
92
|
return
|
88
93
|
|
@@ -1,10 +1,15 @@
|
|
1
1
|
import asyncio
|
2
2
|
from functools import wraps
|
3
|
-
from typing import
|
3
|
+
from typing import Callable, Optional, Tuple, Type, TypeVar
|
4
|
+
|
5
|
+
from typing_extensions import ParamSpec
|
4
6
|
|
5
7
|
from prefect._internal._logging import logger
|
6
8
|
from prefect.utilities.math import clamped_poisson_interval
|
7
9
|
|
10
|
+
P = ParamSpec("P")
|
11
|
+
R = TypeVar("R")
|
12
|
+
|
8
13
|
|
9
14
|
def exponential_backoff_with_jitter(
|
10
15
|
attempt: int, base_delay: float, max_delay: float
|
@@ -21,7 +26,8 @@ def retry_async_fn(
|
|
21
26
|
base_delay: float = 1,
|
22
27
|
max_delay: float = 10,
|
23
28
|
retry_on_exceptions: Tuple[Type[Exception], ...] = (Exception,),
|
24
|
-
|
29
|
+
operation_name: Optional[str] = None,
|
30
|
+
) -> Callable[[Callable[P, R]], Callable[P, R]]:
|
25
31
|
"""A decorator for retrying an async function.
|
26
32
|
|
27
33
|
Args:
|
@@ -33,23 +39,26 @@ def retry_async_fn(
|
|
33
39
|
max_delay: The maximum delay to use for the last attempt.
|
34
40
|
retry_on_exceptions: A tuple of exception types to retry on. Defaults to
|
35
41
|
retrying on all exceptions.
|
42
|
+
operation_name: Optional name to use for logging the operation instead of
|
43
|
+
the function name. If None, uses the function name.
|
36
44
|
"""
|
37
45
|
|
38
|
-
def decorator(func):
|
46
|
+
def decorator(func: Callable[P, R]) -> Callable[P, R]:
|
39
47
|
@wraps(func)
|
40
|
-
async def wrapper(*args:
|
48
|
+
async def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
|
49
|
+
name = operation_name or func.__name__
|
41
50
|
for attempt in range(max_attempts):
|
42
51
|
try:
|
43
52
|
return await func(*args, **kwargs)
|
44
53
|
except retry_on_exceptions as e:
|
45
54
|
if attempt == max_attempts - 1:
|
46
55
|
logger.exception(
|
47
|
-
f"Function {
|
56
|
+
f"Function {name!r} failed after {max_attempts} attempts"
|
48
57
|
)
|
49
58
|
raise
|
50
59
|
delay = backoff_strategy(attempt, base_delay, max_delay)
|
51
60
|
logger.warning(
|
52
|
-
f"Attempt {attempt + 1} of function {
|
61
|
+
f"Attempt {attempt + 1} of function {name!r} failed with {type(e).__name__}: {str(e)}. "
|
53
62
|
f"Retrying in {delay:.2f} seconds..."
|
54
63
|
)
|
55
64
|
await asyncio.sleep(delay)
|
@@ -18,9 +18,9 @@ from uuid import UUID
|
|
18
18
|
import jsonschema
|
19
19
|
import pendulum
|
20
20
|
import yaml
|
21
|
-
from pydantic_extra_types.pendulum_dt import DateTime
|
22
21
|
|
23
22
|
from prefect.exceptions import InvalidRepositoryURLError
|
23
|
+
from prefect.types import DateTime
|
24
24
|
from prefect.utilities.collections import isiterable
|
25
25
|
from prefect.utilities.dockerutils import get_prefect_image_name
|
26
26
|
from prefect.utilities.filesystem import relative_path_to_current_platform
|
@@ -33,6 +33,7 @@ LOWERCASE_LETTERS_NUMBERS_AND_UNDERSCORES_REGEX = "^[a-z0-9_]*$"
|
|
33
33
|
|
34
34
|
if TYPE_CHECKING:
|
35
35
|
from prefect.blocks.core import Block
|
36
|
+
from prefect.serializers import Serializer
|
36
37
|
from prefect.utilities.callables import ParameterSchema
|
37
38
|
|
38
39
|
|
@@ -578,7 +579,7 @@ def validate_picklelib_and_modules(values: dict) -> dict:
|
|
578
579
|
return values
|
579
580
|
|
580
581
|
|
581
|
-
def validate_dump_kwargs(value: dict) -> dict:
|
582
|
+
def validate_dump_kwargs(value: dict[str, Any]) -> dict[str, Any]:
|
582
583
|
# `default` is set by `object_encoder`. A user provided callable would make this
|
583
584
|
# class unserializable anyway.
|
584
585
|
if "default" in value:
|
@@ -586,7 +587,7 @@ def validate_dump_kwargs(value: dict) -> dict:
|
|
586
587
|
return value
|
587
588
|
|
588
589
|
|
589
|
-
def validate_load_kwargs(value: dict) -> dict:
|
590
|
+
def validate_load_kwargs(value: dict[str, Any]) -> dict[str, Any]:
|
590
591
|
# `object_hook` is set by `object_decoder`. A user provided callable would make
|
591
592
|
# this class unserializable anyway.
|
592
593
|
if "object_hook" in value:
|
@@ -596,7 +597,7 @@ def validate_load_kwargs(value: dict) -> dict:
|
|
596
597
|
return value
|
597
598
|
|
598
599
|
|
599
|
-
def cast_type_names_to_serializers(value):
|
600
|
+
def cast_type_names_to_serializers(value: Union[str, "Serializer"]) -> "Serializer":
|
600
601
|
from prefect.serializers import Serializer
|
601
602
|
|
602
603
|
if isinstance(value, str):
|
@@ -8,11 +8,11 @@ import json
|
|
8
8
|
|
9
9
|
version_json = '''
|
10
10
|
{
|
11
|
-
"date": "2024-12-
|
11
|
+
"date": "2024-12-16T10:06:12-0800",
|
12
12
|
"dirty": true,
|
13
13
|
"error": null,
|
14
|
-
"full-revisionid": "
|
15
|
-
"version": "3.1.
|
14
|
+
"full-revisionid": "c05ffa6d1816f980d574b42119dffb9f8c8300a3",
|
15
|
+
"version": "3.1.7"
|
16
16
|
}
|
17
17
|
''' # END VERSION_JSON
|
18
18
|
|