prefect-client 3.0.0rc8__tar.gz → 3.0.0rc9__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 (198) hide show
  1. {prefect-client-3.0.0rc8/src/prefect_client.egg-info → prefect-client-3.0.0rc9}/PKG-INFO +1 -1
  2. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/requirements-client.txt +1 -0
  3. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/requirements-dev.txt +1 -6
  4. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/compatibility/deprecated.py +53 -0
  5. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/compatibility/migration.py +8 -6
  6. prefect-client-3.0.0rc9/src/prefect/_internal/integrations.py +7 -0
  7. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/blocks/core.py +1 -1
  8. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/__init__.py +4 -0
  9. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/schemas/objects.py +4 -0
  10. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/utilities.py +4 -4
  11. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/steps/core.py +6 -0
  12. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/engine.py +4 -4
  13. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/flow_engine.py +30 -7
  14. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/flow_runs.py +1 -1
  15. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/flows.py +17 -11
  16. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/futures.py +5 -0
  17. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/logging/loggers.py +1 -1
  18. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/results.py +35 -1
  19. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/settings.py +1 -1
  20. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/task_engine.py +1 -0
  21. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/task_worker.py +13 -2
  22. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/tasks.py +9 -2
  23. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/transactions.py +39 -1
  24. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/asyncutils.py +29 -5
  25. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/collections.py +1 -1
  26. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9/src/prefect_client.egg-info}/PKG-INFO +1 -1
  27. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect_client.egg-info/SOURCES.txt +1 -0
  28. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect_client.egg-info/requires.txt +1 -0
  29. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/LICENSE +0 -0
  30. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/MANIFEST.in +0 -0
  31. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/README.md +0 -0
  32. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/requirements.txt +0 -0
  33. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/setup.cfg +0 -0
  34. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/setup.py +0 -0
  35. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/.prefectignore +0 -0
  36. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/__init__.py +0 -0
  37. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/__init__.py +0 -0
  38. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/_logging.py +0 -0
  39. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/compatibility/__init__.py +0 -0
  40. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/compatibility/experimental.py +0 -0
  41. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/__init__.py +0 -0
  42. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/api.py +0 -0
  43. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/calls.py +0 -0
  44. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  45. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  46. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/inspection.py +0 -0
  47. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/primitives.py +0 -0
  48. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/services.py +0 -0
  49. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/threads.py +0 -0
  50. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/concurrency/waiters.py +0 -0
  51. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/pydantic/__init__.py +0 -0
  52. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  53. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
  54. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/pydantic/schemas.py +0 -0
  55. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
  56. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
  57. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  58. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/pytz.py +0 -0
  59. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/schemas/__init__.py +0 -0
  60. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/schemas/bases.py +0 -0
  61. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/schemas/fields.py +0 -0
  62. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/schemas/serializers.py +0 -0
  63. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_internal/schemas/validators.py +0 -0
  64. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/_version.py +0 -0
  65. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/artifacts.py +0 -0
  66. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/automations.py +0 -0
  67. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/blocks/__init__.py +0 -0
  68. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/blocks/abstract.py +0 -0
  69. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/blocks/fields.py +0 -0
  70. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/blocks/notifications.py +0 -0
  71. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/blocks/redis.py +0 -0
  72. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/blocks/system.py +0 -0
  73. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/blocks/webhook.py +0 -0
  74. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/cache_policies.py +0 -0
  75. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/base.py +0 -0
  76. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/cloud.py +0 -0
  77. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/collections.py +0 -0
  78. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/constants.py +0 -0
  79. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/orchestration.py +0 -0
  80. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/schemas/__init__.py +0 -0
  81. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/schemas/actions.py +0 -0
  82. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/schemas/filters.py +0 -0
  83. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/schemas/responses.py +0 -0
  84. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/schemas/schedules.py +0 -0
  85. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/schemas/sorting.py +0 -0
  86. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/subscriptions.py +0 -0
  87. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/types/__init__.py +0 -0
  88. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/client/types/flexible_schedule_list.py +0 -0
  89. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/concurrency/__init__.py +0 -0
  90. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/concurrency/asyncio.py +0 -0
  91. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/concurrency/events.py +0 -0
  92. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/concurrency/services.py +0 -0
  93. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/concurrency/sync.py +0 -0
  94. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/context.py +0 -0
  95. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/__init__.py +0 -0
  96. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/base.py +0 -0
  97. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/deployments.py +0 -0
  98. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/flow_runs.py +0 -0
  99. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/runner.py +0 -0
  100. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/schedules.py +0 -0
  101. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/steps/__init__.py +0 -0
  102. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/steps/pull.py +0 -0
  103. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/deployments/steps/utility.py +0 -0
  104. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/docker/__init__.py +0 -0
  105. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/docker/docker_image.py +0 -0
  106. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/__init__.py +0 -0
  107. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/actions.py +0 -0
  108. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/cli/__init__.py +0 -0
  109. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/cli/automations.py +0 -0
  110. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/clients.py +0 -0
  111. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/filters.py +0 -0
  112. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/related.py +0 -0
  113. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/schemas/__init__.py +0 -0
  114. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/schemas/automations.py +0 -0
  115. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/schemas/deployment_triggers.py +0 -0
  116. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/schemas/events.py +0 -0
  117. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/schemas/labelling.py +0 -0
  118. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/utilities.py +0 -0
  119. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/events/worker.py +0 -0
  120. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/exceptions.py +0 -0
  121. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/filesystems.py +0 -0
  122. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/infrastructure/__init__.py +0 -0
  123. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  124. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  125. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  126. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  127. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  128. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/input/__init__.py +0 -0
  129. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/input/actions.py +0 -0
  130. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/input/run_input.py +0 -0
  131. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/logging/__init__.py +0 -0
  132. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/logging/configuration.py +0 -0
  133. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/logging/filters.py +0 -0
  134. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/logging/formatters.py +0 -0
  135. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/logging/handlers.py +0 -0
  136. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/logging/highlighters.py +0 -0
  137. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/logging/logging.yml +0 -0
  138. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/main.py +0 -0
  139. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/manifests.py +0 -0
  140. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/plugins.py +0 -0
  141. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/profiles.toml +0 -0
  142. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/py.typed +0 -0
  143. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/records/__init__.py +0 -0
  144. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/records/result_store.py +0 -0
  145. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/records/store.py +0 -0
  146. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runner/__init__.py +0 -0
  147. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runner/runner.py +0 -0
  148. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runner/server.py +0 -0
  149. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runner/storage.py +0 -0
  150. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runner/submit.py +0 -0
  151. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runner/utils.py +0 -0
  152. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runtime/__init__.py +0 -0
  153. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runtime/deployment.py +0 -0
  154. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runtime/flow_run.py +0 -0
  155. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/runtime/task_run.py +0 -0
  156. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/serializers.py +0 -0
  157. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
  158. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  159. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/states.py +0 -0
  160. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/task_runners.py +0 -0
  161. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/task_runs.py +0 -0
  162. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/types/__init__.py +0 -0
  163. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/types/entrypoint.py +0 -0
  164. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/__init__.py +0 -0
  165. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/annotations.py +0 -0
  166. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/callables.py +0 -0
  167. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/compat.py +0 -0
  168. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/context.py +0 -0
  169. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/dispatch.py +0 -0
  170. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/dockerutils.py +0 -0
  171. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/engine.py +0 -0
  172. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/filesystem.py +0 -0
  173. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/hashing.py +0 -0
  174. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/importtools.py +0 -0
  175. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/math.py +0 -0
  176. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/names.py +0 -0
  177. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/processutils.py +0 -0
  178. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/pydantic.py +0 -0
  179. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/render_swagger.py +0 -0
  180. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/schema_tools/__init__.py +0 -0
  181. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/schema_tools/hydration.py +0 -0
  182. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/schema_tools/validation.py +0 -0
  183. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/services.py +0 -0
  184. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/slugify.py +0 -0
  185. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/templating.py +0 -0
  186. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/text.py +0 -0
  187. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/timeout.py +0 -0
  188. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/urls.py +0 -0
  189. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/utilities/visualization.py +0 -0
  190. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/variables.py +0 -0
  191. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/workers/__init__.py +0 -0
  192. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/workers/base.py +0 -0
  193. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/workers/process.py +0 -0
  194. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/workers/server.py +0 -0
  195. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect/workers/utilities.py +0 -0
  196. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  197. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/src/prefect_client.egg-info/top_level.txt +0 -0
  198. {prefect-client-3.0.0rc8 → prefect-client-3.0.0rc9}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-client
