prefect-client 3.0.0rc3__tar.gz → 3.0.0rc4__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 (192) hide show
  1. {prefect-client-3.0.0rc3/src/prefect_client.egg-info → prefect-client-3.0.0rc4}/PKG-INFO +1 -1
  2. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/requirements-client.txt +1 -2
  3. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/requirements-dev.txt +1 -1
  4. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/requirements.txt +0 -1
  5. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/__init__.py +0 -1
  6. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/subscriptions.py +3 -3
  7. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/flow_engine.py +82 -2
  8. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/flows.py +12 -2
  9. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/futures.py +9 -1
  10. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/results.py +33 -31
  11. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/settings.py +1 -1
  12. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/task_engine.py +5 -6
  13. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/task_runs.py +23 -9
  14. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/task_worker.py +128 -19
  15. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/tasks.py +20 -14
  16. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/transactions.py +6 -8
  17. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/types/__init__.py +10 -3
  18. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/collections.py +120 -57
  19. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/urls.py +5 -5
  20. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4/src/prefect_client.egg-info}/PKG-INFO +1 -1
  21. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect_client.egg-info/SOURCES.txt +0 -1
  22. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect_client.egg-info/requires.txt +1 -1
  23. prefect-client-3.0.0rc3/src/prefect/blocks/kubernetes.py +0 -115
  24. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/LICENSE +0 -0
  25. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/MANIFEST.in +0 -0
  26. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/README.md +0 -0
  27. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/setup.cfg +0 -0
  28. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/setup.py +0 -0
  29. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/.prefectignore +0 -0
  30. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/__init__.py +0 -0
  31. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/_logging.py +0 -0
  32. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/compatibility/__init__.py +0 -0
  33. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/compatibility/deprecated.py +0 -0
  34. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/compatibility/experimental.py +0 -0
  35. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/compatibility/migration.py +0 -0
  36. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/__init__.py +0 -0
  37. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/api.py +0 -0
  38. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/calls.py +0 -0
  39. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  40. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  41. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/inspection.py +0 -0
  42. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/primitives.py +0 -0
  43. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/services.py +0 -0
  44. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/threads.py +0 -0
  45. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/concurrency/waiters.py +0 -0
  46. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/pydantic/__init__.py +0 -0
  47. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  48. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
  49. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/pydantic/schemas.py +0 -0
  50. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
  51. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
  52. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  53. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/pytz.py +0 -0
  54. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/schemas/__init__.py +0 -0
  55. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/schemas/bases.py +0 -0
  56. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/schemas/fields.py +0 -0
  57. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/schemas/serializers.py +0 -0
  58. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_internal/schemas/validators.py +0 -0
  59. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/_version.py +0 -0
  60. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/artifacts.py +0 -0
  61. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/automations.py +0 -0
  62. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/blocks/__init__.py +0 -0
  63. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/blocks/abstract.py +0 -0
  64. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/blocks/core.py +0 -0
  65. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/blocks/fields.py +0 -0
  66. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/blocks/notifications.py +0 -0
  67. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/blocks/redis.py +0 -0
  68. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/blocks/system.py +0 -0
  69. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/blocks/webhook.py +0 -0
  70. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/__init__.py +0 -0
  71. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/base.py +0 -0
  72. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/cloud.py +0 -0
  73. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/collections.py +0 -0
  74. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/constants.py +0 -0
  75. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/orchestration.py +0 -0
  76. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/schemas/__init__.py +0 -0
  77. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/schemas/actions.py +0 -0
  78. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/schemas/filters.py +0 -0
  79. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/schemas/objects.py +0 -0
  80. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/schemas/responses.py +0 -0
  81. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/schemas/schedules.py +0 -0
  82. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/schemas/sorting.py +0 -0
  83. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/client/utilities.py +0 -0
  84. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/concurrency/__init__.py +0 -0
  85. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/concurrency/asyncio.py +0 -0
  86. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/concurrency/events.py +0 -0
  87. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/concurrency/services.py +0 -0
  88. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/concurrency/sync.py +0 -0
  89. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/context.py +0 -0
  90. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/__init__.py +0 -0
  91. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/base.py +0 -0
  92. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/deployments.py +0 -0
  93. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/flow_runs.py +0 -0
  94. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/runner.py +0 -0
  95. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/schedules.py +0 -0
  96. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/steps/__init__.py +0 -0
  97. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/steps/core.py +0 -0
  98. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/steps/pull.py +0 -0
  99. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/deployments/steps/utility.py +0 -0
  100. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/engine.py +0 -0
  101. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/__init__.py +0 -0
  102. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/actions.py +0 -0
  103. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/cli/__init__.py +0 -0
  104. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/cli/automations.py +0 -0
  105. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/clients.py +0 -0
  106. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/filters.py +0 -0
  107. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/related.py +0 -0
  108. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/schemas/__init__.py +0 -0
  109. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/schemas/automations.py +0 -0
  110. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/schemas/deployment_triggers.py +0 -0
  111. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/schemas/events.py +0 -0
  112. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/schemas/labelling.py +0 -0
  113. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/utilities.py +0 -0
  114. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/events/worker.py +0 -0
  115. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/exceptions.py +0 -0
  116. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/filesystems.py +0 -0
  117. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/flow_runs.py +0 -0
  118. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/infrastructure/__init__.py +0 -0
  119. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  120. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  121. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  122. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  123. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  124. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/input/__init__.py +0 -0
  125. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/input/actions.py +0 -0
  126. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/input/run_input.py +0 -0
  127. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/logging/__init__.py +0 -0
  128. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/logging/configuration.py +0 -0
  129. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/logging/filters.py +0 -0
  130. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/logging/formatters.py +0 -0
  131. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/logging/handlers.py +0 -0
  132. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/logging/highlighters.py +0 -0
  133. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/logging/loggers.py +0 -0
  134. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/logging/logging.yml +0 -0
  135. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/manifests.py +0 -0
  136. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/plugins.py +0 -0
  137. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/profiles.toml +0 -0
  138. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/py.typed +0 -0
  139. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/records/__init__.py +0 -0
  140. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/records/cache_policies.py +0 -0
  141. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/records/result_store.py +0 -0
  142. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/records/store.py +0 -0
  143. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runner/__init__.py +0 -0
  144. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runner/runner.py +0 -0
  145. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runner/server.py +0 -0
  146. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runner/storage.py +0 -0
  147. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runner/submit.py +0 -0
  148. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runner/utils.py +0 -0
  149. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runtime/__init__.py +0 -0
  150. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runtime/deployment.py +0 -0
  151. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runtime/flow_run.py +0 -0
  152. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/runtime/task_run.py +0 -0
  153. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/serializers.py +0 -0
  154. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
  155. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  156. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/states.py +0 -0
  157. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/task_runners.py +0 -0
  158. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/__init__.py +0 -0
  159. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/annotations.py +0 -0
  160. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/asyncutils.py +0 -0
  161. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/callables.py +0 -0
  162. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/compat.py +0 -0
  163. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/context.py +0 -0
  164. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/dispatch.py +0 -0
  165. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/dockerutils.py +0 -0
  166. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/engine.py +0 -0
  167. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/filesystem.py +0 -0
  168. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/hashing.py +0 -0
  169. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/importtools.py +0 -0
  170. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/math.py +0 -0
  171. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/names.py +0 -0
  172. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/processutils.py +0 -0
  173. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/pydantic.py +0 -0
  174. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/render_swagger.py +0 -0
  175. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/schema_tools/__init__.py +0 -0
  176. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/schema_tools/hydration.py +0 -0
  177. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/schema_tools/validation.py +0 -0
  178. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/services.py +0 -0
  179. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/slugify.py +0 -0
  180. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/templating.py +0 -0
  181. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/text.py +0 -0
  182. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/timeout.py +0 -0
  183. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/utilities/visualization.py +0 -0
  184. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/variables.py +0 -0
  185. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/workers/__init__.py +0 -0
  186. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/workers/base.py +0 -0
  187. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/workers/process.py +0 -0
  188. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/workers/server.py +0 -0
  189. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect/workers/utilities.py +0 -0
  190. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  191. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/src/prefect_client.egg-info/top_level.txt +0 -0
  192. {prefect-client-3.0.0rc3 → prefect-client-3.0.0rc4}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-client
