prefect-client 3.1.9__tar.gz → 3.1.10__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 (259) hide show
  1. {prefect-client-3.1.9/src/prefect_client.egg-info → prefect-client-3.1.10}/PKG-INFO +1 -1
  2. {prefect-client-3.1.9 → prefect-client-3.1.10}/requirements-dev.txt +1 -1
  3. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_version.py +3 -3
  4. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/artifacts.py +61 -74
  5. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/automations.py +27 -7
  6. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/context.py +16 -27
  7. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/flows.py +2 -1
  8. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/futures.py +42 -27
  9. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/locking/filesystem.py +8 -7
  10. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/locking/memory.py +5 -3
  11. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/locking/protocol.py +1 -1
  12. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/plugins.py +12 -10
  13. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/results.py +1 -1
  14. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/telemetry/processors.py +6 -6
  15. prefect-client-3.1.10/src/prefect/telemetry/services.py +68 -0
  16. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/workers/__init__.py +2 -0
  17. {prefect-client-3.1.9 → prefect-client-3.1.10/src/prefect_client.egg-info}/PKG-INFO +1 -1
  18. prefect-client-3.1.9/src/prefect/telemetry/services.py +0 -67
  19. {prefect-client-3.1.9 → prefect-client-3.1.10}/LICENSE +0 -0
  20. {prefect-client-3.1.9 → prefect-client-3.1.10}/MANIFEST.in +0 -0
  21. {prefect-client-3.1.9 → prefect-client-3.1.10}/README.md +0 -0
  22. {prefect-client-3.1.9 → prefect-client-3.1.10}/requirements-client.txt +0 -0
  23. {prefect-client-3.1.9 → prefect-client-3.1.10}/requirements.txt +0 -0
  24. {prefect-client-3.1.9 → prefect-client-3.1.10}/setup.cfg +0 -0
  25. {prefect-client-3.1.9 → prefect-client-3.1.10}/setup.py +0 -0
  26. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/.prefectignore +0 -0
  27. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/__init__.py +0 -0
  28. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_experimental/__init__.py +0 -0
  29. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_experimental/lineage.py +0 -0
  30. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/__init__.py +0 -0
  31. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/_logging.py +0 -0
  32. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/compatibility/__init__.py +0 -0
  33. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/compatibility/async_dispatch.py +0 -0
  34. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/compatibility/deprecated.py +0 -0
  35. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/compatibility/migration.py +0 -0
  36. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/__init__.py +0 -0
  37. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/api.py +0 -0
  38. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/calls.py +0 -0
  39. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/cancellation.py +0 -0
  40. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/event_loop.py +0 -0
  41. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/inspection.py +0 -0
  42. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/primitives.py +0 -0
  43. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/services.py +0 -0
  44. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/threads.py +0 -0
  45. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/concurrency/waiters.py +0 -0
  46. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/integrations.py +0 -0
  47. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/pydantic/__init__.py +0 -0
  48. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/pydantic/annotations/__init__.py +0 -0
  49. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/pydantic/annotations/pendulum.py +0 -0
  50. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/pydantic/schemas.py +0 -0
  51. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/pydantic/v1_schema.py +0 -0
  52. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/pydantic/v2_schema.py +0 -0
  53. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/pydantic/v2_validated_func.py +0 -0
  54. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/pytz.py +0 -0
  55. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/retries.py +0 -0
  56. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/schemas/__init__.py +0 -0
  57. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/schemas/bases.py +0 -0
  58. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/schemas/fields.py +0 -0
  59. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/schemas/serializers.py +0 -0
  60. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/_internal/schemas/validators.py +0 -0
  61. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/agent.py +0 -0
  62. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/blocks/__init__.py +0 -0
  63. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/blocks/abstract.py +0 -0
  64. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/blocks/core.py +0 -0
  65. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/blocks/fields.py +0 -0
  66. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/blocks/notifications.py +0 -0
  67. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/blocks/redis.py +0 -0
  68. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/blocks/system.py +0 -0
  69. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/blocks/webhook.py +0 -0
  70. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/cache_policies.py +0 -0
  71. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/__init__.py +0 -0
  72. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/base.py +0 -0
  73. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/cloud.py +0 -0
  74. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/collections.py +0 -0
  75. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/constants.py +0 -0
  76. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/orchestration.py +0 -0
  77. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/schemas/__init__.py +0 -0
  78. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/schemas/actions.py +0 -0
  79. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/schemas/filters.py +0 -0
  80. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/schemas/objects.py +0 -0
  81. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/schemas/responses.py +0 -0
  82. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/schemas/schedules.py +0 -0
  83. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/schemas/sorting.py +0 -0
  84. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/subscriptions.py +0 -0
  85. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/types/__init__.py +0 -0
  86. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/types/flexible_schedule_list.py +0 -0
  87. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/client/utilities.py +0 -0
  88. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/__init__.py +0 -0
  89. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/asyncio.py +0 -0
  90. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/context.py +0 -0
  91. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/events.py +0 -0
  92. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/services.py +0 -0
  93. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/sync.py +0 -0
  94. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/v1/__init__.py +0 -0
  95. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/v1/asyncio.py +0 -0
  96. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/v1/context.py +0 -0
  97. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/v1/events.py +0 -0
  98. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/v1/services.py +0 -0
  99. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/concurrency/v1/sync.py +0 -0
  100. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/__init__.py +0 -0
  101. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/base.py +0 -0
  102. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/deployments.py +0 -0
  103. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/flow_runs.py +0 -0
  104. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/runner.py +0 -0
  105. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/schedules.py +0 -0
  106. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/steps/__init__.py +0 -0
  107. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/steps/core.py +0 -0
  108. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/steps/pull.py +0 -0
  109. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/deployments/steps/utility.py +0 -0
  110. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/docker/__init__.py +0 -0
  111. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/docker/docker_image.py +0 -0
  112. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/engine.py +0 -0
  113. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/__init__.py +0 -0
  114. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/actions.py +0 -0
  115. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/cli/__init__.py +0 -0
  116. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/cli/automations.py +0 -0
  117. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/clients.py +0 -0
  118. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/filters.py +0 -0
  119. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/related.py +0 -0
  120. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/schemas/__init__.py +0 -0
  121. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/schemas/automations.py +0 -0
  122. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/schemas/deployment_triggers.py +0 -0
  123. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/schemas/events.py +0 -0
  124. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/schemas/labelling.py +0 -0
  125. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/utilities.py +0 -0
  126. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/events/worker.py +0 -0
  127. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/exceptions.py +0 -0
  128. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/filesystems.py +0 -0
  129. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/flow_engine.py +0 -0
  130. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/flow_runs.py +0 -0
  131. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/infrastructure/__init__.py +0 -0
  132. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/infrastructure/base.py +0 -0
  133. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/infrastructure/provisioners/__init__.py +0 -0
  134. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/infrastructure/provisioners/cloud_run.py +0 -0
  135. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/infrastructure/provisioners/container_instance.py +0 -0
  136. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/infrastructure/provisioners/ecs.py +0 -0
  137. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/infrastructure/provisioners/modal.py +0 -0
  138. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/input/__init__.py +0 -0
  139. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/input/actions.py +0 -0
  140. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/input/run_input.py +0 -0
  141. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/locking/__init__.py +0 -0
  142. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/logging/__init__.py +0 -0
  143. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/logging/configuration.py +0 -0
  144. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/logging/filters.py +0 -0
  145. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/logging/formatters.py +0 -0
  146. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/logging/handlers.py +0 -0
  147. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/logging/highlighters.py +0 -0
  148. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/logging/loggers.py +0 -0
  149. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/logging/logging.yml +0 -0
  150. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/main.py +0 -0
  151. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/py.typed +0 -0
  152. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/records/__init__.py +0 -0
  153. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/records/base.py +0 -0
  154. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/records/filesystem.py +0 -0
  155. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/records/memory.py +0 -0
  156. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/records/result_store.py +0 -0
  157. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runner/__init__.py +0 -0
  158. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runner/runner.py +0 -0
  159. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runner/server.py +0 -0
  160. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runner/storage.py +0 -0
  161. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runner/submit.py +0 -0
  162. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runner/utils.py +0 -0
  163. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runtime/__init__.py +0 -0
  164. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runtime/deployment.py +0 -0
  165. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runtime/flow_run.py +0 -0
  166. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/runtime/task_run.py +0 -0
  167. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/serializers.py +0 -0
  168. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/server/api/collections_data/views/aggregate-worker-metadata.json +0 -0
  169. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/server/api/static/prefect-logo-mark-gradient.png +0 -0
  170. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/__init__.py +0 -0
  171. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/base.py +0 -0
  172. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/constants.py +0 -0
  173. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/context.py +0 -0
  174. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/legacy.py +0 -0
  175. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/__init__.py +0 -0
  176. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/api.py +0 -0
  177. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/cli.py +0 -0
  178. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/client.py +0 -0
  179. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/cloud.py +0 -0
  180. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/deployments.py +0 -0
  181. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/experiments.py +0 -0
  182. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/flows.py +0 -0
  183. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/internal.py +0 -0
  184. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/logging.py +0 -0
  185. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/results.py +0 -0
  186. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/root.py +0 -0
  187. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/runner.py +0 -0
  188. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/__init__.py +0 -0
  189. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/api.py +0 -0
  190. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/database.py +0 -0
  191. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/deployments.py +0 -0
  192. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/ephemeral.py +0 -0
  193. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/events.py +0 -0
  194. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/flow_run_graph.py +0 -0
  195. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/root.py +0 -0
  196. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/services.py +0 -0
  197. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/tasks.py +0 -0
  198. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/server/ui.py +0 -0
  199. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/tasks.py +0 -0
  200. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/testing.py +0 -0
  201. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/models/worker.py +0 -0
  202. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/profiles.py +0 -0
  203. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/profiles.toml +0 -0
  204. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/settings/sources.py +0 -0
  205. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/states.py +0 -0
  206. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/task_engine.py +0 -0
  207. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/task_runners.py +0 -0
  208. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/task_runs.py +0 -0
  209. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/task_worker.py +0 -0
  210. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/tasks.py +0 -0
  211. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/telemetry/__init__.py +0 -0
  212. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/telemetry/bootstrap.py +0 -0
  213. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/telemetry/instrumentation.py +0 -0
  214. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/telemetry/logging.py +0 -0
  215. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/telemetry/run_telemetry.py +0 -0
  216. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/transactions.py +0 -0
  217. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/types/__init__.py +0 -0
  218. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/types/entrypoint.py +0 -0
  219. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/__init__.py +0 -0
  220. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/_engine.py +0 -0
  221. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/annotations.py +0 -0
  222. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/asyncutils.py +0 -0
  223. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/callables.py +0 -0
  224. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/collections.py +0 -0
  225. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/compat.py +0 -0
  226. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/context.py +0 -0
  227. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/dispatch.py +0 -0
  228. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/dockerutils.py +0 -0
  229. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/engine.py +0 -0
  230. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/filesystem.py +0 -0
  231. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/hashing.py +0 -0
  232. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/importtools.py +0 -0
  233. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/math.py +0 -0
  234. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/names.py +0 -0
  235. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/processutils.py +0 -0
  236. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/pydantic.py +0 -0
  237. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/render_swagger.py +0 -0
  238. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/schema_tools/__init__.py +0 -0
  239. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/schema_tools/hydration.py +0 -0
  240. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/schema_tools/validation.py +0 -0
  241. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/services.py +0 -0
  242. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/slugify.py +0 -0
  243. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/templating.py +0 -0
  244. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/text.py +0 -0
  245. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/timeout.py +0 -0
  246. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/urls.py +0 -0
  247. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/utilities/visualization.py +0 -0
  248. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/variables.py +0 -0
  249. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/workers/base.py +0 -0
  250. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/workers/block.py +0 -0
  251. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/workers/cloud.py +0 -0
  252. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/workers/process.py +0 -0
  253. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/workers/server.py +0 -0
  254. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect/workers/utilities.py +0 -0
  255. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect_client.egg-info/SOURCES.txt +0 -0
  256. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect_client.egg-info/dependency_links.txt +0 -0
  257. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect_client.egg-info/requires.txt +0 -0
  258. {prefect-client-3.1.9 → prefect-client-3.1.10}/src/prefect_client.egg-info/top_level.txt +0 -0
  259. {prefect-client-3.1.9 → prefect-client-3.1.10}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prefect-client
