prefect-client 2.19.8__tar.gz → 2.20.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. {prefect-client-2.19.8/src/prefect_client.egg-info → prefect-client-2.20.0}/PKG-INFO +1 -1
  2. {prefect-client-2.19.8 → prefect-client-2.20.0}/requirements-client.txt +2 -2
  3. {prefect-client-2.19.8 → prefect-client-2.20.0}/requirements.txt +3 -2
  4. {prefect-client-2.19.8 → prefect-client-2.20.0}/setup.cfg +1 -0
  5. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/blocks/notifications.py +30 -2
  6. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/schemas/objects.py +5 -0
  7. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deployments/deployments.py +9 -2
  8. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/engine.py +41 -9
  9. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/flows.py +158 -8
  10. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/task_server.py +23 -9
  11. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/tasks.py +25 -12
  12. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/asyncutils.py +16 -9
  13. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/callables.py +5 -3
  14. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/engine.py +14 -0
  15. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/importtools.py +138 -58
  16. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/services.py +7 -1
  17. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/workers/block.py +9 -0
  18. {prefect-client-2.19.8 → prefect-client-2.20.0/src/prefect_client.egg-info}/PKG-INFO +1 -1
  19. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect_client.egg-info/requires.txt +2 -2
  20. {prefect-client-2.19.8 → prefect-client-2.20.0}/LICENSE +0 -0
  21. {prefect-client-2.19.8 → prefect-client-2.20.0}/MANIFEST.in +0 -0
  22. {prefect-client-2.19.8 → prefect-client-2.20.0}/README.md +0 -0
  23. {prefect-client-2.19.8 → prefect-client-2.20.0}/requirements-dev.txt +0 -0
  24. {prefect-client-2.19.8 → prefect-client-2.20.0}/setup.py +0 -0
  25. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/.prefectignore +0 -0
  26. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/__init__.py +0 -0
  27. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/__init__.py +0 -0
  28. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/_logging.py +0 -0
  29. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/compatibility/__init__.py +0 -0
  30. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/compatibility/deprecated.py +0 -0
  31. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/compatibility/experimental.py +0 -0
  32. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/__init__.py +0 -0
  33. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/api.py +0 -0
  34. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/calls.py +0 -0
  35. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  36. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  37. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/inspection.py +0 -0
  38. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/primitives.py +0 -0
  39. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/services.py +0 -0
  40. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/threads.py +0 -0
  41. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/concurrency/waiters.py +0 -0
  42. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/__init__.py +0 -0
  43. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_base_model.py +0 -0
  44. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_compat.py +0 -0
  45. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_flags.py +0 -0
  46. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/_types.py +0 -0
  47. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  48. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
  49. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/schemas.py +0 -0
  50. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/__init__.py +0 -0
  51. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/config_dict.py +0 -0
  52. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/field_validator.py +0 -0
  53. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_construct.py +0 -0
  54. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_copy.py +0 -0
  55. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_dump.py +0 -0
  56. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_dump_json.py +0 -0
  57. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_fields.py +0 -0
  58. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_fields_set.py +0 -0
  59. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_json_schema.py +0 -0
  60. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_rebuild.py +0 -0
  61. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_validate.py +0 -0
  62. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_validate_json.py +0 -0
  63. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/model_validator.py +0 -0
  64. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/utilities/type_adapter.py +0 -0
  65. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
  66. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
  67. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  68. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/pytz.py +0 -0
  69. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/schemas/__init__.py +0 -0
  70. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/schemas/bases.py +0 -0
  71. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/schemas/fields.py +0 -0
  72. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/schemas/serializers.py +0 -0
  73. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_internal/schemas/validators.py +0 -0
  74. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/__init__.py +0 -0
  75. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/__init__.py +0 -0
  76. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/applications.py +0 -0
  77. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/background.py +0 -0
  78. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/concurrency.py +0 -0
  79. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/datastructures.py +0 -0
  80. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/dependencies/__init__.py +0 -0
  81. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/dependencies/models.py +0 -0
  82. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/dependencies/utils.py +0 -0
  83. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/encoders.py +0 -0
  84. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/exception_handlers.py +0 -0
  85. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/exceptions.py +0 -0
  86. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/logger.py +0 -0
  87. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/__init__.py +0 -0
  88. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/asyncexitstack.py +0 -0
  89. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/cors.py +0 -0
  90. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/gzip.py +0 -0
  91. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/httpsredirect.py +0 -0
  92. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/trustedhost.py +0 -0
  93. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/middleware/wsgi.py +0 -0
  94. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/__init__.py +0 -0
  95. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/constants.py +0 -0
  96. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/docs.py +0 -0
  97. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/models.py +0 -0
  98. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/openapi/utils.py +0 -0
  99. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/param_functions.py +0 -0
  100. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/params.py +0 -0
  101. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/requests.py +0 -0
  102. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/responses.py +0 -0
  103. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/routing.py +0 -0
  104. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/__init__.py +0 -0
  105. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/api_key.py +0 -0
  106. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/base.py +0 -0
  107. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/http.py +0 -0
  108. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/oauth2.py +0 -0
  109. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/open_id_connect_url.py +0 -0
  110. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/security/utils.py +0 -0
  111. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/staticfiles.py +0 -0
  112. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/templating.py +0 -0
  113. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/testclient.py +0 -0
  114. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/types.py +0 -0
  115. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/utils.py +0 -0
  116. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/fastapi/websockets.py +0 -0
  117. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/__init__.py +0 -0
  118. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/_compat.py +0 -0
  119. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/_exception_handler.py +0 -0
  120. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/_utils.py +0 -0
  121. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/applications.py +0 -0
  122. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/authentication.py +0 -0
  123. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/background.py +0 -0
  124. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/concurrency.py +0 -0
  125. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/config.py +0 -0
  126. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/convertors.py +0 -0
  127. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/datastructures.py +0 -0
  128. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/endpoints.py +0 -0
  129. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/exceptions.py +0 -0
  130. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/formparsers.py +0 -0
  131. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/__init__.py +0 -0
  132. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/authentication.py +0 -0
  133. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/base.py +0 -0
  134. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/cors.py +0 -0
  135. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/errors.py +0 -0
  136. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/exceptions.py +0 -0
  137. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/gzip.py +0 -0
  138. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/httpsredirect.py +0 -0
  139. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/sessions.py +0 -0
  140. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/trustedhost.py +0 -0
  141. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/middleware/wsgi.py +0 -0
  142. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/requests.py +0 -0
  143. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/responses.py +0 -0
  144. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/routing.py +0 -0
  145. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/schemas.py +0 -0
  146. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/staticfiles.py +0 -0
  147. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/status.py +0 -0
  148. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/templating.py +0 -0
  149. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/testclient.py +0 -0
  150. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/types.py +0 -0
  151. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_vendor/starlette/websockets.py +0 -0
  152. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/_version.py +0 -0
  153. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/agent.py +0 -0
  154. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/artifacts.py +0 -0
  155. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/automations.py +0 -0
  156. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/blocks/__init__.py +0 -0
  157. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/blocks/abstract.py +0 -0
  158. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/blocks/core.py +0 -0
  159. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/blocks/fields.py +0 -0
  160. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/blocks/kubernetes.py +0 -0
  161. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/blocks/system.py +0 -0
  162. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/blocks/webhook.py +0 -0
  163. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/__init__.py +0 -0
  164. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/base.py +0 -0
  165. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/cloud.py +0 -0
  166. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/collections.py +0 -0
  167. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/constants.py +0 -0
  168. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/orchestration.py +0 -0
  169. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/schemas/__init__.py +0 -0
  170. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/schemas/actions.py +0 -0
  171. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/schemas/filters.py +0 -0
  172. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/schemas/responses.py +0 -0
  173. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/schemas/schedules.py +0 -0
  174. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/schemas/sorting.py +0 -0
  175. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/subscriptions.py +0 -0
  176. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/client/utilities.py +0 -0
  177. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/concurrency/__init__.py +0 -0
  178. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/concurrency/asyncio.py +0 -0
  179. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/concurrency/events.py +0 -0
  180. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/concurrency/services.py +0 -0
  181. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/concurrency/sync.py +0 -0
  182. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/context.py +0 -0
  183. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deployments/__init__.py +0 -0
  184. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deployments/base.py +0 -0
  185. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deployments/runner.py +0 -0
  186. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deployments/schedules.py +0 -0
  187. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deployments/steps/__init__.py +0 -0
  188. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deployments/steps/core.py +0 -0
  189. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deployments/steps/pull.py +0 -0
  190. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deployments/steps/utility.py +0 -0
  191. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deprecated/__init__.py +0 -0
  192. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deprecated/data_documents.py +0 -0
  193. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/__init__.py +0 -0
  194. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/base.py +0 -0
  195. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/docker.py +0 -0
  196. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/file.py +0 -0
  197. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/orion.py +0 -0
  198. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/deprecated/packaging/serializers.py +0 -0
  199. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/__init__.py +0 -0
  200. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/actions.py +0 -0
  201. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/cli/__init__.py +0 -0
  202. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/cli/automations.py +0 -0
  203. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/clients.py +0 -0
  204. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/filters.py +0 -0
  205. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/instrument.py +0 -0
  206. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/related.py +0 -0
  207. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/schemas/__init__.py +0 -0
  208. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/schemas/automations.py +0 -0
  209. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/schemas/deployment_triggers.py +0 -0
  210. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/schemas/events.py +0 -0
  211. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/schemas/labelling.py +0 -0
  212. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/utilities.py +0 -0
  213. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/events/worker.py +0 -0
  214. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/exceptions.py +0 -0
  215. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/filesystems.py +0 -0
  216. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/flow_runs.py +0 -0
  217. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/futures.py +0 -0
  218. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/__init__.py +0 -0
  219. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/base.py +0 -0
  220. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/container.py +0 -0
  221. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/kubernetes.py +0 -0
  222. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/process.py +0 -0
  223. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  224. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  225. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  226. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  227. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  228. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/input/__init__.py +0 -0
  229. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/input/actions.py +0 -0
  230. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/input/run_input.py +0 -0
  231. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/logging/__init__.py +0 -0
  232. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/logging/configuration.py +0 -0
  233. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/logging/filters.py +0 -0
  234. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/logging/formatters.py +0 -0
  235. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/logging/handlers.py +0 -0
  236. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/logging/highlighters.py +0 -0
  237. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/logging/loggers.py +0 -0
  238. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/logging/logging.yml +0 -0
  239. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/manifests.py +0 -0
  240. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/new_flow_engine.py +0 -0
  241. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/new_task_engine.py +0 -0
  242. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/plugins.py +0 -0
  243. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/profiles.toml +0 -0
  244. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/py.typed +0 -0
  245. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/pydantic/__init__.py +0 -0
  246. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/pydantic/main.py +0 -0
  247. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/results.py +0 -0
  248. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runner/__init__.py +0 -0
  249. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runner/runner.py +0 -0
  250. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runner/server.py +0 -0
  251. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runner/storage.py +0 -0
  252. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runner/submit.py +0 -0
  253. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runner/utils.py +0 -0
  254. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runtime/__init__.py +0 -0
  255. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runtime/deployment.py +0 -0
  256. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runtime/flow_run.py +0 -0
  257. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/runtime/task_run.py +0 -0
  258. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/serializers.py +0 -0
  259. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
  260. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  261. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/settings.py +0 -0
  262. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/software/__init__.py +0 -0
  263. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/software/base.py +0 -0
  264. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/software/conda.py +0 -0
  265. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/software/pip.py +0 -0
  266. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/software/python.py +0 -0
  267. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/states.py +0 -0
  268. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/task_engine.py +0 -0
  269. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/task_runners.py +0 -0
  270. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/types/__init__.py +0 -0
  271. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/__init__.py +0 -0
  272. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/annotations.py +0 -0
  273. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/collections.py +0 -0
  274. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/compat.py +0 -0
  275. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/context.py +0 -0
  276. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/dispatch.py +0 -0
  277. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/dockerutils.py +0 -0
  278. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/filesystem.py +0 -0
  279. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/hashing.py +0 -0
  280. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/math.py +0 -0
  281. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/names.py +0 -0
  282. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/processutils.py +0 -0
  283. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/pydantic.py +0 -0
  284. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/render_swagger.py +0 -0
  285. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/schema_tools/__init__.py +0 -0
  286. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/schema_tools/hydration.py +0 -0
  287. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/schema_tools/validation.py +0 -0
  288. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/slugify.py +0 -0
  289. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/templating.py +0 -0
  290. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/text.py +0 -0
  291. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/timeout.py +0 -0
  292. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/utilities/visualization.py +0 -0
  293. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/variables.py +0 -0
  294. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/workers/__init__.py +0 -0
  295. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/workers/base.py +0 -0
  296. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/workers/process.py +0 -0
  297. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/workers/server.py +0 -0
  298. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect/workers/utilities.py +0 -0
  299. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect_client.egg-info/SOURCES.txt +0 -0
  300. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  301. {prefect-client-2.19.8 → prefect-client-2.20.0}/src/prefect_client.egg-info/top_level.txt +0 -0
  302. {prefect-client-2.19.8 → prefect-client-2.20.0}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-client
