prefect-client 3.0.10__tar.gz → 3.1.0__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 (249) hide show
  1. {prefect-client-3.0.10 → prefect-client-3.1.0}/MANIFEST.in +1 -1
  2. {prefect-client-3.0.10/src/prefect_client.egg-info → prefect-client-3.1.0}/PKG-INFO +1 -1
  3. {prefect-client-3.0.10 → prefect-client-3.1.0}/requirements-client.txt +2 -2
  4. {prefect-client-3.0.10 → prefect-client-3.1.0}/requirements-dev.txt +0 -1
  5. {prefect-client-3.0.10 → prefect-client-3.1.0}/requirements.txt +1 -0
  6. {prefect-client-3.0.10 → prefect-client-3.1.0}/setup.cfg +3 -3
  7. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/__init__.py +17 -14
  8. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/schemas/bases.py +1 -0
  9. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/schemas/validators.py +5 -3
  10. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_version.py +3 -3
  11. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/cache_policies.py +4 -4
  12. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/cloud.py +2 -2
  13. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/orchestration.py +29 -7
  14. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/schemas/actions.py +11 -18
  15. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/schemas/filters.py +14 -0
  16. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/schemas/objects.py +17 -27
  17. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/context.py +9 -4
  18. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/base.py +0 -2
  19. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/runner.py +15 -6
  20. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/schedules.py +0 -4
  21. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/schemas/automations.py +3 -3
  22. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/schemas/deployment_triggers.py +10 -5
  23. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/flow_engine.py +4 -4
  24. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/flows.py +24 -9
  25. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/futures.py +4 -4
  26. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/logging/handlers.py +1 -1
  27. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/logging/highlighters.py +2 -0
  28. prefect-client-3.1.0/src/prefect/logging/logging.yml +118 -0
  29. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/results.py +27 -17
  30. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runner/runner.py +1 -2
  31. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runner/server.py +12 -1
  32. prefect-client-3.1.0/src/prefect/settings/__init__.py +59 -0
  33. prefect-client-3.1.0/src/prefect/settings/base.py +193 -0
  34. prefect-client-3.1.0/src/prefect/settings/constants.py +8 -0
  35. prefect-client-3.1.0/src/prefect/settings/context.py +65 -0
  36. prefect-client-3.1.0/src/prefect/settings/legacy.py +167 -0
  37. prefect-client-3.1.0/src/prefect/settings/models/api.py +41 -0
  38. prefect-client-3.1.0/src/prefect/settings/models/cli.py +31 -0
  39. prefect-client-3.1.0/src/prefect/settings/models/client.py +88 -0
  40. prefect-client-3.1.0/src/prefect/settings/models/cloud.py +58 -0
  41. prefect-client-3.1.0/src/prefect/settings/models/deployments.py +37 -0
  42. prefect-client-3.1.0/src/prefect/settings/models/experiments.py +24 -0
  43. prefect-client-3.1.0/src/prefect/settings/models/flows.py +34 -0
  44. prefect-client-3.1.0/src/prefect/settings/models/internal.py +18 -0
  45. prefect-client-3.1.0/src/prefect/settings/models/logging.py +132 -0
  46. prefect-client-3.1.0/src/prefect/settings/models/results.py +44 -0
  47. prefect-client-3.1.0/src/prefect/settings/models/root.py +447 -0
  48. prefect-client-3.1.0/src/prefect/settings/models/runner.py +60 -0
  49. prefect-client-3.1.0/src/prefect/settings/models/server/__init__.py +1 -0
  50. prefect-client-3.1.0/src/prefect/settings/models/server/api.py +130 -0
  51. prefect-client-3.1.0/src/prefect/settings/models/server/database.py +197 -0
  52. prefect-client-3.1.0/src/prefect/settings/models/server/deployments.py +21 -0
  53. prefect-client-3.1.0/src/prefect/settings/models/server/ephemeral.py +31 -0
  54. prefect-client-3.1.0/src/prefect/settings/models/server/events.py +137 -0
  55. prefect-client-3.1.0/src/prefect/settings/models/server/flow_run_graph.py +31 -0
  56. prefect-client-3.1.0/src/prefect/settings/models/server/root.py +140 -0
  57. prefect-client-3.1.0/src/prefect/settings/models/server/services.py +454 -0
  58. prefect-client-3.1.0/src/prefect/settings/models/server/tasks.py +77 -0
  59. prefect-client-3.1.0/src/prefect/settings/models/server/ui.py +49 -0
  60. prefect-client-3.1.0/src/prefect/settings/models/tasks.py +90 -0
  61. prefect-client-3.1.0/src/prefect/settings/models/testing.py +49 -0
  62. prefect-client-3.1.0/src/prefect/settings/models/worker.py +41 -0
  63. prefect-client-3.1.0/src/prefect/settings/profiles.py +390 -0
  64. prefect-client-3.1.0/src/prefect/settings/sources.py +235 -0
  65. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/states.py +22 -21
  66. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/task_engine.py +54 -40
  67. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/task_runners.py +6 -1
  68. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/tasks.py +63 -28
  69. prefect-client-3.1.0/src/prefect/utilities/__init__.py +0 -0
  70. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/asyncutils.py +1 -1
  71. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/engine.py +11 -3
  72. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/hashing.py +7 -3
  73. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/services.py +3 -3
  74. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/workers/base.py +44 -7
  75. {prefect-client-3.0.10 → prefect-client-3.1.0/src/prefect_client.egg-info}/PKG-INFO +1 -1
  76. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect_client.egg-info/SOURCES.txt +35 -2
  77. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect_client.egg-info/requires.txt +2 -2
  78. prefect-client-3.0.10/src/prefect/logging/logging.yml +0 -115
  79. prefect-client-3.0.10/src/prefect/settings.py +0 -2172
  80. {prefect-client-3.0.10 → prefect-client-3.1.0}/LICENSE +0 -0
  81. {prefect-client-3.0.10 → prefect-client-3.1.0}/README.md +0 -0
  82. {prefect-client-3.0.10 → prefect-client-3.1.0}/setup.py +0 -0
  83. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/.prefectignore +0 -0
  84. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/__init__.py +0 -0
  85. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/_logging.py +0 -0
  86. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/compatibility/__init__.py +0 -0
  87. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/compatibility/deprecated.py +0 -0
  88. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/compatibility/migration.py +0 -0
  89. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/__init__.py +0 -0
  90. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/api.py +0 -0
  91. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/calls.py +0 -0
  92. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  93. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  94. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/inspection.py +0 -0
  95. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/primitives.py +0 -0
  96. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/services.py +0 -0
  97. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/threads.py +0 -0
  98. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/concurrency/waiters.py +0 -0
  99. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/integrations.py +0 -0
  100. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/pydantic/__init__.py +0 -0
  101. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  102. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
  103. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/pydantic/schemas.py +0 -0
  104. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
  105. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
  106. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  107. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/pytz.py +0 -0
  108. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/retries.py +0 -0
  109. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/schemas/__init__.py +0 -0
  110. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/schemas/fields.py +0 -0
  111. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/_internal/schemas/serializers.py +0 -0
  112. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/agent.py +0 -0
  113. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/artifacts.py +0 -0
  114. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/automations.py +0 -0
  115. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/blocks/__init__.py +0 -0
  116. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/blocks/abstract.py +0 -0
  117. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/blocks/core.py +0 -0
  118. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/blocks/fields.py +0 -0
  119. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/blocks/notifications.py +0 -0
  120. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/blocks/redis.py +0 -0
  121. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/blocks/system.py +0 -0
  122. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/blocks/webhook.py +0 -0
  123. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/__init__.py +0 -0
  124. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/base.py +0 -0
  125. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/collections.py +0 -0
  126. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/constants.py +0 -0
  127. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/schemas/__init__.py +0 -0
  128. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/schemas/responses.py +0 -0
  129. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/schemas/schedules.py +0 -0
  130. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/schemas/sorting.py +0 -0
  131. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/subscriptions.py +0 -0
  132. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/types/__init__.py +0 -0
  133. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/types/flexible_schedule_list.py +0 -0
  134. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/client/utilities.py +0 -0
  135. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/__init__.py +0 -0
  136. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/asyncio.py +0 -0
  137. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/context.py +0 -0
  138. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/events.py +0 -0
  139. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/services.py +0 -0
  140. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/sync.py +0 -0
  141. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/v1/__init__.py +0 -0
  142. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/v1/asyncio.py +0 -0
  143. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/v1/context.py +0 -0
  144. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/v1/events.py +0 -0
  145. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/v1/services.py +0 -0
  146. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/concurrency/v1/sync.py +0 -0
  147. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/__init__.py +0 -0
  148. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/deployments.py +0 -0
  149. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/flow_runs.py +0 -0
  150. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/steps/__init__.py +0 -0
  151. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/steps/core.py +0 -0
  152. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/steps/pull.py +0 -0
  153. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/deployments/steps/utility.py +0 -0
  154. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/docker/__init__.py +0 -0
  155. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/docker/docker_image.py +0 -0
  156. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/engine.py +0 -0
  157. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/__init__.py +0 -0
  158. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/actions.py +0 -0
  159. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/cli/__init__.py +0 -0
  160. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/cli/automations.py +0 -0
  161. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/clients.py +0 -0
  162. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/filters.py +0 -0
  163. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/related.py +0 -0
  164. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/schemas/__init__.py +0 -0
  165. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/schemas/events.py +0 -0
  166. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/schemas/labelling.py +0 -0
  167. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/utilities.py +0 -0
  168. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/events/worker.py +0 -0
  169. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/exceptions.py +0 -0
  170. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/filesystems.py +0 -0
  171. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/flow_runs.py +0 -0
  172. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/infrastructure/__init__.py +0 -0
  173. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/infrastructure/base.py +0 -0
  174. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  175. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  176. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  177. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  178. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  179. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/input/__init__.py +0 -0
  180. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/input/actions.py +0 -0
  181. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/input/run_input.py +0 -0
  182. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/locking/__init__.py +0 -0
  183. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/locking/filesystem.py +0 -0
  184. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/locking/memory.py +0 -0
  185. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/locking/protocol.py +0 -0
  186. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/logging/__init__.py +0 -0
  187. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/logging/configuration.py +0 -0
  188. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/logging/filters.py +0 -0
  189. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/logging/formatters.py +0 -0
  190. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/logging/loggers.py +0 -0
  191. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/main.py +0 -0
  192. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/plugins.py +0 -0
  193. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/py.typed +0 -0
  194. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/records/__init__.py +0 -0
  195. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/records/base.py +0 -0
  196. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/records/filesystem.py +0 -0
  197. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/records/memory.py +0 -0
  198. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/records/result_store.py +0 -0
  199. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runner/__init__.py +0 -0
  200. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runner/storage.py +0 -0
  201. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runner/submit.py +0 -0
  202. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runner/utils.py +0 -0
  203. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runtime/__init__.py +0 -0
  204. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runtime/deployment.py +0 -0
  205. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runtime/flow_run.py +0 -0
  206. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/runtime/task_run.py +0 -0
  207. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/serializers.py +0 -0
  208. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
  209. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  210. {prefect-client-3.0.10/src/prefect/utilities → prefect-client-3.1.0/src/prefect/settings/models}/__init__.py +0 -0
  211. {prefect-client-3.0.10/src/prefect → prefect-client-3.1.0/src/prefect/settings}/profiles.toml +0 -0
  212. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/task_runs.py +0 -0
  213. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/task_worker.py +0 -0
  214. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/transactions.py +0 -0
  215. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/types/__init__.py +0 -0
  216. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/types/entrypoint.py +0 -0
  217. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/annotations.py +0 -0
  218. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/callables.py +0 -0
  219. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/collections.py +0 -0
  220. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/compat.py +0 -0
  221. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/context.py +0 -0
  222. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/dispatch.py +0 -0
  223. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/dockerutils.py +0 -0
  224. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/filesystem.py +0 -0
  225. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/importtools.py +0 -0
  226. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/math.py +0 -0
  227. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/names.py +0 -0
  228. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/processutils.py +0 -0
  229. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/pydantic.py +0 -0
  230. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/render_swagger.py +0 -0
  231. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/schema_tools/__init__.py +0 -0
  232. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/schema_tools/hydration.py +0 -0
  233. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/schema_tools/validation.py +0 -0
  234. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/slugify.py +0 -0
  235. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/templating.py +0 -0
  236. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/text.py +0 -0
  237. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/timeout.py +0 -0
  238. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/urls.py +0 -0
  239. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/utilities/visualization.py +0 -0
  240. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/variables.py +0 -0
  241. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/workers/__init__.py +0 -0
  242. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/workers/block.py +0 -0
  243. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/workers/cloud.py +0 -0
  244. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/workers/process.py +0 -0
  245. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/workers/server.py +0 -0
  246. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect/workers/utilities.py +0 -0
  247. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  248. {prefect-client-3.0.10 → prefect-client-3.1.0}/src/prefect_client.egg-info/top_level.txt +0 -0
  249. {prefect-client-3.0.10 → prefect-client-3.1.0}/versioneer.py +0 -0
