prefect-client 3.0.10__tar.gz → 3.0.11__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.0.11}/MANIFEST.in +1 -1
  2. {prefect-client-3.0.10/src/prefect_client.egg-info → prefect-client-3.0.11}/PKG-INFO +1 -1
  3. {prefect-client-3.0.10 → prefect-client-3.0.11}/requirements-client.txt +1 -1
  4. {prefect-client-3.0.10 → prefect-client-3.0.11}/setup.cfg +3 -3
  5. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/__init__.py +17 -14
  6. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/schemas/bases.py +1 -0
  7. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/schemas/validators.py +5 -3
  8. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_version.py +3 -3
  9. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/cloud.py +2 -2
  10. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/orchestration.py +4 -4
  11. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/schemas/filters.py +14 -0
  12. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/context.py +3 -2
  13. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/runner.py +15 -6
  14. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/schemas/automations.py +3 -3
  15. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/schemas/deployment_triggers.py +10 -5
  16. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/flow_engine.py +4 -4
  17. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/flows.py +24 -9
  18. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/futures.py +4 -4
  19. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/logging/handlers.py +1 -1
  20. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/logging/highlighters.py +2 -0
  21. prefect-client-3.0.11/src/prefect/logging/logging.yml +114 -0
  22. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runner/runner.py +1 -2
  23. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runner/server.py +12 -1
  24. prefect-client-3.0.11/src/prefect/settings/__init__.py +59 -0
  25. prefect-client-3.0.11/src/prefect/settings/base.py +131 -0
  26. prefect-client-3.0.11/src/prefect/settings/constants.py +8 -0
  27. prefect-client-3.0.11/src/prefect/settings/context.py +65 -0
  28. prefect-client-3.0.11/src/prefect/settings/legacy.py +167 -0
  29. prefect-client-3.0.11/src/prefect/settings/models/api.py +41 -0
  30. prefect-client-3.0.11/src/prefect/settings/models/cli.py +31 -0
  31. prefect-client-3.0.11/src/prefect/settings/models/client.py +90 -0
  32. prefect-client-3.0.11/src/prefect/settings/models/cloud.py +58 -0
  33. prefect-client-3.0.11/src/prefect/settings/models/deployments.py +40 -0
  34. prefect-client-3.0.11/src/prefect/settings/models/flows.py +37 -0
  35. prefect-client-3.0.11/src/prefect/settings/models/internal.py +21 -0
  36. prefect-client-3.0.11/src/prefect/settings/models/logging.py +137 -0
  37. prefect-client-3.0.11/src/prefect/settings/models/results.py +47 -0
  38. prefect-client-3.0.11/src/prefect/settings/models/root.py +447 -0
  39. prefect-client-3.0.11/src/prefect/settings/models/runner.py +65 -0
  40. prefect-client-3.0.11/src/prefect/settings/models/server/__init__.py +1 -0
  41. prefect-client-3.0.11/src/prefect/settings/models/server/api.py +133 -0
  42. prefect-client-3.0.11/src/prefect/settings/models/server/database.py +202 -0
  43. prefect-client-3.0.11/src/prefect/settings/models/server/deployments.py +24 -0
  44. prefect-client-3.0.11/src/prefect/settings/models/server/ephemeral.py +34 -0
  45. prefect-client-3.0.11/src/prefect/settings/models/server/events.py +140 -0
  46. prefect-client-3.0.11/src/prefect/settings/models/server/flow_run_graph.py +34 -0
  47. prefect-client-3.0.11/src/prefect/settings/models/server/root.py +143 -0
  48. prefect-client-3.0.11/src/prefect/settings/models/server/services.py +485 -0
  49. prefect-client-3.0.11/src/prefect/settings/models/server/tasks.py +86 -0
  50. prefect-client-3.0.11/src/prefect/settings/models/server/ui.py +52 -0
  51. prefect-client-3.0.11/src/prefect/settings/models/tasks.py +91 -0
  52. prefect-client-3.0.11/src/prefect/settings/models/testing.py +52 -0
  53. prefect-client-3.0.11/src/prefect/settings/models/ui.py +0 -0
  54. prefect-client-3.0.11/src/prefect/settings/models/worker.py +46 -0
  55. prefect-client-3.0.11/src/prefect/settings/profiles.py +390 -0
  56. prefect-client-3.0.11/src/prefect/settings/sources.py +162 -0
  57. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/task_engine.py +24 -29
  58. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/task_runners.py +6 -1
  59. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/tasks.py +63 -28
  60. prefect-client-3.0.11/src/prefect/utilities/__init__.py +0 -0
  61. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/asyncutils.py +1 -1
  62. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/engine.py +11 -3
  63. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/services.py +3 -3
  64. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/workers/base.py +8 -2
  65. {prefect-client-3.0.10 → prefect-client-3.0.11/src/prefect_client.egg-info}/PKG-INFO +1 -1
  66. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect_client.egg-info/SOURCES.txt +35 -2
  67. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect_client.egg-info/requires.txt +1 -1
  68. prefect-client-3.0.10/src/prefect/logging/logging.yml +0 -115
  69. prefect-client-3.0.10/src/prefect/settings.py +0 -2172
  70. {prefect-client-3.0.10 → prefect-client-3.0.11}/LICENSE +0 -0
  71. {prefect-client-3.0.10 → prefect-client-3.0.11}/README.md +0 -0
  72. {prefect-client-3.0.10 → prefect-client-3.0.11}/requirements-dev.txt +0 -0
  73. {prefect-client-3.0.10 → prefect-client-3.0.11}/requirements.txt +0 -0
  74. {prefect-client-3.0.10 → prefect-client-3.0.11}/setup.py +0 -0
  75. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/.prefectignore +0 -0
  76. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/__init__.py +0 -0
  77. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/_logging.py +0 -0
  78. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/compatibility/__init__.py +0 -0
  79. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/compatibility/deprecated.py +0 -0
  80. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/compatibility/migration.py +0 -0
  81. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/__init__.py +0 -0
  82. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/api.py +0 -0
  83. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/calls.py +0 -0
  84. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  85. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  86. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/inspection.py +0 -0
  87. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/primitives.py +0 -0
  88. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/services.py +0 -0
  89. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/threads.py +0 -0
  90. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/concurrency/waiters.py +0 -0
  91. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/integrations.py +0 -0
  92. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/pydantic/__init__.py +0 -0
  93. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  94. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
  95. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/pydantic/schemas.py +0 -0
  96. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
  97. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
  98. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  99. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/pytz.py +0 -0
  100. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/retries.py +0 -0
  101. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/schemas/__init__.py +0 -0
  102. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/schemas/fields.py +0 -0
  103. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/_internal/schemas/serializers.py +0 -0
  104. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/agent.py +0 -0
  105. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/artifacts.py +0 -0
  106. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/automations.py +0 -0
  107. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/blocks/__init__.py +0 -0
  108. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/blocks/abstract.py +0 -0
  109. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/blocks/core.py +0 -0
  110. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/blocks/fields.py +0 -0
  111. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/blocks/notifications.py +0 -0
  112. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/blocks/redis.py +0 -0
  113. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/blocks/system.py +0 -0
  114. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/blocks/webhook.py +0 -0
  115. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/cache_policies.py +0 -0
  116. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/__init__.py +0 -0
  117. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/base.py +0 -0
  118. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/collections.py +0 -0
  119. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/constants.py +0 -0
  120. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/schemas/__init__.py +0 -0
  121. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/schemas/actions.py +0 -0
  122. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/schemas/objects.py +0 -0
  123. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/schemas/responses.py +0 -0
  124. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/schemas/schedules.py +0 -0
  125. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/schemas/sorting.py +0 -0
  126. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/subscriptions.py +0 -0
  127. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/types/__init__.py +0 -0
  128. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/types/flexible_schedule_list.py +0 -0
  129. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/client/utilities.py +0 -0
  130. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/__init__.py +0 -0
  131. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/asyncio.py +0 -0
  132. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/context.py +0 -0
  133. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/events.py +0 -0
  134. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/services.py +0 -0
  135. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/sync.py +0 -0
  136. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/v1/__init__.py +0 -0
  137. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/v1/asyncio.py +0 -0
  138. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/v1/context.py +0 -0
  139. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/v1/events.py +0 -0
  140. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/v1/services.py +0 -0
  141. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/concurrency/v1/sync.py +0 -0
  142. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/__init__.py +0 -0
  143. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/base.py +0 -0
  144. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/deployments.py +0 -0
  145. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/flow_runs.py +0 -0
  146. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/schedules.py +0 -0
  147. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/steps/__init__.py +0 -0
  148. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/steps/core.py +0 -0
  149. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/steps/pull.py +0 -0
  150. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/deployments/steps/utility.py +0 -0
  151. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/docker/__init__.py +0 -0
  152. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/docker/docker_image.py +0 -0
  153. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/engine.py +0 -0
  154. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/__init__.py +0 -0
  155. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/actions.py +0 -0
  156. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/cli/__init__.py +0 -0
  157. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/cli/automations.py +0 -0
  158. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/clients.py +0 -0
  159. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/filters.py +0 -0
  160. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/related.py +0 -0
  161. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/schemas/__init__.py +0 -0
  162. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/schemas/events.py +0 -0
  163. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/schemas/labelling.py +0 -0
  164. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/utilities.py +0 -0
  165. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/events/worker.py +0 -0
  166. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/exceptions.py +0 -0
  167. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/filesystems.py +0 -0
  168. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/flow_runs.py +0 -0
  169. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/infrastructure/__init__.py +0 -0
  170. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/infrastructure/base.py +0 -0
  171. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  172. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  173. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  174. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  175. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  176. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/input/__init__.py +0 -0
  177. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/input/actions.py +0 -0
  178. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/input/run_input.py +0 -0
  179. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/locking/__init__.py +0 -0
  180. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/locking/filesystem.py +0 -0
  181. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/locking/memory.py +0 -0
  182. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/locking/protocol.py +0 -0
  183. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/logging/__init__.py +0 -0
  184. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/logging/configuration.py +0 -0
  185. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/logging/filters.py +0 -0
  186. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/logging/formatters.py +0 -0
  187. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/logging/loggers.py +0 -0
  188. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/main.py +0 -0
  189. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/plugins.py +0 -0
  190. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/py.typed +0 -0
  191. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/records/__init__.py +0 -0
  192. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/records/base.py +0 -0
  193. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/records/filesystem.py +0 -0
  194. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/records/memory.py +0 -0
  195. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/records/result_store.py +0 -0
  196. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/results.py +0 -0
  197. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runner/__init__.py +0 -0
  198. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runner/storage.py +0 -0
  199. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runner/submit.py +0 -0
  200. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runner/utils.py +0 -0
  201. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runtime/__init__.py +0 -0
  202. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runtime/deployment.py +0 -0
  203. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runtime/flow_run.py +0 -0
  204. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/runtime/task_run.py +0 -0
  205. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/serializers.py +0 -0
  206. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
  207. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  208. {prefect-client-3.0.10/src/prefect/utilities → prefect-client-3.0.11/src/prefect/settings/models}/__init__.py +0 -0
  209. {prefect-client-3.0.10/src/prefect → prefect-client-3.0.11/src/prefect/settings}/profiles.toml +0 -0
  210. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/states.py +0 -0
  211. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/task_runs.py +0 -0
  212. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/task_worker.py +0 -0
  213. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/transactions.py +0 -0
  214. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/types/__init__.py +0 -0
  215. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/types/entrypoint.py +0 -0
  216. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/annotations.py +0 -0
  217. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/callables.py +0 -0
  218. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/collections.py +0 -0
  219. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/compat.py +0 -0
  220. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/context.py +0 -0
  221. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/dispatch.py +0 -0
  222. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/dockerutils.py +0 -0
  223. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/filesystem.py +0 -0
  224. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/hashing.py +0 -0
  225. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/importtools.py +0 -0
  226. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/math.py +0 -0
  227. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/names.py +0 -0
  228. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/processutils.py +0 -0
  229. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/pydantic.py +0 -0
  230. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/render_swagger.py +0 -0
  231. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/schema_tools/__init__.py +0 -0
  232. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/schema_tools/hydration.py +0 -0
  233. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/schema_tools/validation.py +0 -0
  234. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/slugify.py +0 -0
  235. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/templating.py +0 -0
  236. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/text.py +0 -0
  237. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/timeout.py +0 -0
  238. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/urls.py +0 -0
  239. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/utilities/visualization.py +0 -0
  240. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/variables.py +0 -0
  241. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/workers/__init__.py +0 -0
  242. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/workers/block.py +0 -0
  243. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/workers/cloud.py +0 -0
  244. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/workers/process.py +0 -0
  245. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/workers/server.py +0 -0
  246. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect/workers/utilities.py +0 -0
  247. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  248. {prefect-client-3.0.10 → prefect-client-3.0.11}/src/prefect_client.egg-info/top_level.txt +0 -0
  249. {prefect-client-3.0.10 → prefect-client-3.0.11}/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.0.11
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -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
@@ -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-24T17:36:06-0500",
12
12
  "dirty": true,
