prefect-client 3.3.0__tar.gz → 3.3.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.
Files changed (324) hide show
  1. {prefect_client-3.3.0 → prefect_client-3.3.2}/PKG-INFO +2 -1
  2. {prefect_client-3.3.0 → prefect_client-3.3.2}/pyproject.toml +1 -0
  3. prefect_client-3.3.2/src/prefect/_build_info.py +5 -0
  4. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/compatibility/deprecated.py +30 -19
  5. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/calls.py +5 -2
  6. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/pydantic/v2_schema.py +1 -0
  7. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/schemas/bases.py +4 -2
  8. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/blocks/core.py +10 -13
  9. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/base.py +16 -2
  10. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/__init__.py +5 -0
  11. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_deployments/client.py +51 -16
  12. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/schemas/actions.py +20 -1
  13. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/schemas/objects.py +12 -1
  14. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/schemas/responses.py +26 -1
  15. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/context.py +2 -1
  16. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/filters.py +1 -1
  17. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/related.py +5 -3
  18. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/flows.py +18 -17
  19. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runner/runner.py +2 -18
  20. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/schedules.py +2 -2
  21. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/flow_runs.py +15 -14
  22. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/run_history.py +1 -1
  23. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/ui/task_runs.py +21 -1
  24. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/base.py +4 -4
  25. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/root.py +10 -5
  26. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/tasks.py +8 -9
  27. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/types/_datetime.py +2 -2
  28. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/callables.py +1 -1
  29. prefect_client-3.3.0/src/prefect/_build_info.py +0 -5
  30. {prefect_client-3.3.0 → prefect_client-3.3.2}/.gitignore +0 -0
  31. {prefect_client-3.3.0 → prefect_client-3.3.2}/LICENSE +0 -0
  32. {prefect_client-3.3.0 → prefect_client-3.3.2}/README.md +0 -0
  33. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/.prefectignore +0 -0
  34. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/__init__.py +0 -0
  35. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/__main__.py +0 -0
  36. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_experimental/__init__.py +0 -0
  37. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_experimental/bundles.py +0 -0
  38. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_experimental/lineage.py +0 -0
  39. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_experimental/sla/__init__.py +0 -0
  40. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_experimental/sla/client.py +0 -0
  41. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_experimental/sla/objects.py +0 -0
  42. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/__init__.py +0 -0
  43. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/_logging.py +0 -0
  44. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/compatibility/__init__.py +0 -0
  45. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/compatibility/async_dispatch.py +0 -0
  46. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/compatibility/migration.py +0 -0
  47. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/__init__.py +0 -0
  48. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/api.py +0 -0
  49. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  50. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  51. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/inspection.py +0 -0
  52. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/primitives.py +0 -0
  53. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/services.py +0 -0
  54. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/threads.py +0 -0
  55. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/concurrency/waiters.py +0 -0
  56. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/integrations.py +0 -0
  57. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/pydantic/__init__.py +0 -0
  58. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/pydantic/schemas.py +0 -0
  59. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
  60. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  61. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/pytz.py +0 -0
  62. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/retries.py +0 -0
  63. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/schemas/__init__.py +0 -0
  64. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/schemas/fields.py +0 -0
  65. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/schemas/serializers.py +0 -0
  66. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_internal/schemas/validators.py +0 -0
  67. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_result_records.py +0 -0
  68. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_vendor/croniter/__init__.py +0 -0
  69. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_vendor/croniter/croniter.py +0 -0
  70. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/_waiters.py +0 -0
  71. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/agent.py +0 -0
  72. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/artifacts.py +0 -0
  73. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/automations.py +0 -0
  74. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/blocks/__init__.py +0 -0
  75. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/blocks/abstract.py +0 -0
  76. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/blocks/fields.py +0 -0
  77. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/blocks/notifications.py +0 -0
  78. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/blocks/redis.py +0 -0
  79. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/blocks/system.py +0 -0
  80. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/blocks/webhook.py +0 -0
  81. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/cache_policies.py +0 -0
  82. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/__init__.py +0 -0
  83. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/cloud.py +0 -0
  84. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/collections.py +0 -0
  85. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/constants.py +0 -0
  86. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_artifacts/__init__.py +0 -0
  87. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_artifacts/client.py +0 -0
  88. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_automations/__init__.py +0 -0
  89. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_automations/client.py +0 -0
  90. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_blocks_documents/__init__.py +0 -0
  91. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_blocks_documents/client.py +0 -0
  92. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_blocks_schemas/__init__.py +0 -0
  93. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_blocks_schemas/client.py +0 -0
  94. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_blocks_types/__init__.py +0 -0
  95. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_blocks_types/client.py +0 -0
  96. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_concurrency_limits/__init__.py +0 -0
  97. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_concurrency_limits/client.py +0 -0
  98. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_deployments/__init__.py +0 -0
  99. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_flow_runs/__init__.py +0 -0
  100. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_flow_runs/client.py +0 -0
  101. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_flows/__init__.py +0 -0
  102. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_flows/client.py +0 -0
  103. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_logs/__init__.py +0 -0
  104. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_logs/client.py +0 -0
  105. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_variables/__init__.py +0 -0
  106. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_variables/client.py +0 -0
  107. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_work_pools/__init__.py +0 -0
  108. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/_work_pools/client.py +0 -0
  109. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/base.py +0 -0
  110. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/orchestration/routes.py +0 -0
  111. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/schemas/__init__.py +0 -0
  112. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/schemas/filters.py +0 -0
  113. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/schemas/schedules.py +0 -0
  114. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/schemas/sorting.py +0 -0
  115. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/subscriptions.py +0 -0
  116. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/types/__init__.py +0 -0
  117. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/types/flexible_schedule_list.py +0 -0
  118. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/client/utilities.py +0 -0
  119. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/__init__.py +0 -0
  120. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/_asyncio.py +0 -0
  121. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/_events.py +0 -0
  122. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/asyncio.py +0 -0
  123. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/context.py +0 -0
  124. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/services.py +0 -0
  125. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/sync.py +0 -0
  126. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/v1/__init__.py +0 -0
  127. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/v1/_asyncio.py +0 -0
  128. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/v1/_events.py +0 -0
  129. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/v1/asyncio.py +0 -0
  130. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/v1/context.py +0 -0
  131. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/v1/services.py +0 -0
  132. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/concurrency/v1/sync.py +0 -0
  133. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/__init__.py +0 -0
  134. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/base.py +0 -0
  135. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/deployments.py +0 -0
  136. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/flow_runs.py +0 -0
  137. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/runner.py +0 -0
  138. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/schedules.py +0 -0
  139. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/steps/__init__.py +0 -0
  140. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/steps/core.py +0 -0
  141. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/steps/pull.py +0 -0
  142. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/deployments/steps/utility.py +0 -0
  143. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/docker/__init__.py +0 -0
  144. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/docker/docker_image.py +0 -0
  145. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/engine.py +0 -0
  146. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/__init__.py +0 -0
  147. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/actions.py +0 -0
  148. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/cli/__init__.py +0 -0
  149. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/cli/automations.py +0 -0
  150. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/clients.py +0 -0
  151. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/schemas/__init__.py +0 -0
  152. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/schemas/automations.py +0 -0
  153. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/schemas/deployment_triggers.py +0 -0
  154. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/schemas/events.py +0 -0
  155. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/schemas/labelling.py +0 -0
  156. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/utilities.py +0 -0
  157. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/events/worker.py +0 -0
  158. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/exceptions.py +0 -0
  159. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/filesystems.py +0 -0
  160. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/flow_engine.py +0 -0
  161. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/flow_runs.py +0 -0
  162. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/futures.py +0 -0
  163. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/infrastructure/__init__.py +0 -0
  164. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/infrastructure/base.py +0 -0
  165. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  166. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  167. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/infrastructure/provisioners/coiled.py +0 -0
  168. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  169. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  170. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  171. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/input/__init__.py +0 -0
  172. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/input/actions.py +0 -0
  173. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/input/run_input.py +0 -0
  174. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/locking/__init__.py +0 -0
  175. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/locking/filesystem.py +0 -0
  176. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/locking/memory.py +0 -0
  177. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/locking/protocol.py +0 -0
  178. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/logging/__init__.py +0 -0
  179. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/logging/configuration.py +0 -0
  180. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/logging/filters.py +0 -0
  181. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/logging/formatters.py +0 -0
  182. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/logging/handlers.py +0 -0
  183. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/logging/highlighters.py +0 -0
  184. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/logging/loggers.py +0 -0
  185. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/logging/logging.yml +0 -0
  186. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/main.py +0 -0
  187. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/plugins.py +0 -0
  188. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/py.typed +0 -0
  189. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/results.py +0 -0
  190. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runner/__init__.py +0 -0
  191. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runner/server.py +0 -0
  192. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runner/storage.py +0 -0
  193. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runner/submit.py +0 -0
  194. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runner/utils.py +0 -0
  195. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runtime/__init__.py +0 -0
  196. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runtime/deployment.py +0 -0
  197. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runtime/flow_run.py +0 -0
  198. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/runtime/task_run.py +0 -0
  199. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/serializers.py +0 -0
  200. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/__init__.py +0 -0
  201. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/admin.py +0 -0
  202. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/artifacts.py +0 -0
  203. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/automations.py +0 -0
  204. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/block_capabilities.py +0 -0
  205. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/block_documents.py +0 -0
  206. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/block_schemas.py +0 -0
  207. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/block_types.py +0 -0
  208. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/clients.py +0 -0
  209. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/collections.py +0 -0
  210. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
  211. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/concurrency_limits.py +0 -0
  212. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/concurrency_limits_v2.py +0 -0
  213. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/csrf_token.py +0 -0
  214. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/dependencies.py +0 -0
  215. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/deployments.py +0 -0
  216. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/events.py +0 -0
  217. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/flow_run_notification_policies.py +0 -0
  218. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/flow_run_states.py +0 -0
  219. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/flows.py +0 -0
  220. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/logs.py +0 -0
  221. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/middleware.py +0 -0
  222. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/root.py +0 -0
  223. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/saved_searches.py +0 -0
  224. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/server.py +0 -0
  225. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  226. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/task_run_states.py +0 -0
  227. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/task_runs.py +0 -0
  228. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/task_workers.py +0 -0
  229. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/templates.py +0 -0
  230. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/ui/__init__.py +0 -0
  231. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/ui/flow_runs.py +0 -0
  232. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/ui/flows.py +0 -0
  233. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/ui/schemas.py +0 -0
  234. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/validation.py +0 -0
  235. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/variables.py +0 -0
  236. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/work_queues.py +0 -0
  237. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/server/api/workers.py +0 -0
  238. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/__init__.py +0 -0
  239. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/constants.py +0 -0
  240. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/context.py +0 -0
  241. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/legacy.py +0 -0
  242. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/__init__.py +0 -0
  243. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/api.py +0 -0
  244. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/cli.py +0 -0
  245. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/client.py +0 -0
  246. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/cloud.py +0 -0
  247. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/deployments.py +0 -0
  248. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/experiments.py +0 -0
  249. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/flows.py +0 -0
  250. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/internal.py +0 -0
  251. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/logging.py +0 -0
  252. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/results.py +0 -0
  253. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/runner.py +0 -0
  254. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/__init__.py +0 -0
  255. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/api.py +0 -0
  256. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/database.py +0 -0
  257. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/deployments.py +0 -0
  258. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/ephemeral.py +0 -0
  259. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/events.py +0 -0
  260. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/flow_run_graph.py +0 -0
  261. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/root.py +0 -0
  262. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/services.py +0 -0
  263. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/tasks.py +0 -0
  264. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/server/ui.py +0 -0
  265. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/tasks.py +0 -0
  266. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/testing.py +0 -0
  267. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/models/worker.py +0 -0
  268. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/profiles.py +0 -0
  269. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/profiles.toml +0 -0
  270. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/settings/sources.py +0 -0
  271. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/states.py +0 -0
  272. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/task_engine.py +0 -0
  273. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/task_runners.py +0 -0
  274. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/task_runs.py +0 -0
  275. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/task_worker.py +0 -0
  276. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/telemetry/__init__.py +0 -0
  277. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/telemetry/bootstrap.py +0 -0
  278. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/telemetry/instrumentation.py +0 -0
  279. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/telemetry/logging.py +0 -0
  280. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/telemetry/processors.py +0 -0
  281. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/telemetry/run_telemetry.py +0 -0
  282. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/telemetry/services.py +0 -0
  283. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/transactions.py +0 -0
  284. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/types/__init__.py +0 -0
  285. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/types/entrypoint.py +0 -0
  286. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/__init__.py +0 -0
  287. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/_deprecated.py +0 -0
  288. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/_engine.py +0 -0
  289. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/_git.py +0 -0
  290. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/annotations.py +0 -0
  291. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/asyncutils.py +0 -0
  292. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/collections.py +0 -0
  293. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/compat.py +0 -0
  294. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/context.py +0 -0
  295. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/dispatch.py +0 -0
  296. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/dockerutils.py +0 -0
  297. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/engine.py +0 -0
  298. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/filesystem.py +0 -0
  299. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/generics.py +0 -0
  300. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/hashing.py +0 -0
  301. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/importtools.py +0 -0
  302. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/math.py +0 -0
  303. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/names.py +0 -0
  304. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/processutils.py +0 -0
  305. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/pydantic.py +0 -0
  306. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/render_swagger.py +0 -0
  307. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/schema_tools/__init__.py +0 -0
  308. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/schema_tools/hydration.py +0 -0
  309. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/schema_tools/validation.py +0 -0
  310. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/services.py +0 -0
  311. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/slugify.py +0 -0
  312. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/templating.py +0 -0
  313. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/text.py +0 -0
  314. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/timeout.py +0 -0
  315. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/urls.py +0 -0
  316. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/utilities/visualization.py +0 -0
  317. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/variables.py +0 -0
  318. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/workers/__init__.py +0 -0
  319. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/workers/base.py +0 -0
  320. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/workers/block.py +0 -0
  321. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/workers/cloud.py +0 -0
  322. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/workers/process.py +0 -0
  323. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/workers/server.py +0 -0
  324. {prefect_client-3.3.0 → prefect_client-3.3.2}/src/prefect/workers/utilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prefect-client