3
- Version: 2.19.8
3
+ Version: 2.20.0
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -1,4 +1,4 @@
1
- anyio >= 3.7.1, < 4.0.0
1
+ anyio >= 4.4.0, < 5.0.0
2
2
  asgi-lifespan >= 1.0, < 3.0
3
3
  cachetools >= 5.3, < 6.0
4
4
  cloudpickle >= 2.0, < 4.0
@@ -6,7 +6,7 @@ coolname >= 1.0.4, < 3.0.0
6
6
  croniter >= 1.0.12, < 3.0.0
7
7
  fsspec >= 2022.5.0
8
8
  graphviz >= 0.20.1
9
- griffe >= 0.20.0
9
+ griffe >= 0.20.0, <0.48.0
10
10
  httpcore >=1.0.5, < 2.0.0
11
11
  httpx[http2] >= 0.23, != 0.23.2
12
12
  importlib_metadata >= 4.4; python_version < '3.10'
@@ -2,14 +2,14 @@
2
2
 
3
3
  aiosqlite >= 0.17.0
4
4
  alembic >= 1.7.5, < 2.0.0
5
- apprise >= 1.1.0, < 2.0.0
5
+ apprise >= 1.8.0, < 2.0.0
6
6
  asyncpg >= 0.23
7
7
  click >= 8.0, < 8.2