13
13
  "error": null,
14
- "full-revisionid": "3aa2d89362c2fe8ee429f0c2cf7e623e34588029",
15
- "version": "3.0.10"
14
+ "full-revisionid": "a17ccfcf2be76360f13806d7aca1e2cf9fa3741e",
15
+ "version": "3.0.11"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -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,7 @@ 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
137
  )
138
138
 
139
139
  if TYPE_CHECKING:
@@ -385,7 +385,7 @@ class PrefectClient:
385
385
  ),
386
386
  )
387
387
 
388
- if not PREFECT_UNIT_TEST_MODE:
388
+ if not PREFECT_TESTING_UNIT_TEST_MODE:
389
389
  httpx_settings.setdefault("follow_redirects", True)
390
390
 
391
391
  enable_csrf_support = (
@@ -2630,7 +2630,7 @@ class PrefectClient:
2630
2630
  response = await self._client.post(
2631
2631
  f"/work_pools/{work_pool_name}/workers/filter",
2632
2632
  json={
2633
- "worker_filter": (
2633
+ "workers": (
2634
2634
  worker_filter.model_dump(mode="json", exclude_unset=True)
2635
2635
  if worker_filter
2636
2636
  else None
@@ -3594,7 +3594,7 @@ class SyncPrefectClient:
3594
3594
  ),
3595
3595
  )
3596
3596
 
3597
- if not PREFECT_UNIT_TEST_MODE:
3597
+ if not PREFECT_TESTING_UNIT_TEST_MODE:
3598
3598
  httpx_settings.setdefault("follow_redirects", True)
3599
3599
 
3600
3600
  enable_csrf_support = (
@@ -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):
@@ -40,6 +40,7 @@ from prefect.events.worker import EventsWorker
40
40
  from prefect.exceptions import MissingContextError
41
41
  from prefect.results import ResultStore, get_default_persist_setting
42
42
  from prefect.settings import Profile, Settings
43
+ from prefect.settings.legacy import _get_settings_fields
43
44
  from prefect.states import State
44
45
  from prefect.task_runners import TaskRunner
45
46
  from prefect.utilities.services import start_client_metrics_server
@@ -598,8 +599,8 @@ def use_profile(
598
599
 
599
600
  if not override_environment_variables:
600
601
  for key in os.environ:
601
- if key in prefect.settings.SETTING_VARIABLES:
602
- profile_settings.pop(prefect.settings.SETTING_VARIABLES[key], None)
602
+ if key in _get_settings_fields(Settings):
603
+ profile_settings.pop(_get_settings_fields(Settings)[key], None)
603
604
 
604
605
  new_settings = settings.copy_with_update(updates=profile_settings)
605
606
 
@@ -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"
@@ -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"
@@ -1,4 +1,4 @@
1
- import inspect
1
+ import asyncio
2
2
  import logging
3
3
  import os
4
4
  import time
@@ -244,7 +244,7 @@ class FlowRunEngine(Generic[P, R]):
244
244
  else:
245
245
  _result = self._return_value
246
246
 
247
- if inspect.isawaitable(_result):
247
+ if asyncio.iscoroutine(_result):
248
248
  # getting the value for a BaseResult may return an awaitable
249
249
  # depending on whether the parent frame is sync or not
250
250
  _result = run_coro_as_sync(_result)
@@ -263,7 +263,7 @@ class FlowRunEngine(Generic[P, R]):
263
263
  _result = self.state.result(raise_on_failure=raise_on_failure, fetch=True) # type: ignore
264
264
  # state.result is a `sync_compatible` function that may or may not return an awaitable
265
265
  # depending on whether the parent frame is sync or not
266
- if inspect.isawaitable(_result):
266
+ if asyncio.iscoroutine(_result):
267
267
  _result = run_coro_as_sync(_result)
268
268
  return _result
269
269
 
@@ -477,7 +477,7 @@ class FlowRunEngine(Generic[P, R]):
477
477
  f" {state.name!r}"
478
478
  )
479
479
  result = hook(flow, flow_run, state)
480
- if inspect.isawaitable(result):
480
+ if asyncio.iscoroutine(result):
481
481
  run_coro_as_sync(result)
482
482
  except Exception:
483
483
  self.logger.error(
@@ -49,8 +49,8 @@ from typing_extensions import Literal, ParamSpec, Self
49
49
 
50
50
  from prefect._internal.concurrency.api import create_call, from_async
51
51
  from prefect.blocks.core import Block
52
- from prefect.client.orchestration import get_client
53
52
  from prefect.client.schemas.actions import DeploymentScheduleCreate
53
+ from prefect.client.schemas.filters import WorkerFilter
54
54
  from prefect.client.schemas.objects import ConcurrencyLimitConfig, FlowRun
55
55
  from prefect.client.schemas.objects import Flow as FlowSchema
56
56
  from prefect.client.utilities import client_injector
@@ -74,8 +74,8 @@ from prefect.settings import (
74
74
  PREFECT_DEFAULT_WORK_POOL_NAME,
75
75
  PREFECT_FLOW_DEFAULT_RETRIES,
76
76
  PREFECT_FLOW_DEFAULT_RETRY_DELAY_SECONDS,
77
+ PREFECT_TESTING_UNIT_TEST_MODE,
77
78
  PREFECT_UI_URL,
78
- PREFECT_UNIT_TEST_MODE,
79
79
  )
80
80
  from prefect.states import State
81
81
  from prefect.task_runners import TaskRunner, ThreadPoolTaskRunner
@@ -286,7 +286,7 @@ class Flow(Generic[P, R]):
286
286
 
287
287
  # the flow is considered async if its function is async or an async
288
288
  # generator
289
- self.isasync = inspect.iscoroutinefunction(
289
+ self.isasync = asyncio.iscoroutinefunction(
290
290
  self.fn
291
291
  ) or inspect.isasyncgenfunction(self.fn)
292
292
 
@@ -1168,9 +1168,15 @@ class Flow(Generic[P, R]):
1168
1168
  " `PREFECT_DEFAULT_WORK_POOL_NAME` environment variable."
1169
1169
  )
1170
1170
 
1171
+ from prefect.client.orchestration import get_client
1172
+
1171
1173
  try:
1172
1174
  async with get_client() as client:
1173
1175
  work_pool = await client.read_work_pool(work_pool_name)
1176
+ active_workers = await client.read_workers_for_work_pool(
1177
+ work_pool_name,
1178
+ worker_filter=WorkerFilter(status={"any_": ["ONLINE"]}),
1179
+ )
1174
1180
  except ObjectNotFound as exc:
1175
1181
  raise ValueError(
1176
1182
  f"Could not find work pool {work_pool_name!r}. Please create it before"
@@ -1210,7 +1216,11 @@ class Flow(Generic[P, R]):
1210
1216
 
1211
1217
  if print_next_steps:
1212
1218
  console = Console()
1213
- if not work_pool.is_push_pool and not work_pool.is_managed_pool:
1219
+ if (
1220
+ not work_pool.is_push_pool
1221
+ and not work_pool.is_managed_pool
1222
+ and not active_workers
1223
+ ):
1214
1224
  console.print(
1215
1225
  "\nTo execute flow runs from this deployment, start a worker in a"
1216
1226
  " separate terminal that pulls work from the"
@@ -1370,7 +1380,7 @@ class Flow(Generic[P, R]):
1370
1380
  visualize_task_dependencies,
1371
1381
  )
1372
1382
 
1373
- if not PREFECT_UNIT_TEST_MODE:
1383
+ if not PREFECT_TESTING_UNIT_TEST_MODE:
1374
1384
  warnings.warn(
1375
1385
  "`flow.visualize()` will execute code inside of your flow that is not"
1376
1386
  " decorated with `@task` or `@flow`."
@@ -1848,10 +1858,15 @@ def serve(
1848
1858
  else:
1849
1859
  raise
1850
1860
 
1851
- if loop is not None:
1852
- loop.run_until_complete(runner.start())
1853
- else:
1854
- asyncio.run(runner.start())
1861
+ try:
1862
+ if loop is not None:
1863
+ loop.run_until_complete(runner.start())
1864
+ else:
1865
+ asyncio.run(runner.start())
1866
+ except (KeyboardInterrupt, TerminationSignal) as exc:
1867
+ logger.info(f"Received {type(exc).__name__}, shutting down...")
1868
+ if loop is not None:
1869
+ loop.stop()
1855
1870
 
1856
1871
 
1857
1872
  @client_injector
@@ -1,7 +1,7 @@
1
1
  import abc
2
+ import asyncio
2
3
  import collections
3
4
  import concurrent.futures
4
- import inspect
5
5
  import threading
6
6
  import uuid
7
7
  from collections.abc import Generator, Iterator
@@ -166,7 +166,7 @@ class PrefectConcurrentFuture(PrefectWrappedFuture[R, concurrent.futures.Future]
166
166
  )
167
167
  # state.result is a `sync_compatible` function that may or may not return an awaitable
168
168
  # depending on whether the parent frame is sync or not
169
- if inspect.isawaitable(_result):
169
+ if asyncio.iscoroutine(_result):
170
170
  _result = run_coro_as_sync(_result)
171
171
  return _result
172
172
 
@@ -298,10 +298,10 @@ class PrefectFutureList(list, Iterator, Generic[F]):
298
298
  wait(self, timeout=timeout)
299
299
 
300
300
  def result(
301
- self,
301
+ self: "PrefectFutureList[R]",
302
302
  timeout: Optional[float] = None,
303
303
  raise_on_failure: bool = True,
304
- ) -> List:
304
+ ) -> List[R]:
305
305
  """
306
306
  Get the results of all task runs associated with the futures in the list.
307
307
 
@@ -133,7 +133,7 @@ class APILogHandler(logging.Handler):
133
133
  try:
134
134
  profile = prefect.context.get_settings_context()
135
135
 
136
- if not profile.settings.logging_to_api_enabled:
136
+ if not profile.settings.logging.to_api.enabled:
137
137
  return # Respect the global settings toggle
138
138
  if not getattr(record, "send_to_api", True):
139
139
  return # Do not send records that have opted out
@@ -47,6 +47,8 @@ class StateHighlighter(RegexHighlighter):
47
47
  highlights = [
48
48
  rf"(?P<{state.value.lower()}_state>{state.value.title()})"
49
49
  for state in StateType
50
+ ] + [
51
+ r"(?P<cached_state>Cached)(?=\(type=COMPLETED\))" # Highlight only "Cached"
50
52
  ]
51
53
 
52
54
 
@@ -0,0 +1,114 @@
1
+ # Prefect logging config file.
2
+ #
3
+ # Any item in this file can be overridden with an environment variable:
4
+ # `PREFECT_LOGGING_[PATH]_[TO]_[KEY]=VALUE`
5
+ #
6
+ # Templated values can be used to insert values from the Prefect settings at runtime.
7
+
8
+ version: 1
9
+ disable_existing_loggers: False
10
+
11
+ formatters:
12
+ simple:
13
+ format: "%(asctime)s.%(msecs)03d | %(message)s"
14
+ datefmt: "%H:%M:%S"
15
+
16
+ standard:
17
+ (): prefect.logging.formatters.PrefectFormatter
18
+ format: "%(asctime)s.%(msecs)03d | %(levelname)-7s | %(name)s - %(message)s"
19
+ flow_run_fmt: "%(asctime)s.%(msecs)03d | %(levelname)-7s | Flow run %(flow_run_name)r - %(message)s"
20
+ task_run_fmt: "%(asctime)s.%(msecs)03d | %(levelname)-7s | Task run %(task_run_name)r - %(message)s"
21
+ datefmt: "%H:%M:%S"
22
+
23
+ debug:
24
+ format: "%(asctime)s.%(msecs)03d | %(levelname)-7s | %(threadName)-12s | %(name)s - %(message)s"
25
+ datefmt: "%H:%M:%S"
26
+
27
+ json:
28
+ class: prefect.logging.formatters.JsonFormatter
29
+ format: "default"
30
+
31
+ # filters:
32
+ # Define any custom filters to drops records containing
33
+ # sensitive information
34
+ # my_filter:
35
+ # class: your_module.FilterClass
36
+
37
+ handlers:
38
+ # The handlers we define here will output all logs they receive by default
39
+ # but we include the `level` so it can be overridden by environment
40
+
41
+ console:
42
+ level: 0
43
+ class: prefect.logging.handlers.PrefectConsoleHandler
44
+ formatter: standard
45
+ styles:
46
+ log.web_url: bright_blue
47
+ log.local_url: bright_blue
48
+
49
+ log.info_level: cyan
50
+ log.warning_level: yellow3
51
+ log.error_level: red3
52
+ log.critical_level: bright_red
53
+
54
+ log.completed_state: green
55
+ log.cancelled_state: yellow3
56
+ log.failed_state: red3
57
+ log.crashed_state: bright_red
58
+ log.cached_state: bright_blue
59
+
60
+ log.flow_run_name: magenta
61
+ log.flow_name: bold magenta
62
+
63
+ api:
64
+ level: 0
65
+ class: prefect.logging.handlers.APILogHandler
66
+
67
+ debug:
68
+ level: 0
69
+ class: logging.StreamHandler
70
+ formatter: debug
71
+
72
+ loggers:
73
+ prefect:
74
+ level: "${PREFECT_LOGGING_LEVEL}"
75
+
76
+ prefect.extra:
77
+ level: "${PREFECT_LOGGING_LEVEL}"
78
+ handlers: [api]
79
+ propagate: false
80
+
81
+ prefect.flow_runs:
82
+ level: NOTSET
83
+ handlers: [api]
84
+
85
+ prefect.task_runs:
86
+ level: NOTSET
87
+ handlers: [api]
88
+
89
+ prefect.server:
90
+ level: "${PREFECT_SERVER_LOGGING_LEVEL}"
91
+
92
+ prefect.client:
93
+ level: "${PREFECT_LOGGING_LEVEL}"
94
+
95
+ prefect.infrastructure:
96
+ level: "${PREFECT_LOGGING_LEVEL}"
97
+
98
+ prefect._internal:
99
+ level: "${PREFECT_INTERNAL_LOGGING_LEVEL}"
100
+ propagate: false
101
+ handlers: [debug]
102
+
103
+ uvicorn:
104
+ level: "${PREFECT_SERVER_LOGGING_LEVEL}"
105
+
106
+ fastapi:
107
+ level: "${PREFECT_SERVER_LOGGING_LEVEL}"
108
+
109
+ # The root logger: any logger without propagation disabled sends to here as well
110
+ root:
111
+ # By default, we display warning level logs from any library in the console
112
+ # to match Python's default behavior while formatting logs nicely
113
+ level: WARNING
114
+ handlers: [console]
@@ -32,7 +32,6 @@ Example:
32
32
 
33
33
  import asyncio
34
34
  import datetime
35
- import inspect
36
35
  import logging
37
36
  import os
38
37
  import shutil
@@ -1213,7 +1212,7 @@ class Runner:
1213
1212
  task_status.started()
1214
1213
 
1215
1214
  result = fn(*args, **kwargs)
1216
- if inspect.iscoroutine(result):
1215
+ if asyncio.iscoroutine(result):
1217
1216
  await result
1218
1217
 
1219
1218
  await self._runs_task_group.start(wrapper)
@@ -298,4 +298,15 @@ def start_webserver(runner: "Runner", log_level: Optional[str] = None) -> None:
298
298
  port = PREFECT_RUNNER_SERVER_PORT.value()
299
299
  log_level = log_level or PREFECT_RUNNER_SERVER_LOG_LEVEL.value()
300
300
  webserver = build_server(runner)
301
- uvicorn.run(webserver, host=host, port=port, log_level=log_level)
301
+ uvicorn.run(
302
+ webserver, host=host, port=port, log_level=log_level.lower()
303
+ ) # Uvicorn supports only lowercase log_level
304
+ # From the Uvicorn config file:
305
+ # LOG_LEVELS: dict[str, int] = {
306
+ # "critical": logging.CRITICAL,
307
+ # "error": logging.ERROR,
308
+ # "warning": logging.WARNING,
309
+ # "info": logging.INFO,
310
+ # "debug": logging.DEBUG,
311
+ # "trace": TRACE_LOG_LEVEL,
312
+ # }