prefect-client 3.0.0rc14__tar.gz → 3.0.0rc15__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.0.0rc14/src/prefect_client.egg-info → prefect-client-3.0.0rc15}/PKG-INFO +1 -1
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/requirements-client.txt +1 -2
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/requirements-dev.txt +1 -1
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/compatibility/deprecated.py +0 -53
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/context.py +2 -1
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/clients.py +39 -56
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/utilities.py +0 -2
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/flows.py +10 -4
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/futures.py +0 -5
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/profiles.toml +3 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runner/storage.py +4 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/settings.py +73 -12
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/task_engine.py +54 -12
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/task_worker.py +4 -1
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/tasks.py +9 -5
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/asyncutils.py +0 -6
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/engine.py +3 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15/src/prefect_client.egg-info}/PKG-INFO +1 -1
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect_client.egg-info/requires.txt +0 -1
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/LICENSE +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/MANIFEST.in +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/README.md +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/requirements.txt +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/setup.cfg +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/setup.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/.prefectignore +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/_logging.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/compatibility/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/compatibility/experimental.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/compatibility/migration.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/api.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/calls.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/cancellation.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/event_loop.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/inspection.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/primitives.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/services.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/threads.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/concurrency/waiters.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/integrations.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/pydantic/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/pydantic/schemas.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/pytz.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/retries.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/schemas/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/schemas/bases.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/schemas/fields.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/schemas/serializers.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_internal/schemas/validators.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/_version.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/agent.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/artifacts.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/automations.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/blocks/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/blocks/abstract.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/blocks/core.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/blocks/fields.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/blocks/notifications.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/blocks/redis.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/blocks/system.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/blocks/webhook.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/cache_policies.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/base.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/cloud.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/collections.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/constants.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/orchestration.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/schemas/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/schemas/actions.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/schemas/filters.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/schemas/objects.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/schemas/responses.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/schemas/schedules.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/schemas/sorting.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/subscriptions.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/types/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/types/flexible_schedule_list.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/client/utilities.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/concurrency/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/concurrency/asyncio.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/concurrency/context.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/concurrency/events.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/concurrency/services.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/concurrency/sync.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/base.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/deployments.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/flow_runs.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/runner.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/schedules.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/steps/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/steps/core.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/steps/pull.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/deployments/steps/utility.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/docker/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/docker/docker_image.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/engine.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/actions.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/cli/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/cli/automations.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/filters.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/related.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/schemas/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/schemas/automations.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/schemas/deployment_triggers.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/schemas/events.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/schemas/labelling.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/events/worker.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/exceptions.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/filesystems.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/flow_engine.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/flow_runs.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/infrastructure/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/infrastructure/base.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/infrastructure/provisioners/modal.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/input/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/input/actions.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/input/run_input.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/logging/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/logging/configuration.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/logging/filters.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/logging/formatters.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/logging/handlers.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/logging/highlighters.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/logging/loggers.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/logging/logging.yml +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/main.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/manifests.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/plugins.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/py.typed +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/records/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/records/result_store.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/records/store.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/results.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runner/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runner/runner.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runner/server.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runner/submit.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runner/utils.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runtime/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runtime/deployment.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runtime/flow_run.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/runtime/task_run.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/serializers.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/states.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/task_runners.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/task_runs.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/transactions.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/types/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/types/entrypoint.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/annotations.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/callables.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/collections.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/compat.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/context.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/dispatch.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/dockerutils.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/filesystem.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/hashing.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/importtools.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/math.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/names.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/processutils.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/pydantic.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/render_swagger.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/schema_tools/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/schema_tools/hydration.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/schema_tools/validation.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/services.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/slugify.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/templating.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/text.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/timeout.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/urls.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/utilities/visualization.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/variables.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/workers/__init__.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/workers/base.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/workers/block.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/workers/cloud.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/workers/process.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/workers/server.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect/workers/utilities.py +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect_client.egg-info/SOURCES.txt +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect_client.egg-info/dependency_links.txt +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/src/prefect_client.egg-info/top_level.txt +0 -0
- {prefect-client-3.0.0rc14 → prefect-client-3.0.0rc15}/versioneer.py +0 -0
@@ -9,7 +9,7 @@ numpy
|
|
9
9
|
pillow
|
10
10
|
pre-commit
|
11
11
|
pluggy >= 1.4.0
|
12
|
-
pytest > 7, <
|
12
|
+
pytest > 7, < 9
|
13
13
|
pytest-asyncio >= 0.18.2, != 0.22.0, < 0.23.0 # Cannot override event loop in 0.23.0. See https://github.com/pytest-dev/pytest-asyncio/issues/706 for more details.
|
14
14
|
pytest-benchmark
|
15
15
|
pytest-codspeed
|
@@ -16,7 +16,6 @@ import warnings
|
|
16
16
|
from typing import Any, Callable, List, Optional, Type, TypeVar
|
17
17
|
|
18
18
|
import pendulum
|
19
|
-
import wrapt
|
20
19
|
from pydantic import BaseModel
|
21
20
|
|
22
21
|
from prefect.utilities.callables import get_call_parameters
|
@@ -273,55 +272,3 @@ def register_renamed_module(old_name: str, new_name: str, start_date: str):
|
|
273
272
|
DEPRECATED_MODULE_ALIASES.append(
|
274
273
|
AliasedModuleDefinition(old_name, new_name, callback)
|
275
274
|
)
|
276
|
-
|
277
|
-
|
278
|
-
class AsyncCompatProxy(wrapt.ObjectProxy):
|
279
|
-
"""
|
280
|
-
A proxy object that allows for awaiting a method that is no longer async.
|
281
|
-
|
282
|
-
See https://wrapt.readthedocs.io/en/master/wrappers.html#object-proxy for more
|
283
|
-
"""
|
284
|
-
|
285
|
-
def __init__(self, wrapped, class_name: str, method_name: str):
|
286
|
-
super().__init__(wrapped)
|
287
|
-
self._self_class_name = class_name
|
288
|
-
self._self_method_name = method_name
|
289
|
-
self._self_already_awaited = False
|
290
|
-
|
291
|
-
def __await__(self):
|
292
|
-
if not self._self_already_awaited:
|
293
|
-
warnings.warn(
|
294
|
-
(
|
295
|
-
f"The {self._self_method_name!r} method on {self._self_class_name!r}"
|
296
|
-
" is no longer async and awaiting it will raise an error after Dec 2024"
|
297
|
-
" - please remove the `await` keyword."
|
298
|
-
),
|
299
|
-
DeprecationWarning,
|
300
|
-
stacklevel=2,
|
301
|
-
)
|
302
|
-
self._self_already_awaited = True
|
303
|
-
yield
|
304
|
-
return self.__wrapped__
|
305
|
-
|
306
|
-
def __repr__(self):
|
307
|
-
return repr(self.__wrapped__)
|
308
|
-
|
309
|
-
def __reduce_ex__(self, protocol):
|
310
|
-
return (
|
311
|
-
type(self),
|
312
|
-
(self.__wrapped__,),
|
313
|
-
{"_self_already_awaited": self._self_already_awaited},
|
314
|
-
)
|
315
|
-
|
316
|
-
|
317
|
-
def deprecated_async_method(wrapped):
|
318
|
-
"""Decorator that wraps a sync method to allow awaiting it even though it is no longer async."""
|
319
|
-
|
320
|
-
@wrapt.decorator
|
321
|
-
def wrapper(wrapped, instance, args, kwargs):
|
322
|
-
result = wrapped(*args, **kwargs)
|
323
|
-
return AsyncCompatProxy(
|
324
|
-
result, class_name=instance.__class__.__name__, method_name=wrapped.__name__
|
325
|
-
)
|
326
|
-
|
327
|
-
return wrapper(wrapped)
|
@@ -91,11 +91,12 @@ def hydrated_context(
|
|
91
91
|
client = client or get_client(sync_client=True)
|
92
92
|
if flow_run_context := serialized_context.get("flow_run_context"):
|
93
93
|
flow = flow_run_context["flow"]
|
94
|
+
task_runner = stack.enter_context(flow.task_runner.duplicate())
|
94
95
|
flow_run_context = FlowRunContext(
|
95
96
|
**flow_run_context,
|
96
97
|
client=client,
|
97
98
|
result_factory=run_coro_as_sync(ResultFactory.from_flow(flow)),
|
98
|
-
task_runner=
|
99
|
+
task_runner=task_runner,
|
99
100
|
detached=True,
|
100
101
|
)
|
101
102
|
stack.enter_context(flow_run_context)
|
@@ -15,7 +15,6 @@ from typing import (
|
|
15
15
|
)
|
16
16
|
from uuid import UUID
|
17
17
|
|
18
|
-
import httpx
|
19
18
|
import orjson
|
20
19
|
import pendulum
|
21
20
|
from cachetools import TTLCache
|
@@ -29,10 +28,14 @@ from websockets.exceptions import (
|
|
29
28
|
ConnectionClosedOK,
|
30
29
|
)
|
31
30
|
|
32
|
-
from prefect.client.base import PrefectHttpxAsyncClient
|
33
31
|
from prefect.events import Event
|
34
32
|
from prefect.logging import get_logger
|
35
|
-
from prefect.settings import
|
33
|
+
from prefect.settings import (
|
34
|
+
PREFECT_API_KEY,
|
35
|
+
PREFECT_API_URL,
|
36
|
+
PREFECT_CLOUD_API_URL,
|
37
|
+
PREFECT_SERVER_ALLOW_EPHEMERAL_MODE,
|
38
|
+
)
|
36
39
|
|
37
40
|
if TYPE_CHECKING:
|
38
41
|
from prefect.events.filters import EventFilter
|
@@ -66,7 +69,7 @@ logger = get_logger(__name__)
|
|
66
69
|
|
67
70
|
def get_events_client(
|
68
71
|
reconnection_attempts: int = 10,
|
69
|
-
checkpoint_every: int =
|
72
|
+
checkpoint_every: int = 700,
|
70
73
|
) -> "EventsClient":
|
71
74
|
api_url = PREFECT_API_URL.value()
|
72
75
|
if isinstance(api_url, str) and api_url.startswith(PREFECT_CLOUD_API_URL.value()):
|
@@ -74,13 +77,25 @@ def get_events_client(
|
|
74
77
|
reconnection_attempts=reconnection_attempts,
|
75
78
|
checkpoint_every=checkpoint_every,
|
76
79
|
)
|
77
|
-
elif
|
80
|
+
elif api_url:
|
81
|
+
return PrefectEventsClient(
|
82
|
+
reconnection_attempts=reconnection_attempts,
|
83
|
+
checkpoint_every=checkpoint_every,
|
84
|
+
)
|
85
|
+
elif PREFECT_SERVER_ALLOW_EPHEMERAL_MODE:
|
86
|
+
from prefect.server.api.server import SubprocessASGIServer
|
87
|
+
|
88
|
+
server = SubprocessASGIServer()
|
89
|
+
server.start()
|
78
90
|
return PrefectEventsClient(
|
91
|
+
api_url=server.api_url,
|
79
92
|
reconnection_attempts=reconnection_attempts,
|
80
93
|
checkpoint_every=checkpoint_every,
|
81
94
|
)
|
82
95
|
else:
|
83
|
-
|
96
|
+
raise ValueError(
|
97
|
+
"No Prefect API URL provided. Please set PREFECT_API_URL to the address of a running Prefect server."
|
98
|
+
)
|
84
99
|
|
85
100
|
|
86
101
|
def get_events_subscriber(
|
@@ -88,20 +103,29 @@ def get_events_subscriber(
|
|
88
103
|
reconnection_attempts: int = 10,
|
89
104
|
) -> "PrefectEventSubscriber":
|
90
105
|
api_url = PREFECT_API_URL.value()
|
91
|
-
if not api_url:
|
92
|
-
raise ValueError(
|
93
|
-
"A Prefect server or Prefect Cloud is required to start an event "
|
94
|
-
"subscriber. Please check the PREFECT_API_URL setting in your profile."
|
95
|
-
)
|
96
106
|
|
97
107
|
if isinstance(api_url, str) and api_url.startswith(PREFECT_CLOUD_API_URL.value()):
|
98
108
|
return PrefectCloudEventSubscriber(
|
99
109
|
filter=filter, reconnection_attempts=reconnection_attempts
|
100
110
|
)
|
101
|
-
|
111
|
+
elif api_url:
|
102
112
|
return PrefectEventSubscriber(
|
103
113
|
filter=filter, reconnection_attempts=reconnection_attempts
|
104
114
|
)
|
115
|
+
elif PREFECT_SERVER_ALLOW_EPHEMERAL_MODE:
|
116
|
+
from prefect.server.api.server import SubprocessASGIServer
|
117
|
+
|
118
|
+
server = SubprocessASGIServer()
|
119
|
+
server.start()
|
120
|
+
return PrefectEventSubscriber(
|
121
|
+
api_url=server.api_url,
|
122
|
+
filter=filter,
|
123
|
+
reconnection_attempts=reconnection_attempts,
|
124
|
+
)
|
125
|
+
else:
|
126
|
+
raise ValueError(
|
127
|
+
"No Prefect API URL provided. Please set PREFECT_API_URL to the address of a running Prefect server."
|
128
|
+
)
|
105
129
|
|
106
130
|
|
107
131
|
class EventsClient(abc.ABC):
|
@@ -201,47 +225,6 @@ def _get_api_url_and_key(
|
|
201
225
|
return api_url, api_key
|
202
226
|
|
203
227
|
|
204
|
-
class PrefectEphemeralEventsClient(EventsClient):
|
205
|
-
"""A Prefect Events client that sends events to an ephemeral Prefect server"""
|
206
|
-
|
207
|
-
def __init__(self):
|
208
|
-
if PREFECT_API_KEY.value():
|
209
|
-
raise ValueError(
|
210
|
-
"PrefectEphemeralEventsClient cannot be used when PREFECT_API_KEY is set."
|
211
|
-
" Please use PrefectEventsClient or PrefectCloudEventsClient instead."
|
212
|
-
)
|
213
|
-
from prefect.server.api.server import create_app
|
214
|
-
|
215
|
-
app = create_app(ephemeral=True)
|
216
|
-
|
217
|
-
self._http_client = PrefectHttpxAsyncClient(
|
218
|
-
transport=httpx.ASGITransport(app=app, raise_app_exceptions=False),
|
219
|
-
base_url="http://ephemeral-prefect/api",
|
220
|
-
enable_csrf_support=False,
|
221
|
-
)
|
222
|
-
|
223
|
-
async def __aenter__(self) -> Self:
|
224
|
-
await super().__aenter__()
|
225
|
-
await self._http_client.__aenter__()
|
226
|
-
return self
|
227
|
-
|
228
|
-
async def __aexit__(
|
229
|
-
self,
|
230
|
-
exc_type: Optional[Type[Exception]],
|
231
|
-
exc_val: Optional[Exception],
|
232
|
-
exc_tb: Optional[TracebackType],
|
233
|
-
) -> None:
|
234
|
-
self._websocket = None
|
235
|
-
await self._http_client.__aexit__(exc_type, exc_val, exc_tb)
|
236
|
-
return await super().__aexit__(exc_type, exc_val, exc_tb)
|
237
|
-
|
238
|
-
async def _emit(self, event: Event) -> None:
|
239
|
-
await self._http_client.post(
|
240
|
-
"/events",
|
241
|
-
json=[event.model_dump(mode="json")],
|
242
|
-
)
|
243
|
-
|
244
|
-
|
245
228
|
class PrefectEventsClient(EventsClient):
|
246
229
|
"""A Prefect Events client that streams events to a Prefect server"""
|
247
230
|
|
@@ -252,7 +235,7 @@ class PrefectEventsClient(EventsClient):
|
|
252
235
|
self,
|
253
236
|
api_url: Optional[str] = None,
|
254
237
|
reconnection_attempts: int = 10,
|
255
|
-
checkpoint_every: int =
|
238
|
+
checkpoint_every: int = 700,
|
256
239
|
):
|
257
240
|
"""
|
258
241
|
Args:
|
@@ -371,7 +354,7 @@ class PrefectCloudEventsClient(PrefectEventsClient):
|
|
371
354
|
api_url: Optional[str] = None,
|
372
355
|
api_key: Optional[str] = None,
|
373
356
|
reconnection_attempts: int = 10,
|
374
|
-
checkpoint_every: int =
|
357
|
+
checkpoint_every: int = 700,
|
375
358
|
):
|
376
359
|
"""
|
377
360
|
Args:
|
@@ -435,9 +418,9 @@ class PrefectEventSubscriber:
|
|
435
418
|
reconnection_attempts: When the client is disconnected, how many times
|
436
419
|
the client should attempt to reconnect
|
437
420
|
"""
|
421
|
+
self._api_key = None
|
438
422
|
if not api_url:
|
439
423
|
api_url = cast(str, PREFECT_API_URL.value())
|
440
|
-
self._api_key = None
|
441
424
|
|
442
425
|
from prefect.events.filters import EventFilter
|
443
426
|
|
@@ -8,7 +8,6 @@ from pydantic_extra_types.pendulum_dt import DateTime
|
|
8
8
|
from .clients import (
|
9
9
|
AssertingEventsClient,
|
10
10
|
PrefectCloudEventsClient,
|
11
|
-
PrefectEphemeralEventsClient,
|
12
11
|
PrefectEventsClient,
|
13
12
|
)
|
14
13
|
from .schemas.events import Event, RelatedResource
|
@@ -53,7 +52,6 @@ def emit_event(
|
|
53
52
|
AssertingEventsClient,
|
54
53
|
PrefectCloudEventsClient,
|
55
54
|
PrefectEventsClient,
|
56
|
-
PrefectEphemeralEventsClient,
|
57
55
|
]
|
58
56
|
worker_instance = EventsWorker.instance()
|
59
57
|
|
@@ -66,6 +66,7 @@ from prefect.exceptions import (
|
|
66
66
|
ObjectNotFound,
|
67
67
|
ParameterTypeError,
|
68
68
|
ScriptError,
|
69
|
+
TerminationSignal,
|
69
70
|
UnspecifiedFlowError,
|
70
71
|
)
|
71
72
|
from prefect.filesystems import LocalFileSystem, ReadableDeploymentStorage
|
@@ -946,10 +947,15 @@ class Flow(Generic[P, R]):
|
|
946
947
|
else:
|
947
948
|
raise
|
948
949
|
|
949
|
-
|
950
|
-
loop
|
951
|
-
|
952
|
-
|
950
|
+
try:
|
951
|
+
if loop is not None:
|
952
|
+
loop.run_until_complete(runner.start(webserver=webserver))
|
953
|
+
else:
|
954
|
+
asyncio.run(runner.start(webserver=webserver))
|
955
|
+
except (KeyboardInterrupt, TerminationSignal) as exc:
|
956
|
+
logger.info(f"Received {type(exc).__name__}, shutting down...")
|
957
|
+
if loop is not None:
|
958
|
+
loop.stop()
|
953
959
|
|
954
960
|
@classmethod
|
955
961
|
@sync_compatible
|
@@ -10,7 +10,6 @@ from typing import Any, Callable, Generic, List, Optional, Set, Union, cast
|
|
10
10
|
|
11
11
|
from typing_extensions import TypeVar
|
12
12
|
|
13
|
-
from prefect._internal.compatibility.deprecated import deprecated_async_method
|
14
13
|
from prefect.client.orchestration import get_client
|
15
14
|
from prefect.client.schemas.objects import TaskRun
|
16
15
|
from prefect.exceptions import ObjectNotFound
|
@@ -135,7 +134,6 @@ class PrefectConcurrentFuture(PrefectWrappedFuture[R, concurrent.futures.Future]
|
|
135
134
|
when the task run is submitted to a ThreadPoolExecutor.
|
136
135
|
"""
|
137
136
|
|
138
|
-
@deprecated_async_method
|
139
137
|
def wait(self, timeout: Optional[float] = None) -> None:
|
140
138
|
try:
|
141
139
|
result = self._wrapped_future.result(timeout=timeout)
|
@@ -144,7 +142,6 @@ class PrefectConcurrentFuture(PrefectWrappedFuture[R, concurrent.futures.Future]
|
|
144
142
|
if isinstance(result, State):
|
145
143
|
self._final_state = result
|
146
144
|
|
147
|
-
@deprecated_async_method
|
148
145
|
def result(
|
149
146
|
self,
|
150
147
|
timeout: Optional[float] = None,
|
@@ -198,7 +195,6 @@ class PrefectDistributedFuture(PrefectFuture[R]):
|
|
198
195
|
done_callbacks: List[Callable[[PrefectFuture], None]] = []
|
199
196
|
waiter = None
|
200
197
|
|
201
|
-
@deprecated_async_method
|
202
198
|
def wait(self, timeout: Optional[float] = None) -> None:
|
203
199
|
return run_coro_as_sync(self.wait_async(timeout=timeout))
|
204
200
|
|
@@ -235,7 +231,6 @@ class PrefectDistributedFuture(PrefectFuture[R]):
|
|
235
231
|
self._final_state = task_run.state
|
236
232
|
return
|
237
233
|
|
238
|
-
@deprecated_async_method
|
239
234
|
def result(
|
240
235
|
self,
|
241
236
|
timeout: Optional[float] = None,
|
@@ -10,5 +10,8 @@ PREFECT_SERVER_ALLOW_EPHEMERAL_MODE = "true"
|
|
10
10
|
# You will need to set these values appropriately for your local development environment
|
11
11
|
PREFECT_API_URL = "http://127.0.0.1:4200/api"
|
12
12
|
|
13
|
+
[profiles.test]
|
14
|
+
PREFECT_SERVER_ALLOW_EPHEMERAL_MODE = "true"
|
15
|
+
PREFECT_API_DATABASE_CONNECTION_URL = "sqlite+aiosqlite:///:memory:"
|
13
16
|
|
14
17
|
[profiles.cloud]
|
@@ -280,6 +280,10 @@ class GitRepository:
|
|
280
280
|
"branch": self._branch,
|
281
281
|
}
|
282
282
|
}
|
283
|
+
if self._include_submodules:
|
284
|
+
pull_step["prefect.deployments.steps.git_clone"][
|
285
|
+
"include_submodules"
|
286
|
+
] = self._include_submodules
|
283
287
|
if isinstance(self._credentials, Block):
|
284
288
|
pull_step["prefect.deployments.steps.git_clone"][
|
285
289
|
"credentials"
|
@@ -351,6 +351,7 @@ def warn_on_database_password_value_without_usage(values):
|
|
351
351
|
if (
|
352
352
|
value
|
353
353
|
and not value.startswith(OBFUSCATED_PREFIX)
|
354
|
+
and values["PREFECT_API_DATABASE_CONNECTION_URL"] is not None
|
354
355
|
and (
|
355
356
|
"PREFECT_API_DATABASE_PASSWORD"
|
356
357
|
not in values["PREFECT_API_DATABASE_CONNECTION_URL"]
|
@@ -403,7 +404,38 @@ def warn_on_misconfigured_api_url(values):
|
|
403
404
|
return values
|
404
405
|
|
405
406
|
|
406
|
-
def default_database_connection_url(settings, value):
|
407
|
+
def default_database_connection_url(settings: "Settings", value: Optional[str]):
|
408
|
+
driver = PREFECT_API_DATABASE_DRIVER.value_from(settings)
|
409
|
+
if driver == "postgresql+asyncpg":
|
410
|
+
required = [
|
411
|
+
PREFECT_API_DATABASE_HOST,
|
412
|
+
PREFECT_API_DATABASE_USER,
|
413
|
+
PREFECT_API_DATABASE_NAME,
|
414
|
+
PREFECT_API_DATABASE_PASSWORD,
|
415
|
+
]
|
416
|
+
missing = [
|
417
|
+
setting.name for setting in required if not setting.value_from(settings)
|
418
|
+
]
|
419
|
+
if missing:
|
420
|
+
raise ValueError(
|
421
|
+
f"Missing required database connection settings: {', '.join(missing)}"
|
422
|
+
)
|
423
|
+
|
424
|
+
host = PREFECT_API_DATABASE_HOST.value_from(settings)
|
425
|
+
port = PREFECT_API_DATABASE_PORT.value_from(settings) or 5432
|
426
|
+
user = PREFECT_API_DATABASE_USER.value_from(settings)
|
427
|
+
name = PREFECT_API_DATABASE_NAME.value_from(settings)
|
428
|
+
password = PREFECT_API_DATABASE_PASSWORD.value_from(settings)
|
429
|
+
|
430
|
+
return f"{driver}://{user}:{password}@{host}:{port}/{name}"
|
431
|
+
|
432
|
+
elif driver == "sqlite+aiosqlite":
|
433
|
+
path = PREFECT_API_DATABASE_NAME.value_from(settings)
|
434
|
+
if path:
|
435
|
+
return f"{driver}:///{path}"
|
436
|
+
elif driver:
|
437
|
+
raise ValueError(f"Unsupported database driver: {driver}")
|
438
|
+
|
407
439
|
templater = template_with_settings(PREFECT_HOME, PREFECT_API_DATABASE_PASSWORD)
|
408
440
|
|
409
441
|
# If the user has provided a value, use it
|
@@ -941,17 +973,6 @@ backend on application startup. If not set, block types must be manually
|
|
941
973
|
registered.
|
942
974
|
"""
|
943
975
|
|
944
|
-
PREFECT_API_DATABASE_PASSWORD = Setting(
|
945
|
-
Optional[str],
|
946
|
-
default=None,
|
947
|
-
is_secret=True,
|
948
|
-
)
|
949
|
-
"""
|
950
|
-
Password to template into the `PREFECT_API_DATABASE_CONNECTION_URL`.
|
951
|
-
This is useful if the password must be provided separately from the connection URL.
|
952
|
-
To use this setting, you must include it in your connection URL.
|
953
|
-
"""
|
954
|
-
|
955
976
|
PREFECT_API_DATABASE_CONNECTION_URL = Setting(
|
956
977
|
Optional[str],
|
957
978
|
default=None,
|
@@ -981,6 +1002,46 @@ PREFECT_API_DATABASE_CONNECTION_URL='postgresql+asyncpg://postgres:${PREFECT_API
|
|
981
1002
|
```
|
982
1003
|
"""
|
983
1004
|
|
1005
|
+
PREFECT_API_DATABASE_DRIVER = Setting(
|
1006
|
+
Optional[Literal["postgresql+asyncpg", "sqlite+aiosqlite"]],
|
1007
|
+
default=None,
|
1008
|
+
)
|
1009
|
+
"""
|
1010
|
+
The database driver to use when connecting to the database.
|
1011
|
+
"""
|
1012
|
+
|
1013
|
+
PREFECT_API_DATABASE_HOST = Setting(Optional[str], default=None)
|
1014
|
+
"""
|
1015
|
+
The database server host.
|
1016
|
+
"""
|
1017
|
+
|
1018
|
+
PREFECT_API_DATABASE_PORT = Setting(Optional[int], default=None)
|
1019
|
+
"""
|
1020
|
+
The database server port.
|
1021
|
+
"""
|
1022
|
+
|
1023
|
+
PREFECT_API_DATABASE_USER = Setting(Optional[str], default=None)
|
1024
|
+
"""
|
1025
|
+
The user to use when connecting to the database.
|
1026
|
+
"""
|
1027
|
+
|
1028
|
+
PREFECT_API_DATABASE_NAME = Setting(Optional[str], default=None)
|
1029
|
+
"""
|
1030
|
+
The name of the Prefect database on the remote server, or the path to the database file
|
1031
|
+
for SQLite.
|
1032
|
+
"""
|
1033
|
+
|
1034
|
+
PREFECT_API_DATABASE_PASSWORD = Setting(
|
1035
|
+
Optional[str],
|
1036
|
+
default=None,
|
1037
|
+
is_secret=True,
|
1038
|
+
)
|
1039
|
+
"""
|
1040
|
+
Password to template into the `PREFECT_API_DATABASE_CONNECTION_URL`.
|
1041
|
+
This is useful if the password must be provided separately from the connection URL.
|
1042
|
+
To use this setting, you must include it in your connection URL.
|
1043
|
+
"""
|
1044
|
+
|
984
1045
|
PREFECT_API_DATABASE_ECHO = Setting(
|
985
1046
|
bool,
|
986
1047
|
default=False,
|
@@ -409,6 +409,22 @@ class SyncTaskRunEngine(BaseTaskRunEngine[P, R]):
|
|
409
409
|
self.task_run.state_id = new_state.id
|
410
410
|
self.task_run.state_type = new_state.type
|
411
411
|
self.task_run.state_name = new_state.name
|
412
|
+
|
413
|
+
if new_state.is_final():
|
414
|
+
if (
|
415
|
+
isinstance(state.data, BaseResult)
|
416
|
+
and state.data.has_cached_object()
|
417
|
+
):
|
418
|
+
# Avoid fetching the result unless it is cached, otherwise we defeat
|
419
|
+
# the purpose of disabling `cache_result_in_memory`
|
420
|
+
result = state.result(raise_on_failure=False, fetch=True)
|
421
|
+
if inspect.isawaitable(result):
|
422
|
+
result = run_coro_as_sync(result)
|
423
|
+
else:
|
424
|
+
result = state.data
|
425
|
+
|
426
|
+
link_state_to_result(state, result)
|
427
|
+
|
412
428
|
else:
|
413
429
|
try:
|
414
430
|
new_state = propose_state_sync(
|
@@ -674,6 +690,12 @@ class SyncTaskRunEngine(BaseTaskRunEngine[P, R]):
|
|
674
690
|
task_run_name=task_run_name,
|
675
691
|
)
|
676
692
|
)
|
693
|
+
# Emit an event to capture that the task run was in the `PENDING` state.
|
694
|
+
self._last_event = emit_task_run_state_change_event(
|
695
|
+
task_run=self.task_run,
|
696
|
+
initial_state=None,
|
697
|
+
validated_state=self.task_run.state,
|
698
|
+
)
|
677
699
|
else:
|
678
700
|
if not self.task_run:
|
679
701
|
self.task_run = run_coro_as_sync(
|
@@ -686,12 +708,12 @@ class SyncTaskRunEngine(BaseTaskRunEngine[P, R]):
|
|
686
708
|
extra_task_inputs=dependencies,
|
687
709
|
)
|
688
710
|
)
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
711
|
+
# Emit an event to capture that the task run was in the `PENDING` state.
|
712
|
+
self._last_event = emit_task_run_state_change_event(
|
713
|
+
task_run=self.task_run,
|
714
|
+
initial_state=None,
|
715
|
+
validated_state=self.task_run.state,
|
716
|
+
)
|
695
717
|
|
696
718
|
with self.setup_run_context():
|
697
719
|
# setup_run_context might update the task run name, so log creation here
|
@@ -966,6 +988,20 @@ class AsyncTaskRunEngine(BaseTaskRunEngine[P, R]):
|
|
966
988
|
self.task_run.state_id = new_state.id
|
967
989
|
self.task_run.state_type = new_state.type
|
968
990
|
self.task_run.state_name = new_state.name
|
991
|
+
|
992
|
+
if new_state.is_final():
|
993
|
+
if (
|
994
|
+
isinstance(new_state.data, BaseResult)
|
995
|
+
and new_state.data.has_cached_object()
|
996
|
+
):
|
997
|
+
# Avoid fetching the result unless it is cached, otherwise we defeat
|
998
|
+
# the purpose of disabling `cache_result_in_memory`
|
999
|
+
result = await new_state.result(raise_on_failure=False, fetch=True)
|
1000
|
+
else:
|
1001
|
+
result = new_state.data
|
1002
|
+
|
1003
|
+
link_state_to_result(new_state, result)
|
1004
|
+
|
969
1005
|
else:
|
970
1006
|
try:
|
971
1007
|
new_state = await propose_state(
|
@@ -1222,6 +1258,12 @@ class AsyncTaskRunEngine(BaseTaskRunEngine[P, R]):
|
|
1222
1258
|
extra_task_inputs=dependencies,
|
1223
1259
|
task_run_name=task_run_name,
|
1224
1260
|
)
|
1261
|
+
# Emit an event to capture that the task run was in the `PENDING` state.
|
1262
|
+
self._last_event = emit_task_run_state_change_event(
|
1263
|
+
task_run=self.task_run,
|
1264
|
+
initial_state=None,
|
1265
|
+
validated_state=self.task_run.state,
|
1266
|
+
)
|
1225
1267
|
else:
|
1226
1268
|
if not self.task_run:
|
1227
1269
|
self.task_run = await self.task.create_run(
|
@@ -1232,12 +1274,12 @@ class AsyncTaskRunEngine(BaseTaskRunEngine[P, R]):
|
|
1232
1274
|
wait_for=self.wait_for,
|
1233
1275
|
extra_task_inputs=dependencies,
|
1234
1276
|
)
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1277
|
+
# Emit an event to capture that the task run was in the `PENDING` state.
|
1278
|
+
self._last_event = emit_task_run_state_change_event(
|
1279
|
+
task_run=self.task_run,
|
1280
|
+
initial_state=None,
|
1281
|
+
validated_state=self.task_run.state,
|
1282
|
+
)
|
1241
1283
|
|
1242
1284
|
async with self.setup_run_context():
|
1243
1285
|
# setup_run_context might update the task run name, so log creation here
|
@@ -293,12 +293,15 @@ class TaskWorker:
|
|
293
293
|
await self._client._client.delete(f"/task_runs/{task_run.id}")
|
294
294
|
return
|
295
295
|
|
296
|
+
initial_state = task_run.state
|
297
|
+
|
296
298
|
if PREFECT_EXPERIMENTAL_ENABLE_CLIENT_SIDE_TASK_ORCHESTRATION:
|
297
299
|
new_state = Pending()
|
298
300
|
new_state.state_details.deferred = True
|
299
301
|
new_state.state_details.task_run_id = task_run.id
|
300
302
|
new_state.state_details.flow_run_id = task_run.flow_run_id
|
301
303
|
state = new_state
|
304
|
+
task_run.state = state
|
302
305
|
else:
|
303
306
|
try:
|
304
307
|
new_state = Pending()
|
@@ -330,7 +333,7 @@ class TaskWorker:
|
|
330
333
|
|
331
334
|
emit_task_run_state_change_event(
|
332
335
|
task_run=task_run,
|
333
|
-
initial_state=
|
336
|
+
initial_state=initial_state,
|
334
337
|
validated_state=state,
|
335
338
|
)
|
336
339
|
|
@@ -33,9 +33,6 @@ from uuid import UUID, uuid4
|
|
33
33
|
from typing_extensions import Literal, ParamSpec
|
34
34
|
|
35
35
|
import prefect.states
|
36
|
-
from prefect._internal.compatibility.deprecated import (
|
37
|
-
deprecated_async_method,
|
38
|
-
)
|
39
36
|
from prefect.cache_policies import DEFAULT, NONE, CachePolicy
|
40
37
|
from prefect.client.orchestration import get_client
|
41
38
|
from prefect.client.schemas import TaskRun
|
@@ -1038,7 +1035,6 @@ class Task(Generic[P, R]):
|
|
1038
1035
|
) -> State[T]:
|
1039
1036
|
...
|
1040
1037
|
|
1041
|
-
@deprecated_async_method
|
1042
1038
|
def submit(
|
1043
1039
|
self,
|
1044
1040
|
*args: Any,
|
@@ -1203,7 +1199,6 @@ class Task(Generic[P, R]):
|
|
1203
1199
|
) -> PrefectFutureList[State[T]]:
|
1204
1200
|
...
|
1205
1201
|
|
1206
|
-
@deprecated_async_method
|
1207
1202
|
def map(
|
1208
1203
|
self,
|
1209
1204
|
*args: Any,
|
@@ -1455,6 +1450,15 @@ class Task(Generic[P, R]):
|
|
1455
1450
|
)
|
1456
1451
|
) # type: ignore
|
1457
1452
|
|
1453
|
+
from prefect.utilities.engine import emit_task_run_state_change_event
|
1454
|
+
|
1455
|
+
# emit a `SCHEDULED` event for the task run
|
1456
|
+
emit_task_run_state_change_event(
|
1457
|
+
task_run=task_run,
|
1458
|
+
initial_state=None,
|
1459
|
+
validated_state=task_run.state,
|
1460
|
+
)
|
1461
|
+
|
1458
1462
|
if task_run_url := url_for(task_run):
|
1459
1463
|
logger.info(
|
1460
1464
|
f"Created task run {task_run.name!r}. View it in the UI at {task_run_url!r}"
|