3
- Version: 3.0.0rc3
3
+ Version: 3.0.0rc4
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -21,8 +21,7 @@ pathspec >= 0.8.0
21
21
  pendulum >= 3.0.0, <4
22
22
  pydantic >= 2.7, < 3.0.0
23
23
  pydantic_core >= 2.12.0, < 3.0.0
24
- # Avoiding 2.8.1 due to https://github.com/pydantic/pydantic-extra-types/issues/188
25
- pydantic_extra_types > 2.7, != 2.8.1, < 3.0.0
24
+ pydantic_extra_types >= 2.8.2, < 3.0.0
26
25
  pydantic_settings
27
26
  python_dateutil >= 2.8.2, < 3.0.0
28
27
  python-slugify >= 5.0, < 9.0
@@ -22,7 +22,7 @@ pytest-benchmark
22
22
  pytest-env
23
23
  pytest-flakefinder
24
24
  pytest-timeout
25
- pytest-xdist < 3.4.0 # 3.5.0 introduces some flakiness. Need to investigate and resolve.
25
+ pytest-xdist >= 3.6.1
26
26
  pytkdocs >= 0.14.2
27
27
  pyyaml
28
28
  redis>=5.0.1
@@ -13,7 +13,6 @@ griffe >= 0.20.0
13
13
  jinja2 >= 3.0.0, < 4.0.0