3
- Version: 3.1.9
3
+ Version: 3.1.10
4
4
  Summary: Workflow orchestration and management.
5
5
  Home-page: https://www.prefect.io
6
6
  Author: Prefect Technologies, Inc.
@@ -15,7 +15,7 @@ pytest-benchmark
15
15
  pytest-cov
16
16
  pytest-env
17
17
  pytest-flakefinder
18
- pytest-mypy-plugins >= 3.1.0
18
+ pytest-mypy-plugins >= 3.2.0
19
19
  pytest-timeout
20
20
  pytest-xdist >= 3.6.1
21
21
  pyyaml
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-12-20T16:33:15-0500",
11
+ "date": "2024-12-24T22:58:40-0800",
12
12
  "dirty": true,
13
13
  "error": null,
14
- "full-revisionid": "e1fe79439b319ce5478aa5f8bd4e836ed4f8a0f5",
15
- "version": "3.1.9"
14
+ "full-revisionid": "b11b56fc6143df2bd4c7018f7a974dc656fe9aa3",
15
+ "version": "3.1.10"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -2,19 +2,20 @@
2
2
  Interface for creating and reading artifacts.
3
3
  """
4
4
 
5
- from __future__ import annotations
6
-
5
+ import asyncio
7
6
  import json # noqa: I001
8
7
  import math
9
8
  import warnings
10
- from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
9
+ from typing import TYPE_CHECKING, Any, Optional, Union
11
10
  from uuid import UUID
12
11
 
12
+ from typing_extensions import Self
13
+
13
14
  from prefect.client.schemas.actions import ArtifactCreate as ArtifactRequest
14
15
  from prefect.client.schemas.actions import ArtifactUpdate
15
16
  from prefect.client.schemas.filters import ArtifactFilter, ArtifactFilterKey
16
17
  from prefect.client.schemas.sorting import ArtifactSort
17
- from prefect.client.utilities import get_or_create_client, inject_client
18
+ from prefect.client.utilities import get_or_create_client
18
19
  from prefect.logging.loggers import get_logger
19
20
  from prefect.utilities.asyncutils import sync_compatible
20
21
  from prefect.utilities.context import get_task_and_flow_run_ids
@@ -22,8 +23,6 @@ from prefect.utilities.context import get_task_and_flow_run_ids
22
23
  logger = get_logger("artifacts")
23
24
 
24
25
  if TYPE_CHECKING:
25
- from typing_extensions import Self
26
-
27
26
  from prefect.client.orchestration import PrefectClient
28
27
  from prefect.client.schemas.objects import Artifact as ArtifactResponse
29
28
 
@@ -43,7 +42,7 @@ class Artifact(ArtifactRequest):
43
42
 
44
43
  @sync_compatible
45
44
  async def create(
46
- self: "Self",
45
+ self: Self,
47
46
  client: Optional["PrefectClient"] = None,
48
47
  ) -> "ArtifactResponse":
49
48
  """