3
- Version: 3.0.0rc8
3
+ Version: 3.0.0rc9
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -35,3 +35,4 @@ typing_extensions >= 4.5.0, < 5.0.0
35
35
  ujson >= 5.8.0, < 6.0.0
36
36
  uvicorn >= 0.14.0, < 0.29.0
37
37
  websockets >= 10.4, < 13.0
38
+ wrapt >= 1.16.0
@@ -4,11 +4,6 @@ codespell>=2.2.6
4
4
  ddtrace
5
5
  ipython
6
6
  jinja2
7
- mkdocs
8
- mkdocs-gen-files
9
- mkdocs-material
10
- mkdocstrings-python
11
- mike
12
7
  moto >= 5
13
8
  mypy >= 1.9.0
14
9
  numpy
@@ -23,7 +18,6 @@ pytest-env
23
18
  pytest-flakefinder
24
19
  pytest-timeout
25
20
  pytest-xdist >= 3.6.1
26
- pytkdocs >= 0.14.2
27
21
  pyyaml
28
22
  redis>=5.0.1
29
23
  setuptools
@@ -40,3 +34,4 @@ types-PyYAML
40
34
  mkdocs
41
35
  mkdocs-material
42
36
  mkdocstrings[python]
37
+ mkdocs-gen-files
@@ -16,6 +16,7 @@ import warnings
16
16
  from typing import Any, Callable, List, Optional, Type, TypeVar