14
14
  jinja2-humanize-extension >= 0.4.0
15
15
  humanize >= 4.9.0
16
- kubernetes >= 24.2.0, < 30.0.0
17
16
  pytz >= 2021.1, < 2025
18
17
  readchar >= 4.0.0, < 5.0.0
19
18
  sqlalchemy[asyncio] >= 2.0, < 3.0.0
@@ -43,7 +43,6 @@ import prefect.runtime
43
43
 
44
44
  # Import modules that register types
45
45
  import prefect.serializers
46
- import prefect.blocks.kubernetes
47
46
  import prefect.blocks.notifications
48
47
  import prefect.blocks.system
49
48
 
@@ -1,5 +1,5 @@
1
1
  import asyncio
2
- from typing import Any, Dict, Generic, List, Optional, Type, TypeVar
2
+ from typing import Any, Dict, Generic, Iterable, Optional, Type, TypeVar
3
3
 
4
4
  import orjson
5
5
  import websockets
@@ -21,7 +21,7 @@ class Subscription(Generic[S]):
21
21
  self,
22
22
  model: Type[S],
23
23
  path: str,
24
- keys: List[str],
24
+ keys: Iterable[str],
25
25
  client_id: Optional[str] = None,
26
26
  base_url: Optional[str] = None,
27
27
  ):
@@ -30,7 +30,7 @@ class Subscription(Generic[S]):
30
30
  base_url = base_url.replace("http", "ws", 1)
31
31
  self.subscription_url = f"{base_url}{path}"
32
32
 
33
- self.keys = keys
33
+ self.keys = list(keys)
34
34
 