@@ -95,16 +94,15 @@ class Artifact(ArtifactRequest):
95
94
  (ArtifactResponse, optional): The artifact (if found).
96
95
  """
97
96
  client, _ = get_or_create_client(client)
98
- return next(
99
- iter(
100
- await client.read_artifacts(
101
- limit=1,
102
- sort=ArtifactSort.UPDATED_DESC,
103
- artifact_filter=ArtifactFilter(key=ArtifactFilterKey(any_=[key])),
104
- )
97
+ filter_key_value = None if key is None else [key]
98
+ artifacts = await client.read_artifacts(
99
+ limit=1,
100
+ sort=ArtifactSort.UPDATED_DESC,
101
+ artifact_filter=ArtifactFilter(
102
+ key=ArtifactFilterKey(any_=filter_key_value)
105
103
  ),
106
- None,
107
104
  )
105
+ return None if not artifacts else artifacts[0]
108
106
 
109
107
  @classmethod
110
108
  @sync_compatible
@@ -112,10 +110,10 @@ class Artifact(ArtifactRequest):
112
110
  cls,
113
111
  key: Optional[str] = None,
114
112
  description: Optional[str] = None,
115
- data: Optional[Union[Dict[str, Any], Any]] = None,
113
+ data: Optional[Union[dict[str, Any], Any]] = None,
116
114
  client: Optional["PrefectClient"] = None,
117
115
  **kwargs: Any,
118
- ) -> Tuple["ArtifactResponse", bool]:
116
+ ) -> tuple["ArtifactResponse", bool]:
119
117
  """