17
17
 
18
18
  import pendulum
19
+ import wrapt
19
20
  from pydantic import BaseModel
20
21
 
21
22
  from prefect.utilities.callables import get_call_parameters
@@ -272,3 +273,55 @@ def register_renamed_module(old_name: str, new_name: str, start_date: str):
272
273
  DEPRECATED_MODULE_ALIASES.append(
273
274
  AliasedModuleDefinition(old_name, new_name, callback)
274
275
  )
276
+
277
+
278
+ class AsyncCompatProxy(wrapt.ObjectProxy):
279
+ """
280
+ A proxy object that allows for awaiting a method that is no longer async.
281
+
282
+ See https://wrapt.readthedocs.io/en/master/wrappers.html#object-proxy for more
283
+ """
284
+
285
+ def __init__(self, wrapped, class_name: str, method_name: str):
286
+ super().__init__(wrapped)
287
+ self._self_class_name = class_name
288
+ self._self_method_name = method_name
289
+ self._self_already_awaited = False
290
+
291
+ def __await__(self):
292
+ if not self._self_already_awaited:
293
+ warnings.warn(
294
+ (
295
+ f"The {self._self_method_name!r} method on {self._self_class_name!r}"
296
+ " is no longer async and awaiting it will raise an error after Dec 2024"
297
+ " - please remove the `await` keyword."
298
+ ),
299
+ DeprecationWarning,
300
+ stacklevel=2,
301
+ )
302
+ self._self_already_awaited = True
303
+ yield
304
+ return self.__wrapped__
305
+
306
+ def __repr__(self):
307
+ return repr(self.__wrapped__)
308
+
309
+ def __reduce_ex__(self, protocol):
310
+ return (
311
+ type(self),
312
+ (self.__wrapped__,),
313
+ {"_self_already_awaited": self._self_already_awaited},
314
+ )
315
+
316
+
317
+ def deprecated_async_method(wrapped):
318
+ """Decorator that wraps a sync method to allow awaiting it even though it is no longer async."""
319
+
320
+ @wrapt.decorator
321
+ def wrapper(wrapped, instance, args, kwargs):
322
+ result = wrapped(*args, **kwargs)
323
+ return AsyncCompatProxy(
324
+ result, class_name=instance.__class__.__name__, method_name=wrapped.__name__
325
+ )
326
+
327
+ return wrapper(wrapped)
@@ -27,15 +27,17 @@ MOVED_IN_V3 = {
27
27
  "prefect.engine:resume_flow_run": "prefect.flow_runs:resume_flow_run",
28
28
  "prefect.engine:suspend_flow_run": "prefect.flow_runs:suspend_flow_run",
29
29
  "prefect.engine:_in_process_pause": "prefect.flow_runs:_in_process_pause",
30
+ "prefect.client:get_client": "prefect.client.orchestration:get_client",
30
31
  }
31
32
 
32
33
  REMOVED_IN_V3 = {
33
- "prefect.deployments.deployments:Deployment": "Use 'flow.serve()', `flow.deploy()`, or `prefect deploy` instead.",
34
- "prefect.deployments:Deployment": "Use 'flow.serve()', `flow.deploy()`, or `prefect deploy` instead.",
35
- "prefect.filesystems:GCS": "Use 'prefect_gcp' instead.",
36
- "prefect.filesystems:Azure": "Use 'prefect_azure' instead.",
37
- "prefect.filesystems:S3": "Use 'prefect_aws' instead.",
38
- "prefect.engine:_out_of_process_pause": "Use 'prefect.flow_runs.pause_flow_run' instead.",
34
+ "prefect.client.schemas.objects:MinimalDeploymentSchedule": "Use `prefect.client.schemas.actions.DeploymentScheduleCreate` instead.",
35
+ "prefect.deployments.deployments:Deployment": "Use `flow.serve()`, `flow.deploy()`, or `prefect deploy` instead.",
36
+ "prefect.deployments:Deployment": "Use `flow.serve()`, `flow.deploy()`, or `prefect deploy` instead.",
37
+ "prefect.filesystems:GCS": "Use `prefect_gcp` instead.",
38
+ "prefect.filesystems:Azure": "Use `prefect_azure` instead.",
39
+ "prefect.filesystems:S3": "Use `prefect_aws` instead.",
40
+ "prefect.engine:_out_of_process_pause": "Use `prefect.flow_runs.pause_flow_run` instead.",
39
41
  }