3
- Version: 3.3.0
3
+ Version: 3.3.2
4
4
  Summary: Workflow orchestration and management.
5
5
  Project-URL: Changelog, https://github.com/PrefectHQ/prefect/releases
6
6
  Project-URL: Documentation, https://docs.prefect.io
@@ -26,6 +26,7 @@ Requires-Dist: asgi-lifespan<3.0,>=1.0
26
26
  Requires-Dist: cachetools<6.0,>=5.3
27
27
  Requires-Dist: cloudpickle<4.0,>=2.0
28
28
  Requires-Dist: coolname<3.0.0,>=1.0.4
29
+ Requires-Dist: dateparser<2.0.0,>=1.1.1
29
30
  Requires-Dist: exceptiongroup>=1.0.0
30
31
  Requires-Dist: fastapi<1.0.0,>=0.111.0
31
32
  Requires-Dist: fsspec>=2022.5.0
@@ -30,6 +30,7 @@ dependencies = [
30
30
  "cachetools>=5.3,<6.0",
31
31
  "cloudpickle>=2.0,<4.0",
32
32
  "coolname>=1.0.4,<3.0.0",
33
+ "dateparser>=1.1.1,<2.0.0",
33
34
  "exceptiongroup>=1.0.0",
34
35
  "fastapi>=0.111.0,<1.0.0",
35
36
  "fsspec>=2022.5.0",
@@ -0,0 +1,5 @@
1
+ # Generated by versioningit
2
+ __version__ = "3.3.2"
3
+ __build_date__ = "2025-04-03 21:24:32.871912+00:00"
4
+ __git_commit__ = "e49e31850463a0c0db93b4798856247a6d1669a6"
5
+ __dirty__ = False
@@ -10,12 +10,15 @@ will be calculated 6 months later. Start and end dates are always in the format
10
10
  e.g. Jan 2023.
11
11
  """
12
12
 
13
+ from __future__ import annotations
14
+
13
15
  import datetime
14
16
  import functools
15
17
  import sys
16
18
  import warnings
17
19
  from typing import TYPE_CHECKING, Any, Callable, Optional, Union
18
20
 
21
+ import dateparser
19
22
  from pydantic import BaseModel
20
23
  from typing_extensions import ParamSpec, TypeAlias, TypeVar
21
24
 
@@ -32,6 +35,9 @@ R = TypeVar("R", infer_variance=True)
32
35
  M = TypeVar("M", bound=BaseModel)
33
36
  T = TypeVar("T")
34
37
 
38
+ # Note: A datetime is strongly preferred over a string, but a string is acceptable for
39
+ # backwards compatibility until support is dropped from dateparser in Python 3.15.
40
+ _AcceptableDate: TypeAlias = Optional[Union[datetime.datetime, str]]
35
41
 
36
42
  DEPRECATED_WARNING = (
37
43
  "{name} has been deprecated{when}. It will not be available in new releases after {end_date}."
@@ -51,18 +57,25 @@ class PrefectDeprecationWarning(DeprecationWarning):
51
57
  """
52
58
 
53
59
 
60
+ def _coerce_datetime(
61
+ dt: Optional[_AcceptableDate],
62
+ ) -> Optional[datetime.datetime]:
63
+ if dt is None or isinstance(dt, datetime.datetime):
64
+ return dt
65
+ with warnings.catch_warnings():
66
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
67
+ return dateparser.parse(dt)
68
+
69
+
54
70
  def generate_deprecation_message(
55
71
  name: str,
56
- start_date: Optional[datetime.datetime] = None,
57
- end_date: Optional[datetime.datetime] = None,
72
+ start_date: Optional[_AcceptableDate] = None,
73
+ end_date: Optional[_AcceptableDate] = None,
58
74
  help: str = "",
59
75
  when: str = "",
60
76
  ) -> str:
61
- if start_date is not None and not isinstance(start_date, datetime.datetime):
62
- raise ValueError("Must provide start_date as a datetime")
63
-
64
- if end_date is not None and not isinstance(end_date, datetime.datetime):
65
- raise ValueError("Must provide end_date as a datetime")
77
+ start_date = _coerce_datetime(start_date)
78
+ end_date = _coerce_datetime(end_date)
66
79
 
67
80
  if start_date is None and end_date is None:
68
81
  raise ValueError(
@@ -87,8 +100,8 @@ def generate_deprecation_message(
87
100
 
88
101
  def deprecated_callable(
89
102
  *,
90
- start_date: Optional[datetime.datetime] = None,
91
- end_date: Optional[datetime.datetime] = None,
103
+ start_date: Optional[_AcceptableDate] = None,
104
+ end_date: Optional[_AcceptableDate] = None,
92
105
  stacklevel: int = 2,
93
106
  help: str = "",
94
107
  ) -> Callable[[Callable[P, R]], Callable[P, R]]:
@@ -112,8 +125,8 @@ def deprecated_callable(
112
125
 
113
126
  def deprecated_class(
114
127
  *,
115
- start_date: Optional[datetime.datetime] = None,
116
- end_date: Optional[datetime.datetime] = None,
128
+ start_date: Optional[_AcceptableDate] = None,
129
+ end_date: Optional[_AcceptableDate] = None,
117
130
  stacklevel: int = 2,
118
131
  help: str = "",
119
132
  ) -> Callable[[type[T]], type[T]]:
@@ -141,8 +154,8 @@ def deprecated_class(
141
154
  def deprecated_parameter(
142
155
  name: str,
143
156
  *,
144
- start_date: Optional[datetime.datetime] = None,
145
- end_date: Optional[datetime.datetime] = None,
157
+ start_date: Optional[_AcceptableDate] = None,
158
+ end_date: Optional[_AcceptableDate] = None,
146
159
  stacklevel: int = 2,
147
160
  help: str = "",
148
161
  when: Optional[Callable[[Any], bool]] = None,
@@ -197,8 +210,8 @@ JsonDict: TypeAlias = dict[str, JsonValue]
197
210
  def deprecated_field(
198
211
  name: str,
199
212
  *,
200
- start_date: Optional[datetime.datetime] = None,
201
- end_date: Optional[datetime.datetime] = None,
213
+ start_date: Optional[_AcceptableDate] = None,
214
+ end_date: Optional[_AcceptableDate] = None,
202
215
  when_message: str = "",
203
216
  help: str = "",
204
217
  when: Optional[Callable[[Any], bool]] = None,
@@ -242,7 +255,7 @@ def deprecated_field(
242
255
 
243
256
  cls_init(__pydantic_self__, **data)
244
257
 
245
- field = __pydantic_self__.model_fields.get(name)
258
+ field = __pydantic_self__.__class__.model_fields.get(name)
246
259
  if field is not None:
247
260
  json_schema_extra = field.json_schema_extra or {}
248
261
 
@@ -279,9 +292,7 @@ def inject_renamed_module_alias_finder():
279
292
  sys.meta_path.insert(0, AliasedModuleFinder(DEPRECATED_MODULE_ALIASES))
280
293
 
281
294
 
282
- def register_renamed_module(
283
- old_name: str, new_name: str, start_date: datetime.datetime
284
- ):
295
+ def register_renamed_module(old_name: str, new_name: str, start_date: _AcceptableDate):
285
296
  """
286
297
  Register a renamed module.
287
298
 
@@ -374,8 +374,11 @@ class Call(Generic[T]):
374
374
 
375
375
  except CancelledError:
376
376
  # Report cancellation
377
- if TYPE_CHECKING:
378
- assert cancel_scope is not None
377
+ # in rare cases, enforce_sync_deadline raises CancelledError
378
+ # prior to yielding
379
+ if cancel_scope is None:
380
+ self.future.cancel()
381
+ return None
379
382
  if cancel_scope.timedout():
380
383
  setattr(self.future, "_timed_out", True)
381
384
  self.future.cancel()
@@ -106,4 +106,5 @@ def create_v2_schema(
106
106
  # ensure backwards compatibility by copying $defs into definitions
107
107
  if "$defs" in schema:
108
108
  schema["definitions"] = schema["$defs"]
109
+
109
110
  return schema
@@ -64,7 +64,7 @@ class PrefectBaseModel(BaseModel):
64
64
 
65
65
  def __rich_repr__(self) -> RichReprResult:
66
66
  # Display all of the fields in the model if they differ from the default value
67
- for name, field in self.model_fields.items():
67
+ for name, field in type(self).model_fields.items():
68
68
  value = getattr(self, name)
69
69
 
70
70
  # Simplify the display of some common fields
@@ -90,7 +90,9 @@ class PrefectBaseModel(BaseModel):
90
90
  """
91
91
  return self.model_copy(
92
92
  update={
93
- field: self.model_fields[field].get_default(call_default_factory=True)
93
+ field: type(self)
94
+ .model_fields[field]
95
+ .get_default(call_default_factory=True)
94
96
  for field in self._reset_fields
95
97
  }
96
98
  )
@@ -18,6 +18,7 @@ from typing import (
18
18
  Optional,
19
19
  TypeVar,
20
20
  Union,
21
+ cast,
21
22
  get_origin,
22
23
  )
23
24
  from uuid import UUID, uuid4
@@ -169,14 +170,13 @@ def _collect_secret_fields(
169
170
  return
170
171
 
171
172
  if type_ in (SecretStr, SecretBytes) or (
172
- isinstance(type_, type)
173
+ isinstance(type_, type) # type: ignore[unnecessaryIsInstance]
173
174
  and getattr(type_, "__module__", None) == "pydantic.types"
174
175
  and getattr(type_, "__name__", None) == "Secret"
175
176
  ):
176
177
  secrets.append(name)
177
178
  elif type_ == SecretDict:
178
- # Append .* to field name to signify that all values under this
179
- # field are secret and should be obfuscated.
179
+ # Append .* to field name to signify that all values under a given key are secret and should be obfuscated.
180
180
  secrets.append(f"{name}.*")
181
181
  elif Block.is_block_class(type_):
182
182
  secrets.extend(
@@ -371,7 +371,7 @@ class Block(BaseModel, ABC):
371
371
  visit_fn=partial(handle_secret_render, context=ctx),
372
372
  return_data=True,
373
373
  )
374
- for field_name in self.model_fields
374
+ for field_name in type(self).model_fields
375
375
  }
376
376
  )
377
377
  if extra_fields := {
@@ -1501,14 +1501,7 @@ class Block(BaseModel, ABC):
1501
1501
  if "$defs" in schema:
1502
1502
  schema["definitions"] = schema.pop("$defs")
1503
1503
 
1504
- # we aren't expecting these additional fields in the schema
1505
- if "additionalProperties" in schema:
1506
- schema.pop("additionalProperties")
1507
-
1508
- for _, definition in schema.get("definitions", {}).items():
1509
- if "additionalProperties" in definition:
1510
- definition.pop("additionalProperties")
1511
-
1504
+ schema = remove_nested_keys(["additionalProperties"], schema)
1512
1505
  return schema
1513
1506
 
1514
1507
  @classmethod
@@ -1521,6 +1514,7 @@ class Block(BaseModel, ABC):
1521
1514
  context: dict[str, Any] | None = None,
1522
1515
  ) -> Self:
1523
1516
  if isinstance(obj, dict):
1517
+ obj = cast(dict[str, Any], obj)
1524
1518
  extra_serializer_fields = {
1525
1519
  "_block_document_id",
1526
1520
  "_block_document_name",
@@ -1530,7 +1524,10 @@ class Block(BaseModel, ABC):
1530
1524
  obj.pop(field, None)
1531
1525
 
1532
1526
  return super().model_validate(
1533
- obj, strict=strict, from_attributes=from_attributes, context=context
1527
+ obj,
1528
+ strict=strict,
1529
+ from_attributes=from_attributes,
1530
+ context=context,
1534
1531
  )
1535
1532
 
1536
1533
  def model_dump(
@@ -222,6 +222,10 @@ class PrefectHttpxAsyncClient(httpx.AsyncClient):
222
222
  if the request either raises an exception listed in `retry_exceptions` or
223
223
  receives a response with a status code listed in `retry_codes`.
224
224
 
225
+ Retries are not counted against the limit if the response headers contains
226
+ a reserved value, indicating that the server is undergoing maintenance. These
227
+ requests will retry indefinitely until the header is no longer returned.
228
+
225
229
  Retries will be delayed based on either the retry header (preferred) or
226
230
  exponential backoff if a retry header is not provided.
227
231
  """
@@ -239,18 +243,21 @@ class PrefectHttpxAsyncClient(httpx.AsyncClient):
239
243
  await self._add_csrf_headers(request=request)
240
244
 
241
245
  while try_count <= PREFECT_CLIENT_MAX_RETRIES.value():
242
- try_count += 1
243
246
  retry_seconds = None
244
247
  exc_info = None
245
248
 
246
249
  try:
247
250
  response = await send(request, *send_args, **send_kwargs)
248
251
  except retry_exceptions: # type: ignore
252
+ try_count += 1
249
253
  if try_count > PREFECT_CLIENT_MAX_RETRIES.value():
250
254
  raise
251
255
  # Otherwise, we will ignore this error but capture the info for logging
252
256
  exc_info = sys.exc_info()
253
257
  else:
258
+ if response.headers.get("Prefect-Maintenance") != "true":
259
+ try_count += 1
260
+
254
261
  # We got a response; check if it's a CSRF error, otherwise
255
262
  # return immediately if it is not retryable
256
263
  if (
@@ -441,6 +448,10 @@ class PrefectHttpxSyncClient(httpx.Client):
441
448
  if the request either raises an exception listed in `retry_exceptions` or
442
449
  receives a response with a status code listed in `retry_codes`.
443
450
 
451
+ Retries are not counted against the limit if the response headers contains
452
+ a reserved value, indicating that the server is undergoing maintenance. These
453
+ requests will retry indefinitely until the header is no longer returned.
454
+
444
455
  Retries will be delayed based on either the retry header (preferred) or
445
456
  exponential backoff if a retry header is not provided.
446
457
  """
@@ -458,18 +469,21 @@ class PrefectHttpxSyncClient(httpx.Client):
458
469
  self._add_csrf_headers(request=request)
459
470
 
460
471
  while try_count <= PREFECT_CLIENT_MAX_RETRIES.value():
461
- try_count += 1
462
472
  retry_seconds = None
463
473
  exc_info = None
464
474
 
465
475
  try:
466
476
  response = send(request, *send_args, **send_kwargs)
467
477
  except retry_exceptions: # type: ignore
478
+ try_count += 1
468
479
  if try_count > PREFECT_CLIENT_MAX_RETRIES.value():
469
480
  raise
470
481
  # Otherwise, we will ignore this error but capture the info for logging
471
482
  exc_info = sys.exc_info()
472
483
  else:
484
+ if response.headers.get("Prefect-Maintenance") != "true":
485
+ try_count += 1
486
+
473
487
  # We got a response; check if it's a CSRF error, otherwise
474
488
  # return immediately if it is not retryable
475
489
  if (
@@ -1,3 +1,4 @@
1
+ from __future__ import annotations
1
2
  import asyncio
2
3
  import base64
3
4
  import datetime
@@ -1164,6 +1165,10 @@ class PrefectClient(
1164
1165
  def client_version(self) -> str:
1165
1166
  return prefect.__version__
1166
1167
 
1168
+ @property
1169
+ def loop(self) -> asyncio.AbstractEventLoop | None:
1170
+ return self._loop
1171
+
1167
1172
  async def raise_for_api_version_mismatch(self) -> None:
1168
1173
  # Cloud is always compatible as a server
1169
1174
  if self.server_type == ServerType.CLOUD:
@@ -29,6 +29,7 @@ if TYPE_CHECKING:
29
29
  from prefect.client.schemas.objects import (
30
30
  ConcurrencyOptions,
31
31
  DeploymentSchedule,
32
+ VersionInfo,
32
33
  )
33
34
  from prefect.client.schemas.responses import (
34
35
  DeploymentResponse,
@@ -48,6 +49,7 @@ class DeploymentClient(BaseClient):
48
49
  flow_id: "UUID",
49
50
  name: str,
50
51
  version: str | None = None,
52
+ version_info: "VersionInfo | None" = None,
51
53
  schedules: list["DeploymentScheduleCreate"] | None = None,
52
54
  concurrency_limit: int | None = None,
53
55
  concurrency_options: "ConcurrencyOptions | None" = None,
@@ -65,6 +67,9 @@ class DeploymentClient(BaseClient):
65
67
  pull_steps: list[dict[str, Any]] | None = None,
66
68
  enforce_parameter_schema: bool | None = None,
67
69
  job_variables: dict[str, Any] | None = None,
70
+ branch: str | None = None,
71
+ base: UUID | None = None,
72
+ root: UUID | None = None,
68
73
  ) -> "UUID":
69
74
  """
70
75
  Create a deployment.
@@ -99,6 +104,7 @@ class DeploymentClient(BaseClient):
99
104
  flow_id=flow_id,
100
105
  name=name,
101
106
  version=version,
107
+ version_info=version_info,
102
108
  parameters=dict(parameters or {}),
103
109
  tags=list(tags or []),
104
110
  work_queue_name=work_queue_name,
@@ -115,6 +121,9 @@ class DeploymentClient(BaseClient):
115
121
  concurrency_options=concurrency_options,
116
122
  pull_steps=pull_steps,
117
123
  enforce_parameter_schema=enforce_parameter_schema,
124
+ branch=branch,
125
+ base=base,
126
+ root=root,
118
127
  )
119
128
 
120
129
  if work_pool_name is not None:
@@ -123,20 +132,29 @@ class DeploymentClient(BaseClient):
123
132
  # Exclude newer fields that are not set to avoid compatibility issues
124
133
  exclude = {
125
134
  field
126
- for field in ["work_pool_name", "work_queue_name"]
135
+ for field in [
136
+ "work_pool_name",
137
+ "work_queue_name",
138
+ ]
127
139
  if field not in deployment_create.model_fields_set
128
140
  }
129
141
 
130
- if deployment_create.paused is None:
131
- exclude.add("paused")
132
-
133
- if deployment_create.pull_steps is None:
134
- exclude.add("pull_steps")
142
+ exclude_if_none = [
143
+ "paused",
144
+ "pull_steps",
145
+ "enforce_parameter_schema",
146
+ "version_info",
147
+ "branch",
148
+ "base",
149
+ "root",
150
+ ]
135
151
 
136
- if deployment_create.enforce_parameter_schema is None:
137
- exclude.add("enforce_parameter_schema")
152
+ for field in exclude_if_none:
153
+ if getattr(deployment_create, field) is None:
154
+ exclude.add(field)
138
155
 
139
156
  json = deployment_create.model_dump(mode="json", exclude=exclude)
157
+
140
158
  response = self.request(
141
159
  "POST",
142
160
  "/deployments/",
@@ -593,6 +611,7 @@ class DeploymentAsyncClient(BaseAsyncClient):
593
611
  flow_id: "UUID",
594
612
  name: str,
595
613
  version: str | None = None,
614
+ version_info: "VersionInfo | None" = None,
596
615
  schedules: list["DeploymentScheduleCreate"] | None = None,
597
616
  concurrency_limit: int | None = None,
598
617
  concurrency_options: "ConcurrencyOptions | None" = None,
@@ -610,6 +629,9 @@ class DeploymentAsyncClient(BaseAsyncClient):
610
629
  pull_steps: list[dict[str, Any]] | None = None,
611
630
  enforce_parameter_schema: bool | None = None,
612
631
  job_variables: dict[str, Any] | None = None,
632
+ branch: str | None = None,
633
+ base: UUID | None = None,
634
+ root: UUID | None = None,
613
635
  ) -> "UUID":
614
636
  """
615
637
  Create a deployment.
@@ -644,6 +666,7 @@ class DeploymentAsyncClient(BaseAsyncClient):
644
666
  flow_id=flow_id,
645
667
  name=name,
646
668
  version=version,
669
+ version_info=version_info,
647
670
  parameters=dict(parameters or {}),
648
671
  tags=list(tags or []),
649
672
  work_queue_name=work_queue_name,
@@ -660,6 +683,9 @@ class DeploymentAsyncClient(BaseAsyncClient):
660
683
  concurrency_options=concurrency_options,
661
684
  pull_steps=pull_steps,
662
685
  enforce_parameter_schema=enforce_parameter_schema,
686
+ branch=branch,
687
+ base=base,
688
+ root=root,
663
689
  )
664
690
 
665
691
  if work_pool_name is not None:
@@ -668,20 +694,29 @@ class DeploymentAsyncClient(BaseAsyncClient):
668
694
  # Exclude newer fields that are not set to avoid compatibility issues
669
695
  exclude = {
670
696
  field
671
- for field in ["work_pool_name", "work_queue_name"]
697
+ for field in [
698
+ "work_pool_name",
699
+ "work_queue_name",
700
+ ]
672
701
  if field not in deployment_create.model_fields_set
673
702
  }
674
703
 
675
- if deployment_create.paused is None:
676
- exclude.add("paused")
677
-
678
- if deployment_create.pull_steps is None:
679
- exclude.add("pull_steps")
704
+ exclude_if_none = [
705
+ "paused",
706
+ "pull_steps",
707
+ "enforce_parameter_schema",
708
+ "version_info",
709
+ "branch",
710
+ "base",
711
+ "root",
712
+ ]
680
713
 
681
- if deployment_create.enforce_parameter_schema is None:
682
- exclude.add("enforce_parameter_schema")
714
+ for field in exclude_if_none:
715
+ if getattr(deployment_create, field) is None:
716
+ exclude.add(field)
683
717
 
684
718
  json = deployment_create.model_dump(mode="json", exclude=exclude)
719
+
685
720
  response = await self.request(
686
721
  "POST",
687
722
  "/deployments/",
@@ -253,13 +253,29 @@ class DeploymentCreate(ActionBaseModel):
253
253
  infrastructure_document_id: Optional[UUID] = Field(default=None)
254
254
  description: Optional[str] = Field(default=None)
255
255
  path: Optional[str] = Field(default=None)
256
- version: Optional[str] = Field(default=None)
257
256
  entrypoint: Optional[str] = Field(default=None)
258
257
  job_variables: dict[str, Any] = Field(
259
258
  default_factory=dict,
260
259
  description="Overrides to apply to flow run infrastructure at runtime.",
261
260
  )
262
261
 
262
+ # Versionining
263
+ version: Optional[str] = Field(default=None)
264
+ version_info: Optional[objects.VersionInfo] = Field(
265
+ default=None, description="Version information for the deployment."
266
+ )
267
+
268
+ # Branching
269
+ branch: Optional[str] = Field(
270
+ default=None, description="The branch of the deployment."
271
+ )
272
+ base: Optional[UUID] = Field(
273
+ default=None, description="The base deployment of the deployment."
274
+ )
275
+ root: Optional[UUID] = Field(
276
+ default=None, description="The root deployment of the deployment."
277
+ )
278
+
263
279
  def check_valid_configuration(self, base_job_template: dict[str, Any]) -> None:
264
280
  """Check that the combination of base_job_template defaults
265
281
  and job_variables conforms to the specified schema.
@@ -289,6 +305,9 @@ class DeploymentUpdate(ActionBaseModel):
289
305
  return remove_old_deployment_fields(values)
290
306
 
291
307
  version: Optional[str] = Field(default=None)
308
+ version_info: Optional[objects.VersionInfo] = Field(
309
+ default=None, description="Version information for the deployment."
310
+ )
292
311
  description: Optional[str] = Field(default=None)
293
312
  parameters: Optional[dict[str, Any]] = Field(
294
313
  default=None,
@@ -414,7 +414,7 @@ class State(ObjectBaseModel, Generic[R]):
414
414
  database again. The 'timestamp' is reset using the default factory.
415
415
  """
416
416
  update = {
417
- "timestamp": self.model_fields["timestamp"].get_default(),
417
+ "timestamp": type(self).model_fields["timestamp"].get_default(),
418
418
  **(update or {}),
419
419
  }
420
420
  return super().model_copy(update=update, deep=deep)
@@ -1102,6 +1102,11 @@ class DeploymentSchedule(ObjectBaseModel):
1102
1102
  )
1103
1103
 
1104
1104
 
1105
+ class VersionInfo(PrefectBaseModel, extra="allow"):
1106
+ type: str = Field(default=..., description="The type of version info.")
1107
+ version: str = Field(default=..., description="The version of the deployment.")
1108
+
1109
+
1105
1110
  class Deployment(ObjectBaseModel):
1106
1111
  """An ORM representation of deployment data."""
1107
1112
 
@@ -1109,6 +1114,12 @@ class Deployment(ObjectBaseModel):
1109
1114
  version: Optional[str] = Field(
1110
1115
  default=None, description="An optional version for the deployment."
1111
1116
  )
1117
+ version_id: Optional[UUID] = Field(
1118
+ default=None, description="The ID of the current version of the deployment."
1119
+ )
1120
+ version_info: Optional[VersionInfo] = Field(
1121
+ default=None, description="A description of this version of the deployment."
1122
+ )
1112
1123
  description: Optional[str] = Field(
1113
1124
  default=None, description="A description for the deployment."
1114
1125
  )
@@ -1,5 +1,5 @@
1
1
  import datetime
2
- from typing import Any, ClassVar, Generic, Optional, TypeVar, Union
2
+ from typing import TYPE_CHECKING, Any, ClassVar, Generic, Optional, TypeVar, Union
3
3
  from uuid import UUID
4
4
 
5
5
  from pydantic import ConfigDict, Field
@@ -12,6 +12,9 @@ from prefect.types import DateTime, KeyValueLabelsField
12
12
  from prefect.utilities.collections import AutoEnum
13
13
  from prefect.utilities.names import generate_slug
14
14
 
15
+ if TYPE_CHECKING:
16
+ from prefect.events.schemas.events import RelatedResource
17
+
15
18
  T = TypeVar("T")
16
19
 
17
20
 
@@ -308,6 +311,12 @@ class DeploymentResponse(ObjectBaseModel):
308
311
  version: Optional[str] = Field(
309
312
  default=None, description="An optional version for the deployment."
310
313
  )
314
+ version_id: Optional[UUID] = Field(
315
+ default=None, description="The ID of the current version of the deployment."
316
+ )
317
+ version_info: Optional[objects.VersionInfo] = Field(
318
+ default=None, description="A description of this version of the deployment."
319
+ )
311
320
  description: Optional[str] = Field(
312
321
  default=None, description="A description for the deployment."
313
322
  )
@@ -420,6 +429,22 @@ class DeploymentResponse(ObjectBaseModel):
420
429
  description="Current status of the deployment.",
421
430
  )
422
431
 
432
+ def as_related_resource(self, role: str = "deployment") -> "RelatedResource":
433
+ from prefect.events.schemas.events import RelatedResource
434
+
435
+ labels = {
436
+ "prefect.resource.id": f"prefect.deployment.{self.id}",
437
+ "prefect.resource.role": role,
438
+ "prefect.resource.name": self.name,
439
+ }
440
+
441
+ if self.version_id and self.version_info:
442
+ labels["prefect.deployment.version-id"] = str(self.version_id)
443
+ labels["prefect.deployment.version-type"] = self.version_info.type
444
+ labels["prefect.deployment.version"] = self.version_info.version
445
+
446
+ return RelatedResource(labels)
447
+
423
448
 
424
449
  class MinimalConcurrencyLimitResponse(PrefectBaseModel):
425
450
  model_config: ClassVar[ConfigDict] = ConfigDict(extra="ignore")
@@ -6,6 +6,7 @@ These contexts should never be directly mutated by the user.
6
6
  For more user-accessible information about the current run, see [`prefect.runtime`](../runtime/flow_run).
7
7
  """
8
8
 
9
+ import asyncio
9
10
  import os
10
11
  import sys
11
12
  import warnings
@@ -294,7 +295,7 @@ class AsyncClientContext(ContextModel):
294
295
  @asynccontextmanager
295
296
  async def get_or_create(cls) -> AsyncGenerator[Self, None]:
296
297
  ctx = cls.get()
297
- if ctx:
298
+ if ctx and asyncio.get_running_loop() is ctx.client.loop:
298
299
  yield ctx
299
300
  else:
300
301
  async with cls() as ctx:
@@ -45,7 +45,7 @@ class EventDataFilter(PrefectBaseModel, extra="forbid"): # type: ignore[call-ar
45
45
  def get_filters(self) -> list["EventDataFilter"]:
46
46
  filters: list["EventDataFilter"] = [
47
47
  filter
48
- for filter in [getattr(self, name) for name in self.model_fields]
48
+ for filter in [getattr(self, name) for name in type(self).model_fields]
49
49
  if isinstance(filter, EventDataFilter)
50
50
  ]
51
51
  return filters