8
8
  cryptography >= 36.0.1
9
9
  dateparser >= 1.1.1, < 2.0.0
10
10
  docker >= 4.0
11
11
  graphviz >= 0.20.1
12
- griffe >= 0.20.0
12
+ griffe >= 0.20.0, <0.48.0
13
13
  jinja2 >= 3.0.0, < 4.0.0
14
14
  jinja2-humanize-extension >= 0.4.0
15
15
  humanize >= 4.9.0
@@ -18,3 +18,4 @@ pytz >= 2021.1, < 2025
18
18
  readchar >= 4.0.0, < 5.0.0
19
19
  sqlalchemy[asyncio] >= 1.4.22, != 1.4.33, < 3.0.0
20
20
  typer >= 0.12.0, != 0.12.2, < 0.13.0
21
+ exceptiongroup >= 1.2.1
@@ -52,6 +52,7 @@ filterwarnings =
52
52
  ignore::ResourceWarning
53
53
  ignore::pytest.PytestUnraisableExceptionWarning
54
54
  ignore::pluggy.PluggyTeardownRaisedWarning
55
+ ignore::prefect._internal.compatibility.deprecated.PrefectDeprecationWarning
55
56
 
56
57
  [mypy]
57
58
  plugins =
@@ -139,12 +139,40 @@ class MicrosoftTeamsWebhook(AppriseNotificationBlock):
139
139
  url: SecretStr = Field(
140
140
  ...,
141
141
  title="Webhook URL",
142
- description="The Teams incoming webhook URL used to send notifications.",
142
+ description="The Microsoft Power Automate (Workflows) URL used to send notifications to Teams.",
143
143
  examples=[
144
- "https://your-org.webhook.office.com/webhookb2/XXX/IncomingWebhook/YYY/ZZZ"
144
+ "https://prod-NO.LOCATION.logic.azure.com:443/workflows/WFID/triggers/manual/paths/invoke?sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=SIGNATURE"
145
145
  ],
146
146
  )