35
35
  self._connect = websockets.connect(
36
36
  self.subscription_url,
@@ -6,6 +6,7 @@ from contextlib import ExitStack, contextmanager
6
6
  from dataclasses import dataclass, field
7
7
  from typing import (
8
8
  Any,
9
+ AsyncGenerator,
9
10
  Callable,
10
11
  Coroutine,
11
12
  Dict,
@@ -50,12 +51,13 @@ from prefect.states import (
50
51
  return_value_to_state,
51
52
  )
52
53
  from prefect.utilities.asyncutils import run_coro_as_sync
53
- from prefect.utilities.callables import call_with_parameters
54
+ from prefect.utilities.callables import call_with_parameters, parameters_to_args_kwargs
54
55
  from prefect.utilities.collections import visit_collection
55
56
  from prefect.utilities.engine import (
56
57
  _get_hook_name,
57
58
  _resolve_custom_flow_run_name,
58
59
  capture_sigterm,
60
+ link_state_to_result,
59
61
  propose_state_sync,
60
62
  resolve_to_final_result,
61
63
  )
@@ -632,6 +634,80 @@ async def run_flow_async(
632
634
  return engine.state if return_type == "state" else engine.result()
633
635
 
634
636
 
637
+ def run_generator_flow_sync(
638
+ flow: Flow[P, R],
639
+ flow_run: Optional[FlowRun] = None,
640
+ parameters: Optional[Dict[str, Any]] = None,
641
+ wait_for: Optional[Iterable[PrefectFuture]] = None,
642
+ return_type: Literal["state", "result"] = "result",
643
+ ) -> Generator[R, None, None]:
644
+ if return_type != "result":
645
+ raise ValueError("The return_type for a generator flow must be 'result'")
646
+
647
+ engine = FlowRunEngine[P, R](
648
+ flow=flow, parameters=parameters, flow_run=flow_run, wait_for=wait_for
649
+ )
650
+
651
+ with engine.start():
652
+ while engine.is_running():
653
+ with engine.run_context():
654
+ call_args, call_kwargs = parameters_to_args_kwargs(
655
+ flow.fn, engine.parameters or {}
656
+ )
657
+ gen = flow.fn(*call_args, **call_kwargs)
658
+ try:
659
+ while True:
660
+ gen_result = next(gen)
661
+ # link the current state to the result for dependency tracking
662
+ link_state_to_result(engine.state, gen_result)
663
+ yield gen_result
664
+ except StopIteration as exc:
665
+ engine.handle_success(exc.value)
666
+ except GeneratorExit as exc:
667
+ engine.handle_success(None)
668
+ gen.throw(exc)
669
+
670
+ return engine.result()
671
+
672
+
673
+ async def run_generator_flow_async(
674
+ flow: Flow[P, R],
675
+ flow_run: Optional[FlowRun] = None,
676
+ parameters: Optional[Dict[str, Any]] = None,
677
+ wait_for: Optional[Iterable[PrefectFuture]] = None,
678
+ return_type: Literal["state", "result"] = "result",
679
+ ) -> AsyncGenerator[R, None]:
680
+ if return_type != "result":
681
+ raise ValueError("The return_type for a generator flow must be 'result'")
682
+
683
+ engine = FlowRunEngine[P, R](
684
+ flow=flow, parameters=parameters, flow_run=flow_run, wait_for=wait_for
685
+ )
686
+
687
+ with engine.start():
688
+ while engine.is_running():
689
+ with engine.run_context():
690
+ call_args, call_kwargs = parameters_to_args_kwargs(
691
+ flow.fn, engine.parameters or {}
692
+ )
693
+ gen = flow.fn(*call_args, **call_kwargs)
694
+ try:
695
+ while True:
696
+ # can't use anext in Python < 3.10
697
+ gen_result = await gen.__anext__()
698
+ # link the current state to the result for dependency tracking
699
+ link_state_to_result(engine.state, gen_result)
700
+ yield gen_result
701
+ except (StopAsyncIteration, GeneratorExit) as exc:
702
+ engine.handle_success(None)
703
+ if isinstance(exc, GeneratorExit):
704
+ gen.throw(exc)
705
+
706
+ # async generators can't return, but we can raise failures here
707
+ if engine.state.is_failed():
708
+ engine.result()
709
+
710
+
635
711
  def run_flow(
636
712
  flow: Flow[P, R],
637
713
  flow_run: Optional[FlowRun] = None,
@@ -646,7 +722,11 @@ def run_flow(
646
722
  wait_for=wait_for,
647
723
  return_type=return_type,
648
724
  )
649
- if flow.isasync:
725
+ if flow.isasync and flow.isgenerator:
726
+ return run_generator_flow_async(**kwargs)
727
+ elif flow.isgenerator:
728
+ return run_generator_flow_sync(**kwargs)
729
+ elif flow.isasync:
650
730
  return run_flow_async(**kwargs)
651
731
  else:
652
732
  return run_flow_sync(**kwargs)
@@ -89,7 +89,6 @@ from prefect.task_runners import TaskRunner, ThreadPoolTaskRunner
89
89
  from prefect.types import BANNED_CHARACTERS, WITHOUT_BANNED_CHARACTERS
90
90
  from prefect.utilities.annotations import NotSet
91
91
  from prefect.utilities.asyncutils import (
92
- is_async_fn,
93
92
  run_sync_in_worker_thread,
94
93
  sync_compatible,
95
94
  )
@@ -289,7 +288,18 @@ class Flow(Generic[P, R]):
289
288
  self.description = description or inspect.getdoc(fn)
290
289
  update_wrapper(self, fn)
291
290
  self.fn = fn
292
- self.isasync = is_async_fn(self.fn)
291
+
292
+ # the flow is considered async if its function is async or an async
293
+ # generator
294
+ self.isasync = inspect.iscoroutinefunction(
295
+ self.fn
296
+ ) or inspect.isasyncgenfunction(self.fn)
297
+
298
+ # the flow is considered a generator if its function is a generator or
299
+ # an async generator
300
+ self.isgenerator = inspect.isgeneratorfunction(
301
+ self.fn
302
+ ) or inspect.isasyncgenfunction(self.fn)
293
303
 
294
304
  raise_for_reserved_arguments(self.fn, ["return_state", "wait_for"])
295
305
 
@@ -56,7 +56,7 @@ class PrefectFuture(abc.ABC):
56
56
  def wait(self, timeout: Optional[float] = None) -> None:
57
57
  ...
58
58
  """
59
- Wait for the task run to complete.
59
+ Wait for the task run to complete.
60
60
 
61
61
  If the task run has already completed, this method will return immediately.
62
62
 
@@ -163,6 +163,10 @@ class PrefectDistributedFuture(PrefectFuture):
163
163
  )
164
164
  return
165
165
 
166
+ # Ask for the instance of TaskRunWaiter _now_ so that it's already running and
167
+ # can catch the completion event if it happens before we start listening for it.
168
+ TaskRunWaiter.instance()
169
+
166
170
  # Read task run to see if it is still running
167
171
  async with get_client() as client:
168
172
  task_run = await client.read_task_run(task_run_id=self._task_run_id)
@@ -245,6 +249,10 @@ def resolve_futures_to_states(
245
249
  context={},
246
250
  )
247
251
 
252
+ # if no futures were found, return the original expression
253
+ if not futures:
254
+ return expr
255
+
248
256
  # Get final states for each future
249
257
  states = []
250
258
  for future in futures:
@@ -38,7 +38,6 @@ from prefect.settings import (
38
38
  PREFECT_RESULTS_DEFAULT_SERIALIZER,
39
39
  PREFECT_RESULTS_PERSIST_BY_DEFAULT,
40
40
  PREFECT_TASK_SCHEDULING_DEFAULT_STORAGE_BLOCK,
41
- default_result_storage_block_name,
42
41
  )
43
42
  from prefect.utilities.annotations import NotSet
44
43
  from prefect.utilities.asyncutils import sync_compatible
@@ -62,35 +61,15 @@ logger = get_logger("results")
62
61
  P = ParamSpec("P")
63
62
  R = TypeVar("R")
64
63
 
65
-
66
- @sync_compatible
67
- async def get_default_result_storage() -> ResultStorage:
68
- """
69
- Generate a default file system for result storage.
70
- """
71
- try:
72
- return await Block.load(PREFECT_DEFAULT_RESULT_STORAGE_BLOCK.value())
73
- except ValueError as e:
74
- if "Unable to find" not in str(e):
75
- raise e
76
- elif (
77
- PREFECT_DEFAULT_RESULT_STORAGE_BLOCK.value()
78
- == default_result_storage_block_name()
79
- ):
80
- return LocalFileSystem(basepath=PREFECT_LOCAL_STORAGE_PATH.value())
81
- else:
82
- raise
64
+ _default_storages: Dict[Tuple[str, str], WritableFileSystem] = {}
83
65
 
84
66
 
85
- _default_task_scheduling_storages: Dict[Tuple[str, str], WritableFileSystem] = {}
86
-
87
-
88
- async def get_or_create_default_task_scheduling_storage() -> ResultStorage:
67
+ async def _get_or_create_default_storage(block_document_slug: str) -> ResultStorage:
89
68
  """
90
- Generate a default file system for background task parameter/result storage.
69
+ Generate a default file system for storage.
91
70
  """
92
71
  default_storage_name, storage_path = cache_key = (
93
- PREFECT_TASK_SCHEDULING_DEFAULT_STORAGE_BLOCK.value(),
72
+ block_document_slug,
94
73
  PREFECT_LOCAL_STORAGE_PATH.value(),
95
74
  )
96
75
 
@@ -105,8 +84,8 @@ async def get_or_create_default_task_scheduling_storage() -> ResultStorage:
105
84
  if block_type_slug == "local-file-system":
106
85
  block = LocalFileSystem(basepath=storage_path)
107
86
  else:
108
- raise Exception(
109
- "The default task storage block does not exist, but it is of type "
87
+ raise ValueError(
88
+ "The default storage block does not exist, but it is of type "
110
89
  f"'{block_type_slug}' which cannot be created implicitly. Please create "
111
90
  "the block manually."
112
91
  )
@@ -123,13 +102,32 @@ async def get_or_create_default_task_scheduling_storage() -> ResultStorage:
123
102
  return block
124
103
 
125
104
  try:
126
- return _default_task_scheduling_storages[cache_key]
105
+ return _default_storages[cache_key]
127
106
  except KeyError:
128
107
  storage = await get_storage()
129
- _default_task_scheduling_storages[cache_key] = storage
108
+ _default_storages[cache_key] = storage
130
109
  return storage
131
110
 
132
111
 
112
+ @sync_compatible
113
+ async def get_or_create_default_result_storage() -> ResultStorage:
114
+ """
115
+ Generate a default file system for result storage.
116
+ """
117
+ return await _get_or_create_default_storage(
118
+ PREFECT_DEFAULT_RESULT_STORAGE_BLOCK.value()
119
+ )
120
+
121
+
122
+ async def get_or_create_default_task_scheduling_storage() -> ResultStorage:
123
+ """
124
+ Generate a default file system for background task parameter/result storage.
125
+ """
126
+ return await _get_or_create_default_storage(
127
+ PREFECT_TASK_SCHEDULING_DEFAULT_STORAGE_BLOCK.value()
128
+ )
129
+
130
+
133
131
  def get_default_result_serializer() -> ResultSerializer:
134
132
  """
135
133
  Generate a default file system for result storage.
@@ -210,7 +208,9 @@ class ResultFactory(BaseModel):
210
208
  kwargs.pop(key)
211
209
 
212
210
  # Apply defaults
213
- kwargs.setdefault("result_storage", await get_default_result_storage())
211
+ kwargs.setdefault(
212
+ "result_storage", await get_or_create_default_result_storage()
213
+ )
214
214
  kwargs.setdefault("result_serializer", get_default_result_serializer())
215
215
  kwargs.setdefault("persist_result", get_default_persist_setting())
216
216
  kwargs.setdefault("cache_result_in_memory", True)
@@ -280,7 +280,9 @@ class ResultFactory(BaseModel):
280
280
  """
281
281
  Create a new result factory for a task.
282
282
  """
283
- return await cls._from_task(task, get_default_result_storage, client=client)
283
+ return await cls._from_task(
284
+ task, get_or_create_default_result_storage, client=client
285
+ )
284
286
 
285
287
  @classmethod
286
288
  @inject_client
@@ -1541,7 +1541,7 @@ The maximum number of retries to queue for submission.
1541
1541
 
1542
1542
  PREFECT_TASK_SCHEDULING_PENDING_TASK_TIMEOUT = Setting(
1543
1543
  timedelta,
1544
- default=timedelta(seconds=30),
1544
+ default=timedelta(0),
1545
1545
  )
1546
1546
  """
1547
1547
  How long before a PENDING task are made available to another task worker. In practice,
@@ -417,9 +417,7 @@ class TaskRunEngine(Generic[P, R]):
417
417
  log_prints=log_prints,
418
418
  task_run=self.task_run,
419
419
  parameters=self.parameters,
420
- result_factory=run_coro_as_sync(
421
- ResultFactory.from_autonomous_task(self.task)
422
- ), # type: ignore
420
+ result_factory=run_coro_as_sync(ResultFactory.from_task(self.task)), # type: ignore
423
421
  client=client,
424
422
  )
425
423
  )
@@ -467,9 +465,6 @@ class TaskRunEngine(Generic[P, R]):
467
465
  extra_task_inputs=dependencies,
468
466
  )
469
467
  )
470
- self.logger.info(
471
- f"Created task run {self.task_run.name!r} for task {self.task.name!r}"
472
- )
473
468
  # Emit an event to capture that the task run was in the `PENDING` state.
474
469
  self._last_event = emit_task_run_state_change_event(
475
470
  task_run=self.task_run,
@@ -478,6 +473,10 @@ class TaskRunEngine(Generic[P, R]):
478
473
  )
479
474
 
480
475
  with self.setup_run_context():
476
+ # setup_run_context might update the task run name, so log creation here
477
+ self.logger.info(
478
+ f"Created task run {self.task_run.name!r} for task {self.task.name!r}"
479
+ )
481
480
  yield self
482
481
 
483
482
  except Exception:
@@ -92,13 +92,18 @@ class TaskRunWaiter:
92
92
  raise RuntimeError("TaskRunWaiter must run on the global loop thread.")
93
93
 
94
94
  self._loop = loop_thread._loop
95
- self._consumer_task = self._loop.create_task(self._consume_events())
95
+
96
+ consumer_started = asyncio.Event()
97
+ self._consumer_task = self._loop.create_task(
98
+ self._consume_events(consumer_started)
99
+ )
100
+ asyncio.run_coroutine_threadsafe(consumer_started.wait(), self._loop)
96
101
 
97
102
  loop_thread.add_shutdown_call(create_call(self.stop))
98
103
  atexit.register(self.stop)
99
104
  self._started = True
100
105
 
101
- async def _consume_events(self):
106
+ async def _consume_events(self, consumer_started: asyncio.Event):
102
107
  async with get_events_subscriber(
103
108
  filter=EventFilter(
104
109
  event=EventNameFilter(
@@ -109,6 +114,7 @@ class TaskRunWaiter:
109
114
  )
110
115
  )
111
116
  ) as subscriber:
117
+ consumer_started.set()
112
118
  async for event in subscriber:
113
119
  try:
114
120
  self.logger.debug(
@@ -119,6 +125,7 @@ class TaskRunWaiter:
119
125
  "prefect.task-run.", ""
120
126
  )
121
127
  )
128
+
122
129
  with self._observed_completed_task_runs_lock:
123
130
  # Cache the task run ID for a short period of time to avoid
124
131
  # unnecessary waits
@@ -172,14 +179,21 @@ class TaskRunWaiter:
172
179
  # when the event is received
173
180
  instance._completion_events[task_run_id] = finished_event
174
181
 
175
- with anyio.move_on_after(delay=timeout):
176
- await from_async.wait_for_call_in_loop_thread(
177
- create_call(finished_event.wait)
178
- )
182
+ try:
183
+ # Now check one more time whether the task run arrived before we start to
184
+ # wait on it, in case it came in while we were setting up the event above.
185
+ with instance._observed_completed_task_runs_lock:
186
+ if task_run_id in instance._observed_completed_task_runs:
187
+ return
179
188
 
180
- with instance._completion_events_lock:
181
- # Remove the event from the cache after it has been waited on
182
- instance._completion_events.pop(task_run_id, None)
189
+ with anyio.move_on_after(delay=timeout):
190
+ await from_async.wait_for_call_in_loop_thread(
191
+ create_call(finished_event.wait)
192
+ )
193
+ finally:
194
+ with instance._completion_events_lock:
195
+ # Remove the event from the cache after it has been waited on
196
+ instance._completion_events.pop(task_run_id, None)
183
197
 
184
198
  @classmethod
185
199
  def instance(cls):