120
118
  A method to get or create an artifact.
121
119
 
@@ -128,18 +126,20 @@ class Artifact(ArtifactRequest):
128
126
  Returns:
129
127
  (ArtifactResponse): The artifact, either retrieved or created.
130
128
  """
131
- artifact = await cls.get(key, client)
129
+ artifact_coro = cls.get(key, client)
130
+ if TYPE_CHECKING:
131
+ assert asyncio.iscoroutine(artifact_coro)
132
+ artifact = await artifact_coro
132
133
  if artifact:
133
134
  return artifact, False
134
- else:
135
- return (
136
- await cls(key=key, description=description, data=data, **kwargs).create(
137
- client
138
- ),
139
- True,
140
- )
141
135
 
142
- async def format(self) -> Optional[Union[Dict[str, Any], Any]]:
136
+ new_artifact = cls(key=key, description=description, data=data, **kwargs)
137
+ create_coro = new_artifact.create(client)
138
+ if TYPE_CHECKING:
139
+ assert asyncio.iscoroutine(create_coro)
140
+ return await create_coro, True
141
+
142
+ async def format(self) -> Optional[Union[dict[str, Any], Any]]:
143
143
  return json.dumps(self.data)
144
144
 
145
145
 
@@ -165,13 +165,13 @@ class MarkdownArtifact(Artifact):
165
165
 
166
166
 
167
167
  class TableArtifact(Artifact):
168
- table: Union[Dict[str, List[Any]], List[Dict[str, Any]], List[List[Any]]]
168
+ table: Union[dict[str, list[Any]], list[dict[str, Any]], list[list[Any]]]
169
169
  type: Optional[str] = "table"
170
170
 
171
171
  @classmethod
172
172
  def _sanitize(
173
- cls, item: Union[Dict[str, Any], List[Any], float]
174
- ) -> Union[Dict[str, Any], List[Any], int, float, None]:
173
+ cls, item: Union[dict[str, Any], list[Any], float]
174
+ ) -> Union[dict[str, Any], list[Any], int, float, None]:
175
175
  """