147
147
 
148
+ include_image: bool = Field(
149
+ default=True,
150
+ description="Include an image with the notification.",
151
+ )
152
+
153
+ wrap: bool = Field(
154
+ default=True,
155
+ description="Wrap the notification text.",
156
+ )
157
+
158
+ def block_initialization(self) -> None:
159
+ """see https://github.com/caronc/apprise/pull/1172"""
160
+ from apprise.plugins.workflows import NotifyWorkflows
161
+
162
+ if not (
163
+ parsed_url := NotifyWorkflows.parse_native_url(self.url.get_secret_value())
164
+ ):
165
+ raise ValueError("Invalid Microsoft Teams Workflow URL provided.")
166
+
167
+ parsed_url.update(
168
+ {
169
+ "include_image": self.include_image,
170
+ "wrap": self.wrap,
171
+ }
172
+ )
173
+
174
+ self._start_apprise_client(SecretStr(NotifyWorkflows(**parsed_url).url()))
175
+
148
176
 
149
177
  class PagerDutyWebHook(AbstractAppriseNotificationBlock):
150
178
  """
@@ -17,6 +17,7 @@ import pendulum
17
17
 
18
18
  from prefect._internal.compatibility.deprecated import (
19
19
  DeprecatedInfraOverridesField,
20
+ deprecated_class,
20
21
  )
21
22
  from prefect._internal.pydantic import HAS_PYDANTIC_V2
22
23
  from prefect.types import NonNegativeInteger, PositiveInteger
@@ -917,6 +918,10 @@ class Flow(ObjectBaseModel):
917
918
  return raise_on_name_with_banned_characters(v)
918
919
 
919
920
 
921
+ @deprecated_class(
922
+ start_date="Jun 2024",
923
+ help="Will be removed in Prefect 3 in favor of prefect.client.schemas.actions.DeploymentScheduleCreate",
924
+ )
920
925
  class MinimalDeploymentSchedule(PrefectBaseModel):
921
926
  schedule: SCHEDULE_TYPES = Field(
922
927
  default=..., description="The schedule for the deployment."
@@ -238,12 +238,17 @@ async def run_deployment(
238
238
  return flow_run
239
239
 
240
240
 
241
+ @deprecated_callable(
242
+ start_date="Jun 2024",
243
+ help="Will be moved in Prefect 3 to prefect.flows:load_flow_from_flow_run",
244
+ )
241
245
  @inject_client
242
246
  async def load_flow_from_flow_run(
243
247
  flow_run: FlowRun,
244
248
  client: PrefectClient,
245
249
  ignore_storage: bool = False,
246
250
  storage_base_path: Optional[str] = None,
251
+ use_placeholder_flow: bool = True,
247
252
  ) -> Flow:
248
253
  """
249
254
  Load a flow from the location/script provided in a deployment's storage document.
@@ -270,7 +275,7 @@ async def load_flow_from_flow_run(
270
275
  f"Importing flow code from module path {deployment.entrypoint}"
271
276
  )
272
277
  flow = await run_sync_in_worker_thread(
273
- load_flow_from_entrypoint, deployment.entrypoint
278
+ load_flow_from_entrypoint, deployment.entrypoint, use_placeholder_flow
274
279
  )
275
280
  return flow
276
281
 
@@ -314,7 +319,9 @@ async def load_flow_from_flow_run(
314
319
  ).absolute()
315
320
  run_logger.debug(f"Importing flow code from '{import_path}'")
316
321
 
317
- flow = await run_sync_in_worker_thread(load_flow_from_entrypoint, str(import_path))
322
+ flow = await run_sync_in_worker_thread(
323
+ load_flow_from_entrypoint, str(import_path), use_placeholder_flow
324
+ )
318
325
 
319
326
  return flow
320
327
 
@@ -107,13 +107,16 @@ from uuid import UUID, uuid4
107
107
 
108
108
  import anyio
109
109
  import pendulum
110
- from anyio import start_blocking_portal
110
+ from anyio.from_thread import start_blocking_portal
111
111
  from typing_extensions import Literal