40
42
 
41
43
  # IMPORTANT FOR USAGE: When adding new modules to MOVED_IN_V3 or REMOVED_IN_V3, include the following lines at the bottom of that module:
@@ -0,0 +1,7 @@
1
+ KNOWN_EXTRAS_FOR_PACKAGES = {
2
+ "prefect-kubernetes": "prefect[kubernetes]",
3
+ "prefect-aws": "prefect[aws]",
4
+ "prefect-gcp": "prefect[gcp]",
5
+ "prefect-azure": "prefect[azure]",
6
+ "prefect-docker": "prefect[docker]",
7
+ }
@@ -798,7 +798,7 @@ class Block(BaseModel, ABC):
798
798
  name: str,
799
799
  validate: bool = True,
800
800
  client: Optional["PrefectClient"] = None,
801
- ):
801
+ ) -> "Self":
802
802
  """
803
803
  Retrieves data from the block document with the given name for the block type
804
804
  that corresponds with the current class and returns an instantiated version of
@@ -15,3 +15,7 @@ $ python -m asyncio
15
15
  ```
16
16
  </div>
17
17
  """
18
+
19
+ from prefect._internal.compatibility.migration import getattr_migration
20
+
21
+ __getattr__ = getattr_migration(__name__)
@@ -28,6 +28,7 @@ from pydantic import (
28
28
  from pydantic_extra_types.pendulum_dt import DateTime
29
29
  from typing_extensions import Literal, Self
30
30
 
31
+ from prefect._internal.compatibility.migration import getattr_migration
31
32
  from prefect._internal.schemas.bases import ObjectBaseModel, PrefectBaseModel
32
33
  from prefect._internal.schemas.fields import CreatedBy, UpdatedBy
33
34
  from prefect._internal.schemas.validators import (
@@ -1604,3 +1605,6 @@ class CsrfToken(ObjectBaseModel):
1604
1605
  expiration: datetime.datetime = Field(
1605
1606
  default=..., description="The expiration time of the CSRF token"
1606
1607
  )
1608
+
1609
+
1610
+ __getattr__ = getattr_migration(__name__)
@@ -78,10 +78,10 @@ def client_injector(
78
78
 
79
79
 
80
80
  def inject_client(
81
- fn: Callable[P, Coroutine[Any, Any, Any]],
82
- ) -> Callable[P, Coroutine[Any, Any, Any]]:
81
+ fn: Callable[P, Coroutine[Any, Any, R]],
82
+ ) -> Callable[P, Coroutine[Any, Any, R]]:
83
83
  """
84
- Simple helper to provide a context managed client to a asynchronous function.
84
+ Simple helper to provide a context managed client to an asynchronous function.
85
85
 
86
86
  The decorated function _must_ take a `client` kwarg and if a client is passed when
87
87
  called it will be used instead of creating a new one, but it will not be context
@@ -89,7 +89,7 @@ def inject_client(
89
89
  """
90
90
 
91
91
  @wraps(fn)
92
- async def with_injected_client(*args: P.args, **kwargs: P.kwargs) -> Any:
92
+ async def with_injected_client(*args: P.args, **kwargs: P.kwargs) -> R:
93
93
  client = cast(Optional["PrefectClient"], kwargs.pop("client", None))
94
94
  client, inferred = get_or_create_client(client)
95
95
  if not inferred:
@@ -22,6 +22,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union
22
22
 
23
23
  from prefect._internal.compatibility.deprecated import PrefectDeprecationWarning
24
24
  from prefect._internal.concurrency.api import Call, from_async
25
+ from prefect._internal.integrations import KNOWN_EXTRAS_FOR_PACKAGES
25
26
  from prefect.logging.loggers import get_logger
26
27
  from prefect.settings import PREFECT_DEBUG_MODE
27
28
  from prefect.utilities.importtools import import_object
@@ -84,6 +85,11 @@ def _get_function_for_step(
84
85
  raise
85
86
 
86
87
  try:
88
+ packages = [
89
+ KNOWN_EXTRAS_FOR_PACKAGES.get(package, package)
90
+ for package in packages
91
+ if package
92
+ ]
87
93
  subprocess.check_call([sys.executable, "-m", "pip", "install", *packages])
88
94
  except subprocess.CalledProcessError:
89
95
  get_logger("deployments.steps.core").warning(
@@ -31,16 +31,16 @@ if __name__ == "__main__":
31
31
  try:
32
32
  from prefect.flow_engine import (
33
33
  load_flow_and_flow_run,
34
- run_flow_async,
35
- run_flow_sync,
34
+ run_flow,
36
35
  )
37
36
 
38
37
  flow_run, flow = load_flow_and_flow_run(flow_run_id=flow_run_id)
39
38
  # run the flow
40
39
  if flow.isasync:
41
- run_coro_as_sync(run_flow_async(flow, flow_run=flow_run))
40
+ run_coro_as_sync(run_flow(flow, flow_run=flow_run))
42
41
  else:
43
- run_flow_sync(flow, flow_run=flow_run)
42
+ run_flow(flow, flow_run=flow_run)
43
+
44
44
  except Abort as exc:
45
45
  engine_logger.info(
46
46
  f"Engine execution of flow run '{flow_run_id}' aborted by orchestrator:"
@@ -51,7 +51,11 @@ from prefect.states import (
51
51
  return_value_to_state,
52
52
  )
53
53
  from prefect.utilities.asyncutils import run_coro_as_sync
54
- from prefect.utilities.callables import call_with_parameters, parameters_to_args_kwargs
54
+ from prefect.utilities.callables import (
55
+ call_with_parameters,
56
+ get_call_parameters,
57
+ parameters_to_args_kwargs,
58
+ )
55
59
  from prefect.utilities.collections import visit_collection
56
60
  from prefect.utilities.engine import (
57
61
  _get_hook_name,
@@ -595,10 +599,11 @@ def run_flow_sync(
595
599
  wait_for: Optional[Iterable[PrefectFuture]] = None,
596
600
  return_type: Literal["state", "result"] = "result",
597
601
  ) -> Union[R, State, None]:
598
- parameters = flow_run.parameters if flow_run else parameters
599
-
600
602
  engine = FlowRunEngine[P, R](
601
- flow=flow, parameters=parameters, flow_run=flow_run, wait_for=wait_for
603
+ flow=flow,
604
+ parameters=parameters,
605
+ flow_run=flow_run,
606
+ wait_for=wait_for,
602
607
  )
603
608
 
604
609
  with engine.start():
@@ -616,8 +621,6 @@ async def run_flow_async(
616
621
  wait_for: Optional[Iterable[PrefectFuture]] = None,
617
622
  return_type: Literal["state", "result"] = "result",
618
623
  ) -> Union[R, State, None]:
619
- parameters = flow_run.parameters if flow_run else parameters
620
-
621
624
  engine = FlowRunEngine[P, R](
622
625
  flow=flow, parameters=parameters, flow_run=flow_run, wait_for=wait_for
623
626
  )
@@ -714,10 +717,13 @@ def run_flow(
714
717
  kwargs = dict(
715
718
  flow=flow,
716
719
  flow_run=flow_run,
717
- parameters=parameters,
720
+ parameters=_flow_parameters(
721
+ flow=flow, flow_run=flow_run, parameters=parameters
722
+ ),
718
723
  wait_for=wait_for,
719
724
  return_type=return_type,
720
725
  )
726
+
721
727
  if flow.isasync and flow.isgenerator:
722
728
  return run_generator_flow_async(**kwargs)
723
729
  elif flow.isgenerator:
@@ -726,3 +732,20 @@ def run_flow(
726
732
  return run_flow_async(**kwargs)
727
733
  else:
728
734
  return run_flow_sync(**kwargs)
735
+
736
+
737
+ def _flow_parameters(
738
+ flow: Flow[P, R], flow_run: Optional[FlowRun], parameters: Optional[Dict[str, Any]]
739
+ ) -> Dict[str, Any]:
740
+ if parameters:
741
+ # This path is taken when a flow is being called directly with
742
+ # parameters, in that case just return the parameters as-is.
743
+ return parameters
744
+
745
+ # Otherwise the flow is being executed indirectly and we may need to grab
746
+ # the parameters from the flow run. We also need to resolve any default
747
+ # parameters that are defined on the flow function itself.
748
+
749
+ parameters = flow_run.parameters if flow_run else {}
750
+ call_args, call_kwargs = parameters_to_args_kwargs(flow.fn, parameters)
751
+ return get_call_parameters(flow.fn, call_args, call_kwargs)
@@ -340,7 +340,7 @@ async def suspend_flow_run(
340
340
  already started will run until completion. When resumed, the flow run will
341
341
  be rescheduled to finish execution. In order suspend a flow run in this
342
342
  way, the flow needs to have an associated deployment and results need to be
343
- configured with the `persist_results` option.
343
+ configured with the `persist_result` option.
344
344
 
345
345
  Args:
346
346
  flow_run_id: a flow run id. If supplied, this function will attempt to
@@ -53,8 +53,6 @@ from prefect.client.schemas.objects import Flow as FlowSchema
53
53
  from prefect.client.schemas.objects import FlowRun
54
54
  from prefect.client.schemas.schedules import SCHEDULE_TYPES
55
55
  from prefect.client.utilities import client_injector
56
- from prefect.deployments.runner import deploy
57
- from prefect.deployments.steps.core import run_steps
58
56
  from prefect.docker.docker_image import DockerImage
59
57
  from prefect.events import DeploymentTriggerTypes, TriggerTypes
60
58
  from prefect.exceptions import (
@@ -69,12 +67,6 @@ from prefect.futures import PrefectFuture
69
67
  from prefect.logging import get_logger
70
68
  from prefect.logging.loggers import flow_run_logger
71
69
  from prefect.results import ResultSerializer, ResultStorage
72
- from prefect.runner.storage import (
73
- BlockStorageAdapter,
74
- LocalStorage,
75
- RunnerStorage,
76
- create_storage_from_source,
77
- )
78
70
  from prefect.settings import (
79
71
  PREFECT_DEFAULT_WORK_POOL_NAME,
80
72
  PREFECT_FLOW_DEFAULT_RETRIES,
@@ -120,6 +112,7 @@ if TYPE_CHECKING:
120
112
  from prefect.client.types.flexible_schedule_list import FlexibleScheduleList
121
113
  from prefect.deployments.runner import RunnerDeployment
122
114
  from prefect.flows import FlowRun
115
+ from prefect.runner.storage import RunnerStorage
123
116
 
124
117
 
125
118
  class Flow(Generic[P, R]):
@@ -353,7 +346,7 @@ class Flow(Generic[P, R]):
353
346
  self.on_running_hooks = on_running or []
354
347
 
355
348
  # Used for flows loaded from remote storage
356
- self._storage: Optional[RunnerStorage] = None
349
+ self._storage: Optional["RunnerStorage"] = None
357
350
  self._entrypoint: Optional[str] = None
358
351
 
359
352
  module = fn.__module__
@@ -919,7 +912,7 @@ class Flow(Generic[P, R]):
919
912
  @sync_compatible
920
913
  async def from_source(
921
914
  cls: Type[F],
922
- source: Union[str, RunnerStorage, ReadableDeploymentStorage],
915
+ source: Union[str, "RunnerStorage", ReadableDeploymentStorage],
923
916
  entrypoint: str,
924
917
  ) -> F:
925
918
  """
@@ -968,6 +961,14 @@ class Flow(Generic[P, R]):
968
961
  my_flow()
969
962
  ```
970
963
  """
964
+
965
+ from prefect.runner.storage import (
966
+ BlockStorageAdapter,
967
+ LocalStorage,
968
+ RunnerStorage,
969
+ create_storage_from_source,
970
+ )
971
+
971
972
  if isinstance(source, str):
972
973
  storage = create_storage_from_source(source)
973
974
  elif isinstance(source, RunnerStorage):
@@ -1145,7 +1146,9 @@ class Flow(Generic[P, R]):
1145
1146
  entrypoint_type=entrypoint_type,
1146
1147
  )
1147
1148
 
1148
- deployment_ids = await deploy(
1149
+ from prefect.deployments import runner
1150
+
1151
+ deployment_ids = await runner.deploy(
1149
1152
  deployment,
1150
1153
  work_pool_name=work_pool_name,
1151
1154
  image=image,
@@ -1833,6 +1836,9 @@ async def load_flow_from_flow_run(
1833
1836
  run_logger.debug(
1834
1837
  f"Running {len(deployment.pull_steps)} deployment pull step(s)"
1835
1838
  )
1839
+
1840
+ from prefect.deployments.steps.core import run_steps
1841
+
1836
1842
  output = await run_steps(deployment.pull_steps)
1837
1843
  if output.get("directory"):
1838
1844
  run_logger.debug(f"Changing working directory to {output['directory']!r}")
@@ -8,6 +8,7 @@ from typing import Any, Generic, List, Optional, Set, Union, cast
8
8
 
9
9
  from typing_extensions import TypeVar
10
10
 
11
+ from prefect._internal.compatibility.deprecated import deprecated_async_method
11
12
  from prefect.client.orchestration import get_client
12
13
  from prefect.client.schemas.objects import TaskRun
13
14
  from prefect.exceptions import ObjectNotFound
@@ -111,6 +112,7 @@ class PrefectConcurrentFuture(PrefectWrappedFuture[R, concurrent.futures.Future]
111
112
  when the task run is submitted to a ThreadPoolExecutor.
112
113
  """
113
114
 
115
+ @deprecated_async_method
114
116
  def wait(self, timeout: Optional[float] = None) -> None:
115
117
  try:
116
118
  result = self._wrapped_future.result(timeout=timeout)
@@ -119,6 +121,7 @@ class PrefectConcurrentFuture(PrefectWrappedFuture[R, concurrent.futures.Future]
119
121
  if isinstance(result, State):
120
122
  self._final_state = result
121
123
 
124
+ @deprecated_async_method
122
125
  def result(
123
126
  self,
124
127
  timeout: Optional[float] = None,
@@ -168,6 +171,7 @@ class PrefectDistributedFuture(PrefectFuture[R]):
168
171
  any task run scheduled in Prefect's API.
169
172
  """
170
173
 
174
+ @deprecated_async_method
171
175
  def wait(self, timeout: Optional[float] = None) -> None:
172
176
  return run_coro_as_sync(self.wait_async(timeout=timeout))
173
177
 
@@ -204,6 +208,7 @@ class PrefectDistributedFuture(PrefectFuture[R]):
204
208
  self._final_state = task_run.state
205
209
  return
206
210
 
211
+ @deprecated_async_method
207
212
  def result(
208
213
  self,
209
214
  timeout: Optional[float] = None,
@@ -115,7 +115,7 @@ def get_run_logger(
115
115
  addition to the run metadata
116
116
 
117
117
  Raises:
118
- RuntimeError: If no context can be found
118
+ MissingContextError: If no context can be found
119
119
  """
120
120
  # Check for existing contexts
121
121
  task_run_context = prefect.context.TaskRunContext.get()
@@ -1,4 +1,5 @@
1
1
  import abc
2
+ import inspect
2
3
  import uuid
3
4
  from functools import partial
4
5
  from typing import (
@@ -620,9 +621,42 @@ class PersistedResult(BaseResult):
620
621
  try:
621
622
  data = serializer.dumps(obj)
622
623
  except Exception as exc:
624
+ extra_info = (
625
+ 'You can try a different serializer (e.g. result_serializer="json") '
626
+ "or disabling persistence (persist_result=False) for this flow or task."
627
+ )
628
+ # check if this is a known issue with cloudpickle and pydantic
629
+ # and add extra information to help the user recover
630
+
631
+ if (
632
+ isinstance(exc, TypeError)
633
+ and isinstance(obj, BaseModel)
634
+ and str(exc).startswith("cannot pickle")
635
+ ):
636
+ try:
637
+ from IPython import get_ipython
638
+
639
+ if get_ipython() is not None:
640
+ extra_info = inspect.cleandoc(
641
+ """
642
+ This is a known issue in Pydantic that prevents
643
+ locally-defined (non-imported) models from being
644
+ serialized by cloudpickle in IPython/Jupyter
645
+ environments. Please see
646
+ https://github.com/pydantic/pydantic/issues/8232 for
647
+ more information. To fix the issue, either: (1) move
648
+ your Pydantic class definition to an importable
649
+ location, (2) use the JSON serializer for your flow
650
+ or task (`result_serializer="json"`), or (3)
651
+ disable result persistence for your flow or task
652
+ (`persist_result=False`).
653
+ """
654
+ ).replace("\n", " ")
655
+ except ImportError:
656
+ pass
623
657
  raise ValueError(
624
658
  f"Failed to serialize object of type {type(obj).__name__!r} with "
625
- f"serializer {serializer.type!r}."
659
+ f"serializer {serializer.type!r}. {extra_info}"
626
660
  ) from exc
627
661
  blob = PersistedResultBlob(
628
662
  serializer=serializer, data=data, expiration=self.expiration
@@ -734,7 +734,7 @@ PREFECT_RESULTS_DEFAULT_SERIALIZER = Setting(
734
734
 
735
735
  PREFECT_RESULTS_PERSIST_BY_DEFAULT = Setting(
736
736
  bool,
737
- default=True,
737
+ default=False,
738
738
  )
739
739
  """
740
740
  The default setting for persisting results when not otherwise specified. If enabled,
@@ -602,6 +602,7 @@ class TaskRunEngine(Generic[P, R]):
602
602
  key=self.compute_transaction_key(),
603
603
  store=ResultFactoryStore(result_factory=result_factory),
604
604
  overwrite=overwrite,
605
+ logger=self.logger,
605
606
  ) as txn:
606
607
  yield txn
607
608
 
@@ -7,7 +7,7 @@ import sys
7
7
  from concurrent.futures import ThreadPoolExecutor
8
8
  from contextlib import AsyncExitStack
9
9
  from contextvars import copy_context
10
- from typing import List, Optional
10
+ from typing import Optional
11
11
  from uuid import UUID
12
12
 
13
13
  import anyio
@@ -20,6 +20,7 @@ from websockets.exceptions import InvalidStatusCode
20
20
 
21
21
  from prefect import Task
22
22
  from prefect._internal.concurrency.api import create_call, from_sync
23
+ from prefect.cache_policies import DEFAULT, NONE
23
24
  from prefect.client.orchestration import get_client
24
25
  from prefect.client.schemas.objects import TaskRun
25
26
  from prefect.client.subscriptions import Subscription
@@ -32,6 +33,7 @@ from prefect.settings import (
32
33
  )
33
34
  from prefect.states import Pending
34
35
  from prefect.task_engine import run_task_async, run_task_sync
36
+ from prefect.utilities.annotations import NotSet
35
37
  from prefect.utilities.asyncutils import asyncnullcontext, sync_compatible
36
38
  from prefect.utilities.engine import emit_task_run_state_change_event, propose_state
37
39
  from prefect.utilities.processutils import _register_signal
@@ -76,7 +78,16 @@ class TaskWorker:
76
78
  *tasks: Task,
77
79
  limit: Optional[int] = 10,
78
80
  ):
79
- self.tasks: List[Task] = list(tasks)
81
+ self.tasks = []
82
+ for t in tasks:
83
+ if isinstance(t, Task):
84
+ if t.cache_policy in [None, NONE, NotSet]:
85
+ self.tasks.append(
86
+ t.with_options(persist_result=True, cache_policy=DEFAULT)
87
+ )
88
+ else:
89
+ self.tasks.append(t.with_options(persist_result=True))
90
+
80
91
  self.task_keys = set(t.task_key for t in tasks if isinstance(t, Task))
81
92
 
82
93
  self._started_at: Optional[pendulum.DateTime] = None
@@ -33,6 +33,9 @@ from uuid import UUID, uuid4
33
33
 
34
34
  from typing_extensions import Literal, ParamSpec
35
35
 
36
+ from prefect._internal.compatibility.deprecated import (
37
+ deprecated_async_method,
38
+ )
36
39
  from prefect.cache_policies import DEFAULT, NONE, CachePolicy
37
40
  from prefect.client.orchestration import get_client
38
41
  from prefect.client.schemas import TaskRun
@@ -477,7 +480,7 @@ class Task(Generic[P, R]):
477
480
  cache_key_fn: Optional[
478
481
  Callable[["TaskRunContext", Dict[str, Any]], Optional[str]]
479
482
  ] = None,
480
- task_run_name: Optional[Union[Callable[[], str], str]] = None,
483
+ task_run_name: Optional[Union[Callable[[], str], str, Type[NotSet]]] = NotSet,
481
484
  cache_expiration: Optional[datetime.timedelta] = None,
482
485
  retries: Union[int, Type[NotSet]] = NotSet,
483
486
  retry_delay_seconds: Union[
@@ -591,7 +594,9 @@ class Task(Generic[P, R]):
591
594
  else self.cache_policy,
592
595
  cache_key_fn=cache_key_fn or self.cache_key_fn,
593
596
  cache_expiration=cache_expiration or self.cache_expiration,
594
- task_run_name=task_run_name,
597
+ task_run_name=task_run_name
598
+ if task_run_name is not NotSet
599
+ else self.task_run_name,
595
600
  retries=retries if retries is not NotSet else self.retries,
596
601
  retry_delay_seconds=(
597
602
  retry_delay_seconds
@@ -869,6 +874,7 @@ class Task(Generic[P, R]):
869
874
  ) -> State[T]:
870
875
  ...
871
876
 
877
+ @deprecated_async_method
872
878
  def submit(
873
879
  self,
874
880
  *args: Any,
@@ -1033,6 +1039,7 @@ class Task(Generic[P, R]):
1033
1039
  ) -> PrefectFutureList[State[T]]:
1034
1040
  ...
1035
1041
 
1042
+ @deprecated_async_method
1036
1043
  def map(
1037
1044
  self,
1038
1045
  *args: Any,