176
176
  Sanitize NaN values in a given item.
177
177
  The item can be a dict, list or float.
@@ -230,39 +230,6 @@ class ImageArtifact(Artifact):
230
230
  return self.image_url
231
231
 
232
232
 
233
- @inject_client
234
- async def _create_artifact(
235
- type: str,
236
- key: Optional[str] = None,
237
- description: Optional[str] = None,
238
- data: Optional[Union[Dict[str, Any], Any]] = None,
239
- client: Optional["PrefectClient"] = None,
240
- ) -> UUID:
241
- """
242
- Helper function to create an artifact.
243
-
244
- Arguments:
245
- type: A string identifying the type of artifact.
246
- key: A user-provided string identifier.
247
- The key must only contain lowercase letters, numbers, and dashes.
248
- description: A user-specified description of the artifact.
249
- data: A JSON payload that allows for a result to be retrieved.
250
- client: The PrefectClient
251
-
252
- Returns:
253
- - The table artifact ID.
254
- """
255
-
256
- artifact = await Artifact(
257
- type=type,
258
- key=key,
259
- description=description,
260
- data=data,
261
- ).create(client)
262
-
263
- return artifact.id
264
-
265
-
266
233
  @sync_compatible
267
234
  async def create_link_artifact(
268
235
  link: str,
@@ -286,12 +253,16 @@ async def create_link_artifact(
286
253
  Returns:
287
254
  The table artifact ID.
288
255
  """
289
- artifact = await LinkArtifact(
256
+ new_artifact = LinkArtifact(
290
257
  key=key,
291
258
  description=description,
292
259
  link=link,
293
260
  link_text=link_text,
294
- ).create(client)
261
+ )
262
+ create_coro = new_artifact.create(client)
263
+ if TYPE_CHECKING:
264
+ assert asyncio.iscoroutine(create_coro)
265
+ artifact = await create_coro
295
266
 
296
267
  return artifact.id
297
268
 
@@ -315,18 +286,22 @@ async def create_markdown_artifact(
315
286
  Returns:
316
287
  The table artifact ID.
317
288
  """
318
- artifact = await MarkdownArtifact(
289
+ new_artifact = MarkdownArtifact(
319
290
  key=key,
320
291
  description=description,
321
292
  markdown=markdown,
322
- ).create()
293
+ )
294
+ create_coro = new_artifact.create()
295
+ if TYPE_CHECKING:
296
+ assert asyncio.iscoroutine(create_coro)
297
+ artifact = await create_coro
323
298
 
324
299
  return artifact.id
325
300
 
326
301
 
327
302
  @sync_compatible
328
303
  async def create_table_artifact(
329
- table: Union[Dict[str, List[Any]], List[Dict[str, Any]], List[List[Any]]],
304
+ table: Union[dict[str, list[Any]], list[dict[str, Any]], list[list[Any]]],
330
305
  key: Optional[str] = None,
331
306
  description: Optional[str] = None,
332
307
  ) -> UUID:
@@ -344,11 +319,15 @@ async def create_table_artifact(
344
319
  The table artifact ID.
345
320
  """
346
321
 
347
- artifact = await TableArtifact(
322
+ new_artifact = TableArtifact(
348
323
  key=key,
349
324
  description=description,
350
325
  table=table,
351
- ).create()
326
+ )
327
+ create_coro = new_artifact.create()
328
+ if TYPE_CHECKING:
329
+ assert asyncio.iscoroutine(create_coro)
330
+ artifact = await create_coro
352
331
 
353
332
  return artifact.id
354
333
 
@@ -373,11 +352,15 @@ async def create_progress_artifact(
373
352
  The progress artifact ID.
374
353
  """
375
354
 
376
- artifact = await ProgressArtifact(
355
+ new_artifact = ProgressArtifact(
377
356
  key=key,
378
357
  description=description,
379
358
  progress=progress,
380
- ).create()
359
+ )
360
+ create_coro = new_artifact.create()
361
+ if TYPE_CHECKING:
362
+ assert asyncio.iscoroutine(create_coro)
363
+ artifact = await create_coro
381
364
 
382
365
  return artifact.id
383
366
 
@@ -387,7 +370,7 @@ async def update_progress_artifact(
387
370
  artifact_id: UUID,
388
371
  progress: float,
389
372
  description: Optional[str] = None,
390
- client: Optional[PrefectClient] = None,
373
+ client: Optional["PrefectClient"] = None,
391
374
  ) -> UUID:
392
375
  """
393
376
  Update a progress artifact.
@@ -444,10 +427,14 @@ async def create_image_artifact(
444
427
  The image artifact ID.
445
428
  """
446
429
 
447
- artifact = await ImageArtifact(
430
+ new_artifact = ImageArtifact(
448
431
  key=key,
449
432
  description=description,
450
433
  image_url=image_url,
451
- ).create()
434
+ )
435
+ create_coro = new_artifact.create()
436
+ if TYPE_CHECKING:
437
+ assert asyncio.iscoroutine(create_coro)
438
+ artifact = await create_coro
452
439
 
453
440
  return artifact.id
@@ -1,4 +1,4 @@
1
- from typing import Optional, Type
1
+ from typing import TYPE_CHECKING, Optional, overload
2
2
  from uuid import UUID
3
3
 
4
4
  from pydantic import Field
@@ -112,17 +112,28 @@ class Automation(AutomationCore):
112
112
  auto.name = "new name"
113
113
  auto.update()
114
114
  """
115
+ assert self.id is not None
115
116
  async with get_client() as client:
116
117
  automation = AutomationCore(
117
118
  **self.model_dump(exclude={"id", "owner_resource"})
118
119
  )
119
120
  await client.update_automation(automation_id=self.id, automation=automation)
120
121
 
122
+ @overload
123
+ @classmethod
124
+ async def read(cls, id: UUID, name: Optional[str] = ...) -> Self:
125
+ ...
126
+
127
+ @overload
128
+ @classmethod
129
+ async def read(cls, id: None = None, name: str = ...) -> Optional[Self]:
130
+ ...
131
+
121
132
  @classmethod
122
133
  @sync_compatible
123
134
  async def read(
124
- cls: Type[Self], id: Optional[UUID] = None, name: Optional[str] = None
125
- ) -> Self:
135
+ cls, id: Optional[UUID] = None, name: Optional[str] = None
136
+ ) -> Optional[Self]:
126
137
  """
127
138
  Read an automation by ID or name.
128
139
  automation = Automation.read(name="woodchonk")
@@ -145,13 +156,13 @@ class Automation(AutomationCore):
145
156
  raise
146
157
  if automation is None:
147
158
  raise ValueError(f"Automation with ID {id!r} not found")
148
- return Automation(**automation.model_dump())
159
+ return cls(**automation.model_dump())
149
160
  else:
161
+ if TYPE_CHECKING:
162
+ assert name is not None
150
163
  automation = await client.read_automations_by_name(name=name)
151
164
  if len(automation) > 0:
152
- return (
153
- Automation(**automation[0].model_dump()) if automation else None
154
- )
165
+ return cls(**automation[0].model_dump()) if automation else None
155
166
  else:
156
167
  raise ValueError(f"Automation with name {name!r} not found")
157
168
 
@@ -161,6 +172,9 @@ class Automation(AutomationCore):
161
172
  auto = Automation.read(id = 123)
162
173
  auto.delete()
163
174
  """
175
+ if self.id is None:
176
+ raise ValueError("Can't delete an automation without an id")
177
+
164
178
  async with get_client() as client:
165
179
  try:
166
180
  await client.delete_automation(self.id)
@@ -177,6 +191,9 @@ class Automation(AutomationCore):
177
191
  auto = Automation.read(id = 123)
178
192
  auto.disable()
179
193
  """
194
+ if self.id is None:
195
+ raise ValueError("Can't disable an automation without an id")
196
+
180
197
  async with get_client() as client:
181
198
  try:
182
199
  await client.pause_automation(self.id)
@@ -193,6 +210,9 @@ class Automation(AutomationCore):
193
210
  auto = Automation.read(id = 123)
194
211
  auto.enable()
195
212
  """
213
+ if self.id is None:
214
+ raise ValueError("Can't enable an automation without an id")
215
+
196
216
  async with get_client() as client:
197
217
  try:
198
218
  await client.resume_automation(self.id)
@@ -9,21 +9,10 @@ For more user-accessible information about the current run, see [`prefect.runtim
9
9
  import os
10
10
  import sys
11
11
  import warnings
12
+ from collections.abc import AsyncGenerator, Generator, Mapping
12
13
  from contextlib import ExitStack, asynccontextmanager, contextmanager
13
14
  from contextvars import ContextVar, Token
14
- from typing import (
15
- TYPE_CHECKING,
16
- Any,
17
- AsyncGenerator,
18
- Dict,
19
- Generator,
20
- Mapping,
21
- Optional,
22
- Set,
23
- Type,
24
- TypeVar,
25
- Union,
26
- )
15
+ from typing import TYPE_CHECKING, Any, Optional, TypeVar, Union
27
16
 
28
17
  from pydantic import BaseModel, ConfigDict, Field, PrivateAttr
29
18
  from typing_extensions import Self
@@ -64,7 +53,7 @@ if TYPE_CHECKING:
64
53
  GLOBAL_SETTINGS_CONTEXT = None # type: ignore
65
54
 
66
55
 
67
- def serialize_context() -> Dict[str, Any]:
56
+ def serialize_context() -> dict[str, Any]:
68
57
  """
69
58
  Serialize the current context for use in a remote execution environment.
70
59
  """
@@ -84,7 +73,7 @@ def serialize_context() -> Dict[str, Any]:
84
73
 
85
74
  @contextmanager
86
75
  def hydrated_context(
87
- serialized_context: Optional[Dict[str, Any]] = None,
76
+ serialized_context: Optional[dict[str, Any]] = None,
88
77
  client: Union[PrefectClient, SyncPrefectClient, None] = None,
89
78
  ):
90
79
  with ExitStack() as stack:
@@ -148,7 +137,7 @@ class ContextModel(BaseModel):
148
137
  self._token = None
149
138
 
150
139
  @classmethod
151
- def get(cls: Type[Self]) -> Optional[Self]:
140
+ def get(cls: type[Self]) -> Optional[Self]:
152
141
  """Get the current context instance"""
153
142
  return cls.__var__.get(None)
154
143
 
@@ -173,7 +162,7 @@ class ContextModel(BaseModel):
173
162
  new._token = None
174
163
  return new
175
164
 
176
- def serialize(self, include_secrets: bool = True) -> Dict[str, Any]:
165
+ def serialize(self, include_secrets: bool = True) -> dict[str, Any]:
177
166
  """
178
167
  Serialize the context model to a dictionary that can be pickled with cloudpickle.
179
168
  """
@@ -314,10 +303,10 @@ class RunContext(ContextModel):
314
303
  start_client_metrics_server()
315
304
 
316
305
  start_time: DateTime = Field(default_factory=lambda: DateTime.now("UTC"))
317
- input_keyset: Optional[Dict[str, Dict[str, str]]] = None
306
+ input_keyset: Optional[dict[str, dict[str, str]]] = None
318
307
  client: Union[PrefectClient, SyncPrefectClient]
319
308
 
320
- def serialize(self: Self, include_secrets: bool = True) -> Dict[str, Any]:
309
+ def serialize(self: Self, include_secrets: bool = True) -> dict[str, Any]:
321
310
  return self.model_dump(
322
311
  include={"start_time", "input_keyset"},
323
312
  exclude_unset=True,
@@ -344,7 +333,7 @@ class EngineContext(RunContext):
344
333
  flow_run: Optional[FlowRun] = None
345
334
  task_runner: TaskRunner[Any]
346
335
  log_prints: bool = False
347
- parameters: Optional[Dict[str, Any]] = None
336
+ parameters: Optional[dict[str, Any]] = None
348
337
 
349
338
  # Flag signaling if the flow run context has been serialized and sent
350
339
  # to remote infrastructure.
@@ -355,10 +344,10 @@ class EngineContext(RunContext):
355
344
  persist_result: bool = Field(default_factory=get_default_persist_setting)
356
345
 
357
346
  # Counter for task calls allowing unique
358
- task_run_dynamic_keys: Dict[str, Union[str, int]] = Field(default_factory=dict)
347
+ task_run_dynamic_keys: dict[str, Union[str, int]] = Field(default_factory=dict)
359
348
 
360
349
  # Counter for flow pauses
361
- observed_flow_pauses: Dict[str, int] = Field(default_factory=dict)
350
+ observed_flow_pauses: dict[str, int] = Field(default_factory=dict)
362
351
 
363
352
  # Tracking for result from task runs in this flow run for dependency tracking
364
353
  # Holds the ID of the object returned by the task run and task run state
@@ -369,7 +358,7 @@ class EngineContext(RunContext):
369
358
 
370
359
  __var__: ContextVar[Self] = ContextVar("flow_run")
371
360
 
372
- def serialize(self: Self, include_secrets: bool = True) -> Dict[str, Any]:
361
+ def serialize(self: Self, include_secrets: bool = True) -> dict[str, Any]:
373
362
  return self.model_dump(
374
363
  include={
375
364
  "flow_run",
@@ -403,7 +392,7 @@ class TaskRunContext(RunContext):
403
392
  task: "Task[Any, Any]"
404
393
  task_run: TaskRun
405
394
  log_prints: bool = False
406
- parameters: Dict[str, Any]
395
+ parameters: dict[str, Any]
407
396
 
408
397
  # Result handling
409
398
  result_store: ResultStore
@@ -411,7 +400,7 @@ class TaskRunContext(RunContext):
411
400
 
412
401
  __var__ = ContextVar("task_run")
413
402
 
414
- def serialize(self: Self, include_secrets: bool = True) -> Dict[str, Any]:
403
+ def serialize(self: Self, include_secrets: bool = True) -> dict[str, Any]:
415
404
  return self.model_dump(
416
405
  include={
417
406
  "task_run",
@@ -437,7 +426,7 @@ class TagsContext(ContextModel):
437
426
  current_tags: A set of current tags in the context
438
427
  """
439
428
 
440
- current_tags: Set[str] = Field(default_factory=set)
429
+ current_tags: set[str] = Field(default_factory=set)
441
430
 
442
431
  @classmethod
443
432
  def get(cls) -> "TagsContext":
@@ -512,7 +501,7 @@ def get_settings_context() -> SettingsContext:
512
501
 
513
502
 
514
503
  @contextmanager
515
- def tags(*new_tags: str) -> Generator[Set[str], None, None]:
504
+ def tags(*new_tags: str) -> Generator[set[str], None, None]:
516
505
  """
517
506
  Context manager to add tags to flow and task run calls.
518
507
 
@@ -37,7 +37,6 @@ from typing import (
37
37
  from uuid import UUID
38
38
 
39
39
  import pydantic
40
- from fastapi.encoders import jsonable_encoder
41
40
  from pydantic.v1 import BaseModel as V1BaseModel
42
41
  from pydantic.v1.decorator import ValidatedFunction as V1ValidatedFunction
43
42
  from pydantic.v1.errors import ConfigError # TODO
@@ -613,6 +612,8 @@ class Flow(Generic[P, R]):
613
612
  serialized_parameters[key] = f"<{type(value).__name__}>"
614
613
  continue
615
614
  try:
615
+ from fastapi.encoders import jsonable_encoder
616
+
616
617
  serialized_parameters[key] = jsonable_encoder(value)
617
618
  except (TypeError, ValueError):
618
619
  logger.debug(