112
112
 
113
113
  import prefect
114
114
  import prefect.context
115
115
  import prefect.plugins
116
- from prefect._internal.compatibility.deprecated import deprecated_parameter
116
+ from prefect._internal.compatibility.deprecated import (
117
+ deprecated_callable,
118
+ deprecated_parameter,
119
+ )
117
120
  from prefect._internal.compatibility.experimental import experimental_parameter
118
121
  from prefect._internal.concurrency.api import create_call, from_async, from_sync
119
122
  from prefect._internal.concurrency.calls import get_current_call
@@ -208,6 +211,7 @@ from prefect.utilities.engine import (
208
211
  _resolve_custom_task_run_name,
209
212
  capture_sigterm,
210
213
  check_api_reachable,
214
+ collapse_excgroups,
211
215
  collect_task_run_inputs,
212
216
  emit_task_run_state_change_event,
213
217
  propose_state,
@@ -276,7 +280,7 @@ def enter_flow_run_engine_from_flow_call(
276
280
  # the user. Generally, you should enter contexts _within_ the async `begin_run`
277
281
  # instead but if you need to enter a context from the main thread you'll need to do
278
282
  # it here.
279
- contexts = [capture_sigterm()]
283
+ contexts = [capture_sigterm(), collapse_excgroups()]
280
284
 
281
285
  if flow.isasync and (
282
286
  not is_subflow_run or (is_subflow_run and parent_flow_run_context.flow.isasync)
@@ -321,7 +325,7 @@ def enter_flow_run_engine_from_subprocess(flow_run_id: UUID) -> State:
321
325
  flow_run_id,
322
326
  user_thread=threading.current_thread(),
323
327
  ),
324
- contexts=[capture_sigterm()],
328
+ contexts=[capture_sigterm(), collapse_excgroups()],
325
329
  )
326
330
 
327
331
  APILogHandler.flush()
@@ -417,9 +421,12 @@ async def retrieve_flow_then_begin_flow_run(
417
421
 
418
422
  try:
419
423
  flow = (
420
- load_flow_from_entrypoint(entrypoint)
424
+ # We do not want to use a placeholder flow at runtime
425
+ load_flow_from_entrypoint(entrypoint, use_placeholder_flow=False)
421
426
  if entrypoint
422
- else await load_flow_from_flow_run(flow_run, client=client)
427
+ else await load_flow_from_flow_run(
428
+ flow_run, client=client, use_placeholder_flow=False
429
+ )
423
430
  )
424
431
  except Exception:
425
432
  message = (
@@ -975,6 +982,10 @@ async def orchestrate_flow_run(
975
982
  return state
976
983
 
977
984
 
985
+ @deprecated_callable(
986
+ start_date="Jun 2024",
987
+ help="Will be moved in Prefect 3 to prefect.flow_runs:pause_flow_run",
988
+ )
978
989
  @overload
979
990
  async def pause_flow_run(
980
991
  wait_for_input: None = None,
@@ -987,6 +998,10 @@ async def pause_flow_run(
987
998
  ...
988
999
 
989
1000
 
1001
+ @deprecated_callable(
1002
+ start_date="Jun 2024",
1003
+ help="Will be moved in Prefect 3 to prefect.flow_runs:pause_flow_run",
1004
+ )
990
1005
  @overload
991
1006
  async def pause_flow_run(
992
1007
  wait_for_input: Type[T],
@@ -1095,6 +1110,10 @@ async def pause_flow_run(
1095
1110
  )
1096
1111
 
1097
1112
 
1113
+ @deprecated_callable(
1114
+ start_date="Jun 2024",
1115
+ help="Will be moved in Prefect 3 to prefect.flow_runs:_in_process_pause",
1116
+ )
1098
1117
  @inject_client
1099
1118
  async def _in_process_pause(
1100
1119
  timeout: int = 3600,
@@ -1190,6 +1209,10 @@ async def _in_process_pause(
1190
1209
  raise FlowPauseTimeout("Flow run was paused and never resumed.")
1191
1210
 
1192
1211
 
1212
+ @deprecated_callable(
1213
+ start_date="Jun 2024",
1214
+ help="Will be moved in Prefect 3 to prefect.flow_runs.pause_flow_run.",
1215
+ )
1193
1216
  @inject_client
1194
1217
  async def _out_of_process_pause(
1195
1218
  flow_run_id: UUID,
@@ -1212,6 +1235,10 @@ async def _out_of_process_pause(
1212
1235
  raise RuntimeError(response.details.reason)
1213
1236
 
1214
1237
 
1238
+ @deprecated_callable(
1239
+ start_date="Jun 2024",
1240
+ help="Will be moved in Prefect 3 to prefect.flow_runs:suspend_flow_run",
1241
+ )
1215
1242
  @overload
1216
1243
  async def suspend_flow_run(
1217
1244
  wait_for_input: None = None,
@@ -1343,6 +1370,10 @@ async def suspend_flow_run(
1343
1370
  raise Pause()
1344
1371
 
1345
1372
 
1373
+ @deprecated_callable(
1374
+ start_date="Jun 2024",
1375
+ help="Will be moved in Prefect 3 to prefect.flow_runs:resume_flow_run",
1376
+ )
1346
1377
  @sync_compatible
1347
1378
  async def resume_flow_run(flow_run_id, run_input: Optional[Dict] = None):
1348
1379
  """
@@ -2218,9 +2249,9 @@ async def report_flow_run_crashes(flow_run: FlowRun, client: PrefectClient, flow
2218
2249
 
2219
2250
  This context _must_ reraise the exception to properly exit the run.
2220
2251
  """
2221
-
2222
2252
  try:
2223
- yield
2253
+ with collapse_excgroups():
2254
+ yield
2224
2255
  except (Abort, Pause):
2225
2256
  # Do not capture internal signals as crashes
2226
2257
  raise
@@ -2257,7 +2288,8 @@ async def report_task_run_crashes(task_run: TaskRun, client: PrefectClient):
2257
2288
  This context _must_ reraise the exception to properly exit the run.
2258
2289
  """
2259
2290
  try:
2260
- yield
2291
+ with collapse_excgroups():
2292
+ yield
2261
2293
  except (Abort, Pause):
2262
2294
  # Do not capture internal signals as crashes
2263
2295
  raise
@@ -1650,6 +1650,7 @@ def load_flow_from_script(path: str, flow_name: str = None) -> Flow:
1650
1650
 
1651
1651
  def load_flow_from_entrypoint(
1652
1652
  entrypoint: str,
1653
+ use_placeholder_flow: bool = True,
1653
1654
  ) -> Flow:
1654
1655
  """
1655
1656
  Extract a flow object from a script at an entrypoint by running all of the code in the file.
@@ -1657,6 +1658,9 @@ def load_flow_from_entrypoint(
1657
1658
  Args:
1658
1659
  entrypoint: a string in the format `<path_to_script>:<flow_func_name>` or a module path
1659
1660
  to a flow function
1661
+ use_placeholder_flow: If True, a placeholder flow will be used if the entrypoint
1662
+ cannot be loaded for any reason (e.g. dependencies are missing). If False, an
1663
+ exception will be raised.
1660
1664
 
1661
1665
  Returns:
1662
1666
  The flow object from the script
@@ -1672,6 +1676,7 @@ def load_flow_from_entrypoint(
1672
1676
  if ":" in entrypoint:
1673
1677
  # split by the last colon once to handle Windows paths with drive letters i.e C:\path\to\file.py:do_stuff
1674
1678
  path, func_name = entrypoint.rsplit(":", maxsplit=1)
1679
+
1675
1680
  else:
1676
1681
  path, func_name = entrypoint.rsplit(".", maxsplit=1)
1677
1682
  try:
@@ -1680,14 +1685,15 @@ def load_flow_from_entrypoint(
1680
1685
  raise MissingFlowError(
1681
1686
  f"Flow function with name {func_name!r} not found in {path!r}. "
1682
1687
  ) from exc
1683
- except ScriptError as exc:
1688
+ except ScriptError:
1684
1689
  # If the flow has dependencies that are not installed in the current
1685
- # environment, fallback to loading the flow via AST parsing. The
1686
- # drawback of this approach is that we're unable to actually load the
1687
- # function, so we create a placeholder flow that will re-raise this
1688
- # exception when called.
1689
-
1690
- flow = load_placeholder_flow(entrypoint=entrypoint, raises=exc)
1690
+ # environment, fallback to loading the flow via AST parsing.
1691
+ if use_placeholder_flow:
1692
+ flow = safe_load_flow_from_entrypoint(entrypoint)
1693
+ if flow is None:
1694
+ raise
1695
+ else:
1696
+ raise
1691
1697
 
1692
1698
  if not isinstance(flow, Flow):
1693
1699
  raise MissingFlowError(
@@ -1848,6 +1854,147 @@ def load_placeholder_flow(entrypoint: str, raises: Exception):
1848
1854
  return Flow(**arguments)
1849
1855
 
1850
1856
 
1857
+ def safe_load_flow_from_entrypoint(entrypoint: str) -> Optional[Flow]:
1858
+ """
1859
+ Load a flow from an entrypoint and return None if an exception is raised.
1860
+
1861
+ Args:
1862
+ entrypoint: a string in the format `<path_to_script>:<flow_func_name>`
1863
+ or a module path to a flow function
1864
+ """
1865
+ func_def, source_code = _entrypoint_definition_and_source(entrypoint)
1866
+ path = None
1867
+ if ":" in entrypoint:
1868
+ path = entrypoint.rsplit(":")[0]
1869
+ namespace = safe_load_namespace(source_code, filepath=path)
1870
+ if func_def.name in namespace:
1871
+ return namespace[func_def.name]
1872
+ else:
1873
+ # If the function is not in the namespace, if may be due to missing dependencies
1874
+ # for the function. We will attempt to compile each annotation and default value
1875
+ # and remove them from the function definition to see if the function can be
1876
+ # compiled without them.
1877
+
1878
+ return _sanitize_and_load_flow(func_def, namespace)
1879
+
1880
+
1881
+ def _sanitize_and_load_flow(
1882
+ func_def: Union[ast.FunctionDef, ast.AsyncFunctionDef], namespace: Dict[str, Any]
1883
+ ) -> Optional[Flow]:
1884
+ """
1885
+ Attempt to load a flow from the function definition after sanitizing the annotations
1886
+ and defaults that can't be compiled.
1887
+
1888
+ Args:
1889
+ func_def: the function definition
1890
+ namespace: the namespace to load the function into
1891
+
1892
+ Returns:
1893
+ The loaded function or None if the function can't be loaded
1894
+ after sanitizing the annotations and defaults.
1895
+ """
1896
+ args = func_def.args.posonlyargs + func_def.args.args + func_def.args.kwonlyargs
1897
+ if func_def.args.vararg:
1898
+ args.append(func_def.args.vararg)
1899
+ if func_def.args.kwarg:
1900
+ args.append(func_def.args.kwarg)
1901
+ # Remove annotations that can't be compiled
1902
+ for arg in args:
1903
+ if arg.annotation is not None:
1904
+ try:
1905
+ code = compile(
1906
+ ast.Expression(arg.annotation),
1907
+ filename="<ast>",
1908
+ mode="eval",
1909
+ )
1910
+ exec(code, namespace)
1911
+ except Exception as e:
1912
+ logger.debug(
1913
+ "Failed to evaluate annotation for argument %s due to the following error. Ignoring annotation.",
1914
+ arg.arg,
1915
+ exc_info=e,
1916
+ )
1917
+ arg.annotation = None
1918
+
1919
+ # Remove defaults that can't be compiled
1920
+ new_defaults = []
1921
+ for default in func_def.args.defaults:
1922
+ try:
1923
+ code = compile(ast.Expression(default), "<ast>", "eval")
1924
+ exec(code, namespace)
1925
+ new_defaults.append(default)
1926
+ except Exception as e:
1927
+ logger.debug(
1928
+ "Failed to evaluate default value %s due to the following error. Ignoring default.",
1929
+ default,
1930
+ exc_info=e,
1931
+ )
1932
+ new_defaults.append(
1933
+ ast.Constant(
1934
+ value=None, lineno=default.lineno, col_offset=default.col_offset
1935
+ )
1936
+ )
1937
+ func_def.args.defaults = new_defaults
1938
+
1939
+ # Remove kw_defaults that can't be compiled
1940
+ new_kw_defaults = []
1941
+ for default in func_def.args.kw_defaults:
1942
+ if default is not None:
1943
+ try:
1944
+ code = compile(ast.Expression(default), "<ast>", "eval")
1945
+ exec(code, namespace)
1946
+ new_kw_defaults.append(default)
1947
+ except Exception as e:
1948
+ logger.debug(
1949
+ "Failed to evaluate default value %s due to the following error. Ignoring default.",
1950
+ default,
1951
+ exc_info=e,
1952
+ )
1953
+ new_kw_defaults.append(
1954
+ ast.Constant(
1955
+ value=None,
1956
+ lineno=default.lineno,
1957
+ col_offset=default.col_offset,
1958
+ )
1959
+ )
1960
+ else:
1961
+ new_kw_defaults.append(
1962
+ ast.Constant(
1963
+ value=None,
1964
+ lineno=func_def.lineno,
1965
+ col_offset=func_def.col_offset,
1966
+ )
1967
+ )
1968
+ func_def.args.kw_defaults = new_kw_defaults
1969
+
1970
+ if func_def.returns is not None:
1971
+ try:
1972
+ code = compile(
1973
+ ast.Expression(func_def.returns), filename="<ast>", mode="eval"
1974
+ )
1975
+ exec(code, namespace)
1976
+ except Exception as e:
1977
+ logger.debug(
1978
+ "Failed to evaluate return annotation due to the following error. Ignoring annotation.",
1979
+ exc_info=e,
1980
+ )
1981
+ func_def.returns = None
1982
+
1983
+ # Attempt to compile the function without annotations and defaults that
1984
+ # can't be compiled
1985
+ try:
1986
+ code = compile(
1987
+ ast.Module(body=[func_def], type_ignores=[]),
1988
+ filename="<ast>",
1989
+ mode="exec",
1990
+ )
1991
+ exec(code, namespace)
1992
+ except Exception as e:
1993
+ logger.debug("Failed to compile: %s", e)
1994
+ else:
1995
+ return namespace.get(func_def.name)
1996
+
1997
+
1851
1998
  def load_flow_arguments_from_entrypoint(
1852
1999
  entrypoint: str, arguments: Optional[Union[List[str], Set[str]]] = None
1853
2000
  ) -> Dict[str, Any]:
@@ -1863,6 +2010,9 @@ def load_flow_arguments_from_entrypoint(
1863
2010
  """
1864
2011
 
1865
2012
  func_def, source_code = _entrypoint_definition_and_source(entrypoint)
2013
+ path = None
2014
+ if ":" in entrypoint:
2015
+ path = entrypoint.rsplit(":")[0]
1866
2016
 
1867
2017
  if arguments is None:
1868
2018
  # If no arguments are provided default to known arguments that are of
@@ -1898,7 +2048,7 @@ def load_flow_arguments_from_entrypoint(
1898
2048
 
1899
2049
  # if the arg value is not a raw str (i.e. a variable or expression),
1900
2050
  # then attempt to evaluate it
1901
- namespace = safe_load_namespace(source_code)
2051
+ namespace = safe_load_namespace(source_code, filepath=path)
1902
2052
  literal_arg_value = ast.get_source_segment(source_code, keyword.value)
1903
2053
  cleaned_value = (
1904
2054
  literal_arg_value.replace("\n", "") if literal_arg_value else ""
@@ -9,6 +9,7 @@ from functools import partial
9
9
  from typing import List, Optional, Type
10
10
 
11
11
  import anyio
12
+ from exceptiongroup import BaseExceptionGroup # novermin
12
13
  from websockets.exceptions import InvalidStatusCode
13
14
 
14
15
  from prefect import Task, get_client
@@ -225,16 +226,21 @@ class TaskServer:
225
226
  validated_state=state,
226
227
  )
227
228
 
228
- self._runs_task_group.start_soon(
229
- partial(
230
- submit_autonomous_task_run_to_engine,
231
- task=task,
232
- task_run=task_run,
233
- parameters=parameters,
234
- task_runner=self.task_runner,
235
- client=self._client,
229
+ try:
230
+ self._runs_task_group.start_soon(
231
+ partial(
232
+ submit_autonomous_task_run_to_engine,
233
+ task=task,
234
+ task_run=task_run,
235
+ parameters=parameters,
236
+ task_runner=self.task_runner,
237
+ client=self._client,
238
+ )
239
+ )
240
+ except BaseException as exc:
241
+ logger.exception(
242
+ f"Failed to submit task run {task_run.id!r} to engine", exc_info=exc
236
243
  )
237
- )
238
244
 
239
245
  async def execute_task_run(self, task_run: TaskRun):
240
246
  """Execute a task run in the task server."""
@@ -301,6 +307,14 @@ async def serve(*tasks: Task, task_runner: Optional[Type[BaseTaskRunner]] = None
301
307
  try:
302
308
  await task_server.start()
303
309
 
310
+ except BaseExceptionGroup as exc: # novermin
311
+ exceptions = exc.exceptions
312
+ n_exceptions = len(exceptions)
313
+ logger.error(
314
+ f"Task worker stopped with {n_exceptions} exception{'s' if n_exceptions != 1 else ''}:"
315
+ f"\n" + "\n".join(str(e) for e in exceptions)
316
+ )
317
+
304
318
  except StopTaskServer:
305
319
  logger.info("Task server stopped.")
306
320
 
@@ -6,7 +6,6 @@ Module containing the base workflow task class and decorator - for most use case
6
6
 
7
7
  import datetime
8
8
  import inspect
9
- import os
10
9
  from copy import copy
11
10
  from functools import partial, update_wrapper
12
11
  from typing import (
@@ -76,6 +75,8 @@ P = ParamSpec("P") # The parameters of the task
76
75
 
77
76
  logger = get_logger("tasks")
78
77
 
78
+ NUM_CHARS_DYNAMIC_KEY: int = 8
79
+
79
80
 
80
81
  def task_input_hash(
81
82
  context: "TaskRunContext", arguments: Dict[str, Any]
@@ -125,6 +126,28 @@ def exponential_backoff(backoff_factor: float) -> Callable[[int], List[float]]:
125
126
  return retry_backoff_callable
126
127
 
127
128
 
129
+ def _generate_task_key(fn: Callable[..., Any]) -> str:
130
+ """Generate a task key based on the function name and source code.
131
+ We may eventually want some sort of top-level namespace here to
132
+ disambiguate tasks with the same function name in different modules,
133
+ in a more human-readable way, while avoiding relative import problems (see #12337).
134
+ As long as the task implementations are unique (even if named the same), we should
135
+ not have any collisions.
136
+ Args:
137
+ fn: The function to generate a task key for.
138
+ """
139
+ if not hasattr(fn, "__qualname__"):
140
+ return to_qualified_name(type(fn))
141
+
142
+ qualname = fn.__qualname__.split(".")[-1]
143
+
144
+ code_hash = (
145
+ h[:NUM_CHARS_DYNAMIC_KEY] if (h := hash_objects(fn.__code__)) else "unknown"
146
+ )
147
+
148
+ return f"{qualname}-{code_hash}"
149
+
150
+
128
151
  @PrefectObjectRegistry.register_instances
129
152
  class Task(Generic[P, R]):
130
153
  """
@@ -292,17 +315,7 @@ class Task(Generic[P, R]):
292
315
 
293
316
  self.tags = set(tags if tags else [])
294
317
 
295
- if not hasattr(self.fn, "__qualname__"):
296
- self.task_key = to_qualified_name(type(self.fn))
297
- else:
298
- try:
299
- task_origin_hash = hash_objects(
300
- self.name, os.path.abspath(inspect.getsourcefile(self.fn))
301
- )
302
- except TypeError:
303
- task_origin_hash = "unknown-source-file"
304
-
305
- self.task_key = f"{self.fn.__qualname__}-{task_origin_hash}"
318
+ self.task_key = _generate_task_key(self.fn)
306
319
 
307
320
  self.cache_key_fn = cache_key_fn
308
321
  self.cache_expiration = cache_expiration