@@ -14,7 +14,7 @@ include requirements-dev.txt
14
14
  include requirements-client.txt
15
15
  include src/prefect/_version.py
16
16
  include src/prefect/py.typed
17
- include src/prefect/profiles.toml
17
+ include src/prefect/settings/profiles.toml
18
18
  include src/prefect/deployments/recipes/*/*.yaml
19
19
  include src/prefect/deployments/templates/*.yaml
20
20
  include src/prefect/.prefectignore
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-client
3
- Version: 3.0.10
3
+ Version: 3.1.0
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -3,7 +3,7 @@ asgi-lifespan >= 1.0, < 3.0
3
3
  cachetools >= 5.3, < 6.0
4
4
  cloudpickle >= 2.0, < 4.0
5
5
  coolname >= 1.0.4, < 3.0.0
6
- croniter >= 1.0.12, < 4.0.0
6
+ croniter >= 1.0.12, < 5.0.0
7
7
  exceptiongroup >= 1.0.0
8
8
  fastapi >= 0.111.0, < 1.0.0
9
9
  fsspec >= 2022.5.0
@@ -22,7 +22,7 @@ prometheus-client >= 0.20.0
22
22
  pydantic >= 2.7, < 3.0.0
23
23
  pydantic_core >= 2.12.0, < 3.0.0
24
24
  pydantic_extra_types >= 2.8.2, < 3.0.0
25
- pydantic_settings
25
+ pydantic_settings > 2.2.1
26
26
  python_dateutil >= 2.8.2, < 3.0.0
27
27
  python-slugify >= 5.0, < 9.0
28
28
  pyyaml >= 5.4.1, < 7.0.0
@@ -12,7 +12,6 @@ pluggy >= 1.4.0
12
12
  pytest >= 8.3
13
13
  pytest-asyncio >= 0.24
14
14
  pytest-benchmark
15
- pytest-codspeed
16
15
  pytest-cov
17
16
  pytest-env
18
17
  pytest-flakefinder
@@ -12,6 +12,7 @@ graphviz >= 0.20.1
12
12
  jinja2 >= 3.0.0, < 4.0.0
13
13
  jinja2-humanize-extension >= 0.4.0
14
14
  humanize >= 4.9.0, < 5.0.0
15
+ opentelemetry-api >= 1.27.0, < 2.0.0
15
16
  pytz >= 2021.1, < 2025
16
17
  readchar >= 4.0.0, < 5.0.0
17
18
  sqlalchemy[asyncio] >= 2.0, < 3.0.0
@@ -13,9 +13,9 @@ markers =
13
13
  enable_api_log_handler: by default, sending logs to the API is disabled. Tests marked with this use the handler.
14
14
  clear_db: marker to clear the database after test completion
15
15
  env =
16
- PREFECT_TEST_MODE = 1
17
- PREFECT_UNIT_TEST_MODE = 1
18
- PREFECT_LOGGING_SERVER_LEVEL = DEBUG
16
+ PREFECT_TESTING_TEST_MODE = 1
17
+ PREFECT_TESTING_UNIT_TEST_MODE = 1
18
+ PREFECT_SERVER_LOGGING_LEVEL = DEBUG
19
19
  asyncio_mode = auto
20
20
  asyncio_default_fixture_loop_scope = session
21
21
  timeout = 90
@@ -102,17 +102,20 @@ __all__ = [
102
102
  def __getattr__(attr_name: str) -> object:
103
103
  if attr_name in _slots:
104
104
  return _slots[attr_name]
105
-
106
- dynamic_attr = _public_api.get(attr_name)
107
- if dynamic_attr is None:
108
- return importlib.import_module(f".{attr_name}", package=__name__)
109
-
110
- package, module_name = dynamic_attr
111
-
112
- from importlib import import_module
113
-
114
- if module_name == "__module__":
115
- return import_module(f".{attr_name}", package=package)
116
- else:
117
- module = import_module(module_name, package=package)
118
- return getattr(module, attr_name)
105
+ try:
106
+ dynamic_attr = _public_api.get(attr_name)
107
+ if dynamic_attr is None:
108
+ return importlib.import_module(f".{attr_name}", package=__name__)
109
+
110
+ package, module_name = dynamic_attr
111
+
112
+ from importlib import import_module
113
+
114
+ if module_name == "__module__":
115
+ return import_module(f".{attr_name}", package=package)
116
+ else:
117
+ module = import_module(module_name, package=package)
118
+ return getattr(module, attr_name)
119
+ except ModuleNotFoundError as ex:
120
+ module, _, attribute = ex.name.rpartition(".")
121
+ raise AttributeError(f"module {module} has no attribute {attribute}") from ex
@@ -39,6 +39,7 @@ class PrefectBaseModel(BaseModel):
39
39
  extra=(
40
40
  "ignore"
41
41
  if os.getenv("PREFECT_TEST_MODE", "0").lower() not in ["true", "1"]
42
+ and os.getenv("PREFECT_TESTING_TEST_MODE", "0").lower() not in ["true", "1"]
42
43
  else "forbid"
43
44
  ),
44
45
  )
@@ -721,7 +721,8 @@ def base_image_xor_dockerfile(values: Mapping[str, Any]):
721
721
 
722
722
 
723
723
  def validate_settings(value: dict) -> dict:
724
- from prefect.settings import SETTING_VARIABLES, Setting
724
+ from prefect.settings import Setting, Settings
725
+ from prefect.settings.legacy import _get_settings_fields
725
726
 
726
727
  if value is None:
727
728
  return value
@@ -729,8 +730,9 @@ def validate_settings(value: dict) -> dict:
729
730
  # Cast string setting names to variables
730
731
  validated = {}
731
732
  for setting, val in value.items():
732
- if isinstance(setting, str) and setting in SETTING_VARIABLES:
733
- validated[SETTING_VARIABLES[setting]] = val
733
+ settings_fields = _get_settings_fields(Settings)
734
+ if isinstance(setting, str) and setting in settings_fields:
735
+ validated[settings_fields[setting]] = val
734
736
  elif isinstance(setting, Setting):
735
737
  validated[setting] = val
736
738
  else:
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-10-15T13:31:59-0500",
11
+ "date": "2024-10-31T12:43:46-0700",
12
12
  "dirty": true,
13
13
  "error": null,
14
- "full-revisionid": "3aa2d89362c2fe8ee429f0c2cf7e623e34588029",
15
- "version": "3.0.10"
14
+ "full-revisionid": "a83ba39b095e5945140ab6313e39dbc56056afe1",
15
+ "version": "3.1.0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -175,7 +175,7 @@ class CompoundCachePolicy(CachePolicy):
175
175
  keys.append(policy_key)
176
176
  if not keys:
177
177
  return None
178
- return hash_objects(*keys)
178
+ return hash_objects(*keys, raise_on_failure=True)
179
179
 
180
180
 
181
181
  @dataclass
@@ -224,7 +224,7 @@ class TaskSource(CachePolicy):
224
224
  else:
225
225
  raise
226
226
 
227
- return hash_objects(lines)
227
+ return hash_objects(lines, raise_on_failure=True)
228
228
 
229
229
 
230
230
  @dataclass
@@ -242,7 +242,7 @@ class FlowParameters(CachePolicy):
242
242
  ) -> Optional[str]:
243
243
  if not flow_parameters:
244
244
  return None
245
- return hash_objects(flow_parameters)
245
+ return hash_objects(flow_parameters, raise_on_failure=True)
246
246
 
247
247
 
248
248
  @dataclass
@@ -293,7 +293,7 @@ class Inputs(CachePolicy):
293
293
  if key not in exclude:
294
294
  hashed_inputs[key] = val
295
295
 
296
- return hash_objects(hashed_inputs)
296
+ return hash_objects(hashed_inputs, raise_on_failure=True)
297
297
 
298
298
  def __sub__(self, other: str) -> "CachePolicy":
299
299
  if not isinstance(other, str):
@@ -19,7 +19,7 @@ from prefect.settings import (
19
19
  PREFECT_API_KEY,
20
20
  PREFECT_API_URL,
21
21
  PREFECT_CLOUD_API_URL,
22
- PREFECT_UNIT_TEST_MODE,
22
+ PREFECT_TESTING_UNIT_TEST_MODE,
23
23
  )
24
24
 
25
25
  PARSE_API_URL_REGEX = re.compile(r"accounts/(.{36})/workspaces/(.{36})")
@@ -68,7 +68,7 @@ class CloudClient:
68
68
  httpx_settings["headers"].setdefault("Authorization", f"Bearer {api_key}")
69
69
 
70
70
  httpx_settings.setdefault("base_url", host)
71
- if not PREFECT_UNIT_TEST_MODE.value():
71
+ if not PREFECT_TESTING_UNIT_TEST_MODE.value():
72
72
  httpx_settings.setdefault("follow_redirects", True)
73
73
  self._client = PrefectHttpxAsyncClient(
74
74
  **httpx_settings, enable_csrf_support=False
@@ -133,7 +133,8 @@ from prefect.settings import (
133
133
  PREFECT_CLIENT_CSRF_SUPPORT_ENABLED,
134
134
  PREFECT_CLOUD_API_URL,
135
135
  PREFECT_SERVER_ALLOW_EPHEMERAL_MODE,
136
- PREFECT_UNIT_TEST_MODE,
136
+ PREFECT_TESTING_UNIT_TEST_MODE,
137
+ get_current_settings,
137
138
  )
138
139
 
139
140
  if TYPE_CHECKING:
@@ -385,7 +386,7 @@ class PrefectClient:
385
386
  ),
386
387
  )
387
388
 
388
- if not PREFECT_UNIT_TEST_MODE:
389
+ if not PREFECT_TESTING_UNIT_TEST_MODE:
389
390
  httpx_settings.setdefault("follow_redirects", True)
390
391
 
391
392
  enable_csrf_support = (
@@ -2594,22 +2595,43 @@ class PrefectClient:
2594
2595
  work_pool_name: str,
2595
2596
  worker_name: str,
2596
2597
  heartbeat_interval_seconds: Optional[float] = None,
2597
- ):
2598
+ get_worker_id: bool = False,
2599
+ ) -> Optional[UUID]:
2598
2600
  """
2599
2601
  Sends a worker heartbeat for a given work pool.
2600
2602
 
2601
2603
  Args:
2602
2604
  work_pool_name: The name of the work pool to heartbeat against.
2603
2605
  worker_name: The name of the worker sending the heartbeat.
2606
+ return_id: Whether to return the worker ID. Note: will return `None` if the connected server does not support returning worker IDs, even if `return_id` is `True`.
2604
2607
  """
2605
- await self._client.post(
2608
+
2609
+ if get_worker_id:
2610
+ return_dict = {"return_id": get_worker_id}
2611
+ else:
2612
+ return_dict = {}
2613
+
2614
+ resp = await self._client.post(
2606
2615
  f"/work_pools/{work_pool_name}/workers/heartbeat",
2607
2616
  json={
2608
2617
  "name": worker_name,
2609
2618
  "heartbeat_interval_seconds": heartbeat_interval_seconds,
2610
- },
2619
+ }
2620
+ | return_dict,
2611
2621
  )
2612
2622
 
2623
+ if (
2624
+ (
2625
+ self.server_type == ServerType.CLOUD
2626
+ or get_current_settings().testing.test_mode
2627
+ )
2628
+ and get_worker_id
2629
+ and resp.status_code == 200
2630
+ ):
2631
+ return UUID(resp.text)
2632
+ else:
2633
+ return None
2634
+
2613
2635
  async def read_workers_for_work_pool(
2614
2636
  self,
2615
2637
  work_pool_name: str,
@@ -2630,7 +2652,7 @@ class PrefectClient:
2630
2652
  response = await self._client.post(
2631
2653
  f"/work_pools/{work_pool_name}/workers/filter",
2632
2654
  json={
2633
- "worker_filter": (
2655
+ "workers": (
2634
2656
  worker_filter.model_dump(mode="json", exclude_unset=True)
2635
2657
  if worker_filter
2636
2658
  else None
@@ -3594,7 +3616,7 @@ class SyncPrefectClient:
3594
3616
  ),
3595
3617
  )
3596
3618
 
3597
- if not PREFECT_UNIT_TEST_MODE:
3619
+ if not PREFECT_TESTING_UNIT_TEST_MODE:
3598
3620
  httpx_settings.setdefault("follow_redirects", True)
3599
3621
 
3600
3622
  enable_csrf_support = (
@@ -85,18 +85,10 @@ class DeploymentScheduleCreate(ActionBaseModel):
85
85
  active: bool = Field(
86
86
  default=True, description="Whether or not the schedule is active."
87
87
  )
88
- max_active_runs: Optional[PositiveInteger] = Field(
89
- default=None,
90
- description="The maximum number of active runs for the schedule.",
91
- )
92
88
  max_scheduled_runs: Optional[PositiveInteger] = Field(
93
89
  default=None,
94
90
  description="The maximum number of scheduled runs for the schedule.",
95
91
  )
96
- catchup: bool = Field(
97
- default=False,
98
- description="Whether or not a worker should catch up on Late runs for the schedule.",
99
- )
100
92
 
101
93
  @field_validator("max_scheduled_runs")
102
94
  @classmethod
@@ -114,21 +106,11 @@ class DeploymentScheduleUpdate(ActionBaseModel):
114
106
  default=True, description="Whether or not the schedule is active."
115
107
  )
116
108
 
117
- max_active_runs: Optional[PositiveInteger] = Field(
118
- default=None,
119
- description="The maximum number of active runs for the schedule.",
120
- )
121
-
122
109
  max_scheduled_runs: Optional[PositiveInteger] = Field(
123
110
  default=None,
124
111
  description="The maximum number of scheduled runs for the schedule.",
125
112
  )
126
113
 
127
- catchup: Optional[bool] = Field(
128
- default=None,
129
- description="Whether or not a worker should catch up on Late runs for the schedule.",
130
- )
131
-
132
114
  @field_validator("max_scheduled_runs")
133
115
  @classmethod
134
116
  def validate_max_scheduled_runs(cls, v):
@@ -580,6 +562,17 @@ class LogCreate(ActionBaseModel):
580
562
  timestamp: DateTime = Field(default=..., description="The log timestamp.")
581
563
  flow_run_id: Optional[UUID] = Field(None)
582
564
  task_run_id: Optional[UUID] = Field(None)
565
+ worker_id: Optional[UUID] = Field(None)
566
+
567
+ def model_dump(self, *args, **kwargs):
568
+ """
569
+ The worker_id field is only included in logs sent to Prefect Cloud.
570
+ If it's unset, we should not include it in the log payload.
571
+ """
572
+ data = super().model_dump(*args, **kwargs)
573
+ if self.worker_id is None:
574
+ data.pop("worker_id")
575
+ return data
583
576
 
584
577
 
585
578
  class WorkPoolCreate(ActionBaseModel):
@@ -912,6 +912,17 @@ class WorkerFilterLastHeartbeatTime(PrefectBaseModel):
912
912
  )
913
913
 
914
914
 
915
+ class WorkerFilterStatus(PrefectBaseModel):
916
+ """Filter by `Worker.status`."""
917
+
918
+ any_: Optional[List[str]] = Field(
919
+ default=None, description="A list of worker statuses to include"
920
+ )
921
+ not_any_: Optional[List[str]] = Field(
922
+ default=None, description="A list of worker statuses to exclude"
923
+ )
924
+
925
+
915
926
  class WorkerFilter(PrefectBaseModel, OperatorMixin):
916
927
  # worker_config_id: Optional[WorkerFilterWorkPoolId] = Field(
917
928
  # default=None, description="Filter criteria for `Worker.worker_config_id`"
@@ -921,6 +932,9 @@ class WorkerFilter(PrefectBaseModel, OperatorMixin):
921
932
  default=None,
922
933
  description="Filter criteria for `Worker.last_heartbeat_time`",
923
934
  )
935
+ status: Optional[WorkerFilterStatus] = Field(
936
+ default=None, description="Filter criteria for `Worker.status`"
937
+ )
924
938
 
925
939
 
926
940
  class ArtifactFilterId(PrefectBaseModel):
@@ -32,6 +32,7 @@ from pydantic.functional_validators import ModelWrapValidatorHandler
32
32
  from pydantic_extra_types.pendulum_dt import DateTime
33
33
  from typing_extensions import Literal, Self, TypeVar
34
34
 
35
+ from prefect._internal.compatibility import deprecated
35
36
  from prefect._internal.compatibility.migration import getattr_migration
36
37
  from prefect._internal.schemas.bases import ObjectBaseModel, PrefectBaseModel
37
38
  from prefect._internal.schemas.fields import CreatedBy, UpdatedBy
@@ -186,7 +187,7 @@ class StateDetails(PrefectBaseModel):
186
187
 
187
188
 
188
189
  def data_discriminator(x: Any) -> str:
189
- if isinstance(x, dict) and "type" in x:
190
+ if isinstance(x, dict) and "type" in x and x["type"] != "unpersisted":
190
191
  return "BaseResult"
191
192
  elif isinstance(x, dict) and "storage_key" in x:
192
193
  return "ResultRecordMetadata"
@@ -220,10 +221,17 @@ class State(ObjectBaseModel, Generic[R]):
220
221
  def result(self: "State[R]", raise_on_failure: bool = False) -> Union[R, Exception]:
221
222
  ...
222
223
 
224
+ @deprecated.deprecated_parameter(
225
+ "fetch",
226
+ when=lambda fetch: fetch is not True,
227
+ start_date="Oct 2024",
228
+ end_date="Jan 2025",
229
+ help="Please ensure you are awaiting the call to `result()` when calling in an async context.",
230
+ )
223
231
  def result(
224
232
  self,
225
233
  raise_on_failure: bool = True,
226
- fetch: Optional[bool] = None,
234
+ fetch: bool = True,
227
235
  retry_result_failure: bool = True,
228
236
  ) -> Union[R, Exception]:
229
237
  """
@@ -248,22 +256,6 @@ class State(ObjectBaseModel, Generic[R]):
248
256
  The result of the run
249
257
 
250
258
  Examples:
251
- >>> from prefect import flow, task
252
- >>> @task
253
- >>> def my_task(x):
254
- >>> return x
255
-
256
- Get the result from a task future in a flow
257
-
258
- >>> @flow
259
- >>> def my_flow():
260
- >>> future = my_task("hello")
261
- >>> state = future.wait()
262
- >>> result = state.result()
263
- >>> print(result)
264
- >>> my_flow()
265
- hello
266
-
267
259
  Get the result from a flow state
268
260
 
269
261
  >>> @flow
@@ -307,7 +299,7 @@ class State(ObjectBaseModel, Generic[R]):
307
299
  >>> raise ValueError("oh no!")
308
300
  >>> my_flow.deploy("my_deployment/my_flow")
309
301
  >>> flow_run = run_deployment("my_deployment/my_flow")
310
- >>> await flow_run.state.result(raise_on_failure=True, fetch=True) # Raises `ValueError("oh no!")`
302
+ >>> await flow_run.state.result(raise_on_failure=True) # Raises `ValueError("oh no!")`
311
303
  """
312
304
  from prefect.states import get_state_result
313
305
 
@@ -365,6 +357,12 @@ class State(ObjectBaseModel, Generic[R]):
365
357
  self.state_details.scheduled_time = DateTime.now("utc")
366
358
  return self
367
359
 
360
+ @model_validator(mode="after")
361
+ def set_unpersisted_results_to_none(self) -> Self:
362
+ if isinstance(self.data, dict) and self.data.get("type") == "unpersisted":
363
+ self.data = None
364
+ return self
365
+
368
366
  def is_scheduled(self) -> bool:
369
367
  return self.type == StateType.SCHEDULED
370
368
 
@@ -1061,18 +1059,10 @@ class DeploymentSchedule(ObjectBaseModel):
1061
1059
  active: bool = Field(
1062
1060
  default=True, description="Whether or not the schedule is active."
1063
1061
  )
1064
- max_active_runs: Optional[PositiveInteger] = Field(
1065
- default=None,
1066
- description="The maximum number of active runs for the schedule.",
1067
- )
1068
1062
  max_scheduled_runs: Optional[PositiveInteger] = Field(
1069
1063
  default=None,
1070
1064
  description="The maximum number of scheduled runs for the schedule.",
1071
1065
  )
1072
- catchup: bool = Field(
1073
- default=False,
1074
- description="Whether or not a worker should catch up on Late runs for the schedule.",
1075
- )
1076
1066
 
1077
1067
 
1078
1068
  class Deployment(ObjectBaseModel):
@@ -38,8 +38,13 @@ from prefect.client.orchestration import PrefectClient, SyncPrefectClient, get_c
38
38
  from prefect.client.schemas import FlowRun, TaskRun
39
39
  from prefect.events.worker import EventsWorker
40
40
  from prefect.exceptions import MissingContextError
41
- from prefect.results import ResultStore, get_default_persist_setting
41
+ from prefect.results import (
42
+ ResultStore,
43
+ get_default_persist_setting,
44
+ get_default_persist_setting_for_tasks,
45
+ )
42
46
  from prefect.settings import Profile, Settings
47
+ from prefect.settings.legacy import _get_settings_fields
43
48
  from prefect.states import State
44
49
  from prefect.task_runners import TaskRunner
45
50
  from prefect.utilities.services import start_client_metrics_server
@@ -396,7 +401,7 @@ class TaskRunContext(RunContext):
396
401
 
397
402
  # Result handling
398
403
  result_store: ResultStore
399
- persist_result: bool = Field(default_factory=get_default_persist_setting)
404
+ persist_result: bool = Field(default_factory=get_default_persist_setting_for_tasks)
400
405
 
401
406
  __var__ = ContextVar("task_run")
402
407
 
@@ -598,8 +603,8 @@ def use_profile(
598
603
 
599
604
  if not override_environment_variables:
600
605
  for key in os.environ:
601
- if key in prefect.settings.SETTING_VARIABLES:
602
- profile_settings.pop(prefect.settings.SETTING_VARIABLES[key], None)
606
+ if key in _get_settings_fields(Settings):
607
+ profile_settings.pop(_get_settings_fields(Settings)[key], None)
603
608
 
604
609
  new_settings = settings.copy_with_update(updates=profile_settings)
605
610
 
@@ -272,8 +272,6 @@ def _format_deployment_for_saving_to_prefect_file(
272
272
  schedule_config = deployment_schedule.schedule.model_dump()
273
273
 
274
274
  schedule_config["active"] = deployment_schedule.active
275
- schedule_config["max_active_runs"] = deployment_schedule.max_active_runs
276
- schedule_config["catchup"] = deployment_schedule.catchup
277
275
  schedules.append(schedule_config)
278
276
 
279
277
  deployment["schedules"] = schedules
@@ -54,7 +54,11 @@ from prefect._internal.schemas.validators import (
54
54
  )
55
55
  from prefect.client.orchestration import get_client
56
56
  from prefect.client.schemas.actions import DeploymentScheduleCreate
57
- from prefect.client.schemas.objects import ConcurrencyLimitConfig, ConcurrencyOptions
57
+ from prefect.client.schemas.filters import WorkerFilter, WorkerFilterStatus
58
+ from prefect.client.schemas.objects import (
59
+ ConcurrencyLimitConfig,
60
+ ConcurrencyOptions,
61
+ )
58
62
  from prefect.client.schemas.schedules import (
59
63
  SCHEDULE_TYPES,
60
64
  construct_schedule,
@@ -867,6 +871,10 @@ async def deploy(
867
871
  try:
868
872
  async with get_client() as client:
869
873
  work_pool = await client.read_work_pool(work_pool_name)
874
+ active_workers = await client.read_workers_for_work_pool(
875
+ work_pool_name,
876
+ worker_filter=WorkerFilter(status=WorkerFilterStatus(any_=["ONLINE"])),
877
+ )
870
878
  except ObjectNotFound as exc:
871
879
  raise ValueError(
872
880
  f"Could not find work pool {work_pool_name!r}. Please create it before"
@@ -990,15 +998,16 @@ async def deploy(
990
998
  console.print(table)
991
999
 
992
1000
  if print_next_steps_message and not complete_failure:
993
- if not work_pool.is_push_pool and not work_pool.is_managed_pool:
1001
+ if (
1002
+ not work_pool.is_push_pool
1003
+ and not work_pool.is_managed_pool
1004
+ and not active_workers
1005
+ ):
994
1006
  console.print(
995
1007
  "\nTo execute flow runs from these deployments, start a worker in a"
996
1008
  " separate terminal that pulls work from the"
997
1009
  f" {work_pool_name!r} work pool:"
998
- )
999
- console.print(
1000
- f"\n\t$ prefect worker start --pool {work_pool_name!r}",
1001
- style="blue",
1010
+ f"\n\t[blue]$ prefect worker start --pool {work_pool_name!r}[/]",
1002
1011
  )
1003
1012
  console.print(
1004
1013
  "\nTo trigger any of these deployments, use the"
@@ -14,15 +14,11 @@ FlexibleScheduleList = Sequence[
14
14
  def create_deployment_schedule_create(
15
15
  schedule: "SCHEDULE_TYPES",
16
16
  active: Optional[bool] = True,
17
- max_active_runs: Optional[int] = None,
18
- catchup: bool = False,
19
17
  ) -> DeploymentScheduleCreate:
20
18
  """Create a DeploymentScheduleCreate object from common schedule parameters."""
21
19
  return DeploymentScheduleCreate(
22
20
  schedule=schedule,
23
21
  active=active if active is not None else True,
24
- max_active_runs=max_active_runs,
25
- catchup=catchup,
26
22
  )
27
23
 
28
24
 
@@ -147,7 +147,7 @@ class EventTrigger(ResourceTrigger):
147
147
  ),
148
148
  )
149
149
  posture: Literal[Posture.Reactive, Posture.Proactive] = Field( # type: ignore[valid-type]
150
- Posture.Reactive,
150
+ default=Posture.Reactive,
151
151
  description=(
152
152
  "The posture of this trigger, either Reactive or Proactive. Reactive "
153
153
  "triggers respond to the _presence_ of the expected events, while "
@@ -155,7 +155,7 @@ class EventTrigger(ResourceTrigger):
155
155
  ),
156
156
  )
157
157
  threshold: int = Field(
158
- 1,
158
+ default=1,
159
159
  description=(
160
160
  "The number of events required for this trigger to fire (for "
161
161
  "Reactive triggers), or the number of events expected (for Proactive "
@@ -163,7 +163,7 @@ class EventTrigger(ResourceTrigger):
163
163
  ),
164
164
  )
165
165
  within: timedelta = Field(
166
- timedelta(seconds=0),
166
+ default=timedelta(seconds=0),
167
167
  ge=timedelta(seconds=0),
168
168
  description=(
169
169
  "The time period over which the events must occur. For Reactive triggers, "
@@ -42,22 +42,27 @@ class BaseDeploymentTrigger(PrefectBaseModel, abc.ABC, extra="ignore"): # type:
42
42
  # Fields from Automation
43
43
 
44
44
  name: Optional[str] = Field(
45
- None, description="The name to give to the automation created for this trigger."
45
+ default=None,
46
+ description="The name to give to the automation created for this trigger.",
47
+ )
48
+ description: str = Field(
49
+ default="", description="A longer description of this automation"
50
+ )
51
+ enabled: bool = Field(
52
+ default=True, description="Whether this automation will be evaluated"
46
53
  )
47
- description: str = Field("", description="A longer description of this automation")
48
- enabled: bool = Field(True, description="Whether this automation will be evaluated")
49
54
 
50
55
  # Fields from the RunDeployment action
51
56
 
52
57
  parameters: Optional[Dict[str, Any]] = Field(
53
- None,
58
+ default=None,
54
59
  description=(
55
60
  "The parameters to pass to the deployment, or None to use the "
56
61
  "deployment's default parameters"
57
62
  ),
58
63
  )
59
64
  job_variables: Optional[Dict[str, Any]] = Field(
60
- None,
65
+ default=None,
61
66
  description=(
62
67
  "Job variables to pass to the deployment, or None to use the "
63
68
  "deployment's default job variables"