ob-metaflow-stubs 6.0.3.183rc0__py2.py3-none-any.whl → 6.0.3.183rc1__py2.py3-none-any.whl

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 (220) hide show
  1. metaflow-stubs/__init__.pyi +637 -637
  2. metaflow-stubs/cards.pyi +1 -1
  3. metaflow-stubs/cli.pyi +1 -1
  4. metaflow-stubs/cli_components/__init__.pyi +1 -1
  5. metaflow-stubs/cli_components/utils.pyi +1 -1
  6. metaflow-stubs/client/__init__.pyi +1 -1
  7. metaflow-stubs/client/core.pyi +3 -3
  8. metaflow-stubs/client/filecache.pyi +1 -1
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +1 -1
  11. metaflow-stubs/flowspec.pyi +3 -3
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +1 -1
  14. metaflow-stubs/info_file.pyi +1 -1
  15. metaflow-stubs/metadata_provider/__init__.pyi +1 -1
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +1 -1
  17. metaflow-stubs/metadata_provider/metadata.pyi +1 -1
  18. metaflow-stubs/metadata_provider/util.pyi +1 -1
  19. metaflow-stubs/metaflow_config.pyi +1 -1
  20. metaflow-stubs/metaflow_current.pyi +24 -24
  21. metaflow-stubs/metaflow_git.pyi +1 -1
  22. metaflow-stubs/mf_extensions/__init__.pyi +1 -1
  23. metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +1 -1
  24. metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +1 -1
  25. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +1 -1
  26. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +1 -1
  27. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +1 -1
  28. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +1 -1
  29. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +1 -1
  30. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +1 -1
  31. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +1 -1
  32. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +2 -2
  33. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +1 -1
  34. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +3 -3
  35. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +1 -1
  36. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +3 -3
  37. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +3 -3
  38. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +1 -1
  39. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +1 -1
  40. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +1 -1
  41. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +1 -1
  42. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/context.pyi +1 -1
  43. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +1 -1
  44. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +1 -1
  45. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +1 -1
  46. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +1 -1
  47. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +1 -1
  48. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +1 -1
  49. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +1 -1
  50. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +1 -1
  51. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +1 -1
  52. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +1 -1
  53. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +1 -1
  54. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +1 -1
  55. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +1 -1
  56. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +1 -1
  57. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +1 -1
  58. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +1 -1
  59. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +1 -1
  60. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +1 -1
  61. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +1 -1
  62. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +1 -1
  63. metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +1 -1
  64. metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +1 -1
  65. metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +1 -1
  66. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/__init__.pyi +1 -1
  67. metaflow-stubs/mf_extensions/outerbounds/plugins/aws/assume_role_decorator.pyi +1 -1
  68. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +1 -1
  69. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/async_cards.pyi +2 -2
  70. metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +1 -1
  71. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +1 -1
  72. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +1 -1
  73. metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +1 -1
  74. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/__init__.pyi +1 -1
  75. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/baker.pyi +1 -1
  76. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/docker_environment.pyi +1 -1
  77. metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/fast_bakery.pyi +1 -1
  78. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/__init__.pyi +1 -1
  79. metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/pod_killer.pyi +1 -1
  80. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +1 -1
  81. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/constants.pyi +1 -1
  82. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/exceptions.pyi +1 -1
  83. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +1 -1
  84. metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/status_card.pyi +1 -1
  85. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +1 -1
  86. metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +1 -1
  87. metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +1 -1
  88. metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +1 -1
  89. metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +1 -1
  90. metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +1 -1
  91. metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +1 -1
  92. metaflow-stubs/multicore_utils.pyi +1 -1
  93. metaflow-stubs/ob_internal.pyi +1 -1
  94. metaflow-stubs/parameters.pyi +1 -1
  95. metaflow-stubs/plugins/__init__.pyi +11 -11
  96. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  97. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  98. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  99. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  100. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
  101. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +1 -1
  102. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +1 -1
  103. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  104. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  105. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  106. metaflow-stubs/plugins/argo/argo_workflows.pyi +1 -1
  107. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +1 -1
  108. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
  109. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
  110. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  111. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  112. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  113. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  114. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  115. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  116. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +1 -1
  117. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  118. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +1 -1
  119. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  120. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  121. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  122. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  123. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  124. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  125. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +1 -1
  126. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  127. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  128. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  129. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +1 -1
  130. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  131. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  132. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  133. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  134. metaflow-stubs/plugins/cards/card_client.pyi +1 -1
  135. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  136. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  137. metaflow-stubs/plugins/cards/card_decorator.pyi +1 -1
  138. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  139. metaflow-stubs/plugins/cards/card_modules/basic.pyi +1 -1
  140. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  141. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  142. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  143. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  144. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
  145. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  146. metaflow-stubs/plugins/cards/component_serializer.pyi +1 -1
  147. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  148. metaflow-stubs/plugins/catch_decorator.pyi +1 -1
  149. metaflow-stubs/plugins/datatools/__init__.pyi +1 -1
  150. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  151. metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
  152. metaflow-stubs/plugins/datatools/s3/s3.pyi +2 -2
  153. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  154. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  155. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  156. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  157. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  158. metaflow-stubs/plugins/events_decorator.pyi +1 -1
  159. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  160. metaflow-stubs/plugins/frameworks/pytorch.pyi +1 -1
  161. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  162. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +1 -1
  163. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  164. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  165. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  166. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  167. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  168. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +1 -1
  169. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +1 -1
  170. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  171. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +1 -1
  172. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
  173. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +1 -1
  174. metaflow-stubs/plugins/ollama/__init__.pyi +1 -1
  175. metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
  176. metaflow-stubs/plugins/perimeters.pyi +1 -1
  177. metaflow-stubs/plugins/project_decorator.pyi +1 -1
  178. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  179. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  180. metaflow-stubs/plugins/pypi/conda_environment.pyi +2 -2
  181. metaflow-stubs/plugins/pypi/parsers.pyi +1 -1
  182. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  183. metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
  184. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  185. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  186. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  187. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  188. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +1 -1
  189. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  190. metaflow-stubs/plugins/snowflake/__init__.pyi +1 -1
  191. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  192. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  193. metaflow-stubs/plugins/timeout_decorator.pyi +1 -1
  194. metaflow-stubs/plugins/torchtune/__init__.pyi +1 -1
  195. metaflow-stubs/plugins/uv/__init__.pyi +1 -1
  196. metaflow-stubs/plugins/uv/uv_environment.pyi +1 -1
  197. metaflow-stubs/profilers/__init__.pyi +1 -1
  198. metaflow-stubs/pylint_wrapper.pyi +1 -1
  199. metaflow-stubs/runner/__init__.pyi +1 -1
  200. metaflow-stubs/runner/deployer.pyi +2 -2
  201. metaflow-stubs/runner/deployer_impl.pyi +2 -2
  202. metaflow-stubs/runner/metaflow_runner.pyi +2 -2
  203. metaflow-stubs/runner/nbdeploy.pyi +1 -1
  204. metaflow-stubs/runner/nbrun.pyi +1 -1
  205. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  206. metaflow-stubs/runner/utils.pyi +2 -2
  207. metaflow-stubs/system/__init__.pyi +1 -1
  208. metaflow-stubs/system/system_logger.pyi +2 -2
  209. metaflow-stubs/system/system_monitor.pyi +1 -1
  210. metaflow-stubs/tagging_util.pyi +1 -1
  211. metaflow-stubs/tuple_util.pyi +1 -1
  212. metaflow-stubs/user_configs/__init__.pyi +1 -1
  213. metaflow-stubs/user_configs/config_decorators.pyi +4 -4
  214. metaflow-stubs/user_configs/config_options.pyi +1 -1
  215. metaflow-stubs/user_configs/config_parameters.pyi +6 -6
  216. {ob_metaflow_stubs-6.0.3.183rc0.dist-info → ob_metaflow_stubs-6.0.3.183rc1.dist-info}/METADATA +1 -1
  217. ob_metaflow_stubs-6.0.3.183rc1.dist-info/RECORD +220 -0
  218. ob_metaflow_stubs-6.0.3.183rc0.dist-info/RECORD +0 -220
  219. {ob_metaflow_stubs-6.0.3.183rc0.dist-info → ob_metaflow_stubs-6.0.3.183rc1.dist-info}/WHEEL +0 -0
  220. {ob_metaflow_stubs-6.0.3.183rc0.dist-info → ob_metaflow_stubs-6.0.3.183rc1.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.15.18.1+obcheckpoint(0.2.1);ob(v1) #
4
- # Generated on 2025-06-20T20:53:54.419355 #
4
+ # Generated on 2025-06-23T21:15:44.995494 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import datetime
12
11
  import typing
12
+ import datetime
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
@@ -35,10 +35,10 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
35
35
  from .user_configs.config_parameters import config_expr as config_expr
36
36
  from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
37
37
  from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
38
- from . import tuple_util as tuple_util
38
+ from . import events as events
39
39
  from . import cards as cards
40
40
  from . import metaflow_git as metaflow_git
41
- from . import events as events
41
+ from . import tuple_util as tuple_util
42
42
  from . import runner as runner
43
43
  from . import plugins as plugins
44
44
  from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
@@ -155,23 +155,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
155
155
  """
156
156
  ...
157
157
 
158
- @typing.overload
159
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
160
- """
161
- Internal decorator to support Fast bakery
162
- """
163
- ...
164
-
165
- @typing.overload
166
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
167
- ...
168
-
169
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
170
- """
171
- Internal decorator to support Fast bakery
172
- """
173
- ...
174
-
175
158
  @typing.overload
176
159
  def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
177
160
  """
@@ -207,63 +190,6 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
207
190
  """
208
191
  ...
209
192
 
210
- @typing.overload
211
- def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
212
- """
213
- Enables loading / saving of models within a step.
214
-
215
-
216
-
217
- Parameters
218
- ----------
219
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
220
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
221
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
222
- - `current.checkpoint`
223
- - `current.model`
224
- - `current.huggingface_hub`
225
-
226
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
227
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
228
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
229
-
230
- temp_dir_root : str, default: None
231
- The root directory under which `current.model.loaded` will store loaded models
232
- """
233
- ...
234
-
235
- @typing.overload
236
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
237
- ...
238
-
239
- @typing.overload
240
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
241
- ...
242
-
243
- def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
244
- """
245
- Enables loading / saving of models within a step.
246
-
247
-
248
-
249
- Parameters
250
- ----------
251
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
252
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
253
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
254
- - `current.checkpoint`
255
- - `current.model`
256
- - `current.huggingface_hub`
257
-
258
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
259
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
260
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
261
-
262
- temp_dir_root : str, default: None
263
- The root directory under which `current.model.loaded` will store loaded models
264
- """
265
- ...
266
-
267
193
  @typing.overload
268
194
  def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
269
195
  """
@@ -412,89 +338,6 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
412
338
  """
413
339
  ...
414
340
 
415
- @typing.overload
416
- def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
417
- """
418
- Creates a human-readable report, a Metaflow Card, after this step completes.
419
-
420
- Note that you may add multiple `@card` decorators in a step with different parameters.
421
-
422
-
423
- Parameters
424
- ----------
425
- type : str, default 'default'
426
- Card type.
427
- id : str, optional, default None
428
- If multiple cards are present, use this id to identify this card.
429
- options : Dict[str, Any], default {}
430
- Options passed to the card. The contents depend on the card type.
431
- timeout : int, default 45
432
- Interrupt reporting if it takes more than this many seconds.
433
- """
434
- ...
435
-
436
- @typing.overload
437
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
438
- ...
439
-
440
- @typing.overload
441
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
442
- ...
443
-
444
- def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
445
- """
446
- Creates a human-readable report, a Metaflow Card, after this step completes.
447
-
448
- Note that you may add multiple `@card` decorators in a step with different parameters.
449
-
450
-
451
- Parameters
452
- ----------
453
- type : str, default 'default'
454
- Card type.
455
- id : str, optional, default None
456
- If multiple cards are present, use this id to identify this card.
457
- options : Dict[str, Any], default {}
458
- Options passed to the card. The contents depend on the card type.
459
- timeout : int, default 45
460
- Interrupt reporting if it takes more than this many seconds.
461
- """
462
- ...
463
-
464
- def app_deploy(*, app_port: int, app_name: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
465
- """
466
- Specifies that this step is used to deploy an instance of the app.
467
- Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
468
-
469
-
470
- Parameters
471
- ----------
472
- app_port : int
473
- Number of GPUs to use.
474
- app_name : str
475
- Name of the app to deploy.
476
- """
477
- ...
478
-
479
- @typing.overload
480
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
481
- """
482
- Decorator prototype for all step decorators. This function gets specialized
483
- and imported for all decorators types by _import_plugin_decorators().
484
- """
485
- ...
486
-
487
- @typing.overload
488
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
489
- ...
490
-
491
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
492
- """
493
- Decorator prototype for all step decorators. This function gets specialized
494
- and imported for all decorators types by _import_plugin_decorators().
495
- """
496
- ...
497
-
498
341
  @typing.overload
499
342
  def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
500
343
  """
@@ -574,155 +417,123 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
574
417
  """
575
418
  ...
576
419
 
577
- @typing.overload
578
- def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
420
+ def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
579
421
  """
580
- Specifies the Conda environment for the step.
581
-
582
- Information in this decorator will augment any
583
- attributes set in the `@conda_base` flow-level decorator. Hence,
584
- you can use `@conda_base` to set packages required by all
585
- steps and use `@conda` to specify step-specific overrides.
422
+ Specifies that this step should execute on DGX cloud.
586
423
 
587
424
 
588
425
  Parameters
589
426
  ----------
590
- packages : Dict[str, str], default {}
591
- Packages to use for this step. The key is the name of the package
592
- and the value is the version to use.
593
- libraries : Dict[str, str], default {}
594
- Supported for backward compatibility. When used with packages, packages will take precedence.
595
- python : str, optional, default None
596
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
597
- that the version used will correspond to the version of the Python interpreter used to start the run.
598
- disabled : bool, default False
599
- If set to True, disables @conda.
427
+ gpu : int
428
+ Number of GPUs to use.
429
+ gpu_type : str
430
+ Type of Nvidia GPU to use.
600
431
  """
601
432
  ...
602
433
 
603
- @typing.overload
604
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
605
- ...
606
-
607
- @typing.overload
608
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
609
- ...
610
-
611
- def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
434
+ def vllm(*, model: str, backend: str, debug: bool, kwargs: typing.Any) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
612
435
  """
613
- Specifies the Conda environment for the step.
436
+ This decorator is used to run vllm APIs as Metaflow task sidecars.
614
437
 
615
- Information in this decorator will augment any
616
- attributes set in the `@conda_base` flow-level decorator. Hence,
617
- you can use `@conda_base` to set packages required by all
618
- steps and use `@conda` to specify step-specific overrides.
438
+ User code call
439
+ --------------
440
+ @vllm(
441
+ model="...",
442
+ ...
443
+ )
444
+
445
+ Valid backend options
446
+ ---------------------
447
+ - 'local': Run as a separate process on the local task machine.
448
+
449
+ Valid model options
450
+ -------------------
451
+ Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
452
+
453
+ NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
454
+ If you need multiple models, you must create multiple @vllm decorators.
619
455
 
620
456
 
621
457
  Parameters
622
458
  ----------
623
- packages : Dict[str, str], default {}
624
- Packages to use for this step. The key is the name of the package
625
- and the value is the version to use.
626
- libraries : Dict[str, str], default {}
627
- Supported for backward compatibility. When used with packages, packages will take precedence.
628
- python : str, optional, default None
629
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
630
- that the version used will correspond to the version of the Python interpreter used to start the run.
631
- disabled : bool, default False
632
- If set to True, disables @conda.
459
+ model: str
460
+ HuggingFace model identifier to be served by vLLM.
461
+ backend: str
462
+ Determines where and how to run the vLLM process.
463
+ debug: bool
464
+ Whether to turn on verbose debugging logs.
465
+ kwargs : Any
466
+ Any other keyword arguments are passed directly to the vLLM engine.
467
+ This allows for flexible configuration of vLLM server settings.
468
+ For example, `tensor_parallel_size=2`.
633
469
  """
634
470
  ...
635
471
 
636
472
  @typing.overload
637
- def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
473
+ def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
638
474
  """
639
- Specifies the number of times the task corresponding
640
- to a step needs to be retried.
641
-
642
- This decorator is useful for handling transient errors, such as networking issues.
643
- If your task contains operations that can't be retried safely, e.g. database updates,
644
- it is advisable to annotate it with `@retry(times=0)`.
475
+ Specifies that the step will success under all circumstances.
645
476
 
646
- This can be used in conjunction with the `@catch` decorator. The `@catch`
647
- decorator will execute a no-op task after all retries have been exhausted,
648
- ensuring that the flow execution can continue.
477
+ The decorator will create an optional artifact, specified by `var`, which
478
+ contains the exception raised. You can use it to detect the presence
479
+ of errors, indicating that all happy-path artifacts produced by the step
480
+ are missing.
649
481
 
650
482
 
651
483
  Parameters
652
484
  ----------
653
- times : int, default 3
654
- Number of times to retry this task.
655
- minutes_between_retries : int, default 2
656
- Number of minutes between retries.
485
+ var : str, optional, default None
486
+ Name of the artifact in which to store the caught exception.
487
+ If not specified, the exception is not stored.
488
+ print_exception : bool, default True
489
+ Determines whether or not the exception is printed to
490
+ stdout when caught.
657
491
  """
658
492
  ...
659
493
 
660
494
  @typing.overload
661
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
495
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
662
496
  ...
663
497
 
664
498
  @typing.overload
665
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
499
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
666
500
  ...
667
501
 
668
- def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
502
+ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
669
503
  """
670
- Specifies the number of times the task corresponding
671
- to a step needs to be retried.
672
-
673
- This decorator is useful for handling transient errors, such as networking issues.
674
- If your task contains operations that can't be retried safely, e.g. database updates,
675
- it is advisable to annotate it with `@retry(times=0)`.
504
+ Specifies that the step will success under all circumstances.
676
505
 
677
- This can be used in conjunction with the `@catch` decorator. The `@catch`
678
- decorator will execute a no-op task after all retries have been exhausted,
679
- ensuring that the flow execution can continue.
506
+ The decorator will create an optional artifact, specified by `var`, which
507
+ contains the exception raised. You can use it to detect the presence
508
+ of errors, indicating that all happy-path artifacts produced by the step
509
+ are missing.
680
510
 
681
511
 
682
512
  Parameters
683
513
  ----------
684
- times : int, default 3
685
- Number of times to retry this task.
686
- minutes_between_retries : int, default 2
687
- Number of minutes between retries.
514
+ var : str, optional, default None
515
+ Name of the artifact in which to store the caught exception.
516
+ If not specified, the exception is not stored.
517
+ print_exception : bool, default True
518
+ Determines whether or not the exception is printed to
519
+ stdout when caught.
688
520
  """
689
521
  ...
690
522
 
691
- def vllm(*, model: str, backend: str, debug: bool, kwargs: typing.Any) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
523
+ @typing.overload
524
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
692
525
  """
693
- This decorator is used to run vllm APIs as Metaflow task sidecars.
694
-
695
- User code call
696
- --------------
697
- @vllm(
698
- model="...",
699
- ...
700
- )
701
-
702
- Valid backend options
703
- ---------------------
704
- - 'local': Run as a separate process on the local task machine.
705
-
706
- Valid model options
707
- -------------------
708
- Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
709
-
710
- NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
711
- If you need multiple models, you must create multiple @vllm decorators.
712
-
713
-
714
- Parameters
715
- ----------
716
- model: str
717
- HuggingFace model identifier to be served by vLLM.
718
- backend: str
719
- Determines where and how to run the vLLM process.
720
- debug: bool
721
- Whether to turn on verbose debugging logs.
722
- kwargs : Any
723
- Any other keyword arguments are passed directly to the vLLM engine.
724
- This allows for flexible configuration of vLLM server settings.
725
- For example, `tensor_parallel_size=2`.
526
+ Internal decorator to support Fast bakery
527
+ """
528
+ ...
529
+
530
+ @typing.overload
531
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
532
+ ...
533
+
534
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
535
+ """
536
+ Internal decorator to support Fast bakery
726
537
  """
727
538
  ...
728
539
 
@@ -777,101 +588,135 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
777
588
  """
778
589
  ...
779
590
 
780
- def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], None]) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
591
+ def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
781
592
  """
782
- Decorator that helps cache, version and store models/datasets from huggingface hub.
593
+ Specifies that this step should execute on DGX cloud.
783
594
 
784
595
 
785
596
  Parameters
786
597
  ----------
787
- temp_dir_root : str, optional
788
- The root directory that will hold the temporary directory where objects will be downloaded.
789
-
790
- load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
791
- The list of repos (models/datasets) to load.
792
-
793
- Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
794
-
795
- - If repo (model/dataset) is not found in the datastore:
796
- - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
797
- - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
798
- - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
799
-
800
- - If repo is found in the datastore:
801
- - Loads it directly from datastore to local path (can be temporary directory or specified path)
598
+ gpu : int
599
+ Number of GPUs to use.
600
+ gpu_type : str
601
+ Type of Nvidia GPU to use.
602
+ queue_timeout : int
603
+ Time to keep the job in NVCF's queue.
802
604
  """
803
605
  ...
804
606
 
805
- def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
607
+ def app_deploy(*, app_port: int, app_name: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
806
608
  """
807
- Specifies that this step should execute on DGX cloud.
609
+ Specifies that this step is used to deploy an instance of the app.
610
+ Requires that self.app_name, self.app_port, self.entrypoint and self.deployDir is set.
808
611
 
809
612
 
810
613
  Parameters
811
614
  ----------
812
- gpu : int
615
+ app_port : int
813
616
  Number of GPUs to use.
814
- gpu_type : str
815
- Type of Nvidia GPU to use.
617
+ app_name : str
618
+ Name of the app to deploy.
816
619
  """
817
620
  ...
818
621
 
819
- def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy: str, force_cache_update: bool, debug: bool, circuit_breaker_config: dict, timeout_config: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
622
+ @typing.overload
623
+ def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
820
624
  """
821
- This decorator is used to run Ollama APIs as Metaflow task sidecars.
625
+ Enables loading / saving of models within a step.
822
626
 
823
- User code call
824
- --------------
825
- @ollama(
826
- models=[...],
827
- ...
828
- )
829
627
 
830
- Valid backend options
831
- ---------------------
832
- - 'local': Run as a separate process on the local task machine.
833
- - (TODO) 'managed': Outerbounds hosts and selects compute provider.
834
- - (TODO) 'remote': Spin up separate instance to serve Ollama models.
835
628
 
836
- Valid model options
837
- -------------------
838
- Any model here https://ollama.com/search, e.g. 'llama3.2', 'llama3.3'
629
+ Parameters
630
+ ----------
631
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
632
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
633
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
634
+ - `current.checkpoint`
635
+ - `current.model`
636
+ - `current.huggingface_hub`
637
+
638
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
639
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
640
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
641
+
642
+ temp_dir_root : str, default: None
643
+ The root directory under which `current.model.loaded` will store loaded models
644
+ """
645
+ ...
646
+
647
+ @typing.overload
648
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
649
+ ...
650
+
651
+ @typing.overload
652
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
653
+ ...
654
+
655
+ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
656
+ """
657
+ Enables loading / saving of models within a step.
658
+
839
659
 
840
660
 
841
661
  Parameters
842
662
  ----------
843
- models: list[str]
844
- List of Ollama containers running models in sidecars.
845
- backend: str
846
- Determines where and how to run the Ollama process.
847
- force_pull: bool
848
- Whether to run `ollama pull` no matter what, or first check the remote cache in Metaflow datastore for this model key.
849
- cache_update_policy: str
850
- Cache update policy: "auto", "force", or "never".
851
- force_cache_update: bool
852
- Simple override for "force" cache update policy.
853
- debug: bool
854
- Whether to turn on verbose debugging logs.
855
- circuit_breaker_config: dict
856
- Configuration for circuit breaker protection. Keys: failure_threshold, recovery_timeout, reset_timeout.
857
- timeout_config: dict
858
- Configuration for various operation timeouts. Keys: pull, stop, health_check, install, server_startup.
663
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
664
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
665
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
666
+ - `current.checkpoint`
667
+ - `current.model`
668
+ - `current.huggingface_hub`
669
+
670
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
671
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
672
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
673
+
674
+ temp_dir_root : str, default: None
675
+ The root directory under which `current.model.loaded` will store loaded models
859
676
  """
860
677
  ...
861
678
 
862
- def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
679
+ @typing.overload
680
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
863
681
  """
864
- Specifies that this step should execute on DGX cloud.
682
+ Decorator prototype for all step decorators. This function gets specialized
683
+ and imported for all decorators types by _import_plugin_decorators().
684
+ """
685
+ ...
686
+
687
+ @typing.overload
688
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
689
+ ...
690
+
691
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
692
+ """
693
+ Decorator prototype for all step decorators. This function gets specialized
694
+ and imported for all decorators types by _import_plugin_decorators().
695
+ """
696
+ ...
697
+
698
+ def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], None]) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
699
+ """
700
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
865
701
 
866
702
 
867
703
  Parameters
868
704
  ----------
869
- gpu : int
870
- Number of GPUs to use.
871
- gpu_type : str
872
- Type of Nvidia GPU to use.
873
- queue_timeout : int
874
- Time to keep the job in NVCF's queue.
705
+ temp_dir_root : str, optional
706
+ The root directory that will hold the temporary directory where objects will be downloaded.
707
+
708
+ load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
709
+ The list of repos (models/datasets) to load.
710
+
711
+ Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
712
+
713
+ - If repo (model/dataset) is not found in the datastore:
714
+ - Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
715
+ - Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
716
+ - All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
717
+
718
+ - If repo is found in the datastore:
719
+ - Loads it directly from datastore to local path (can be temporary directory or specified path)
875
720
  """
876
721
  ...
877
722
 
@@ -932,54 +777,105 @@ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
932
777
  """
933
778
  ...
934
779
 
935
- @typing.overload
936
- def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
780
+ def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy: str, force_cache_update: bool, debug: bool, circuit_breaker_config: dict, timeout_config: dict) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
937
781
  """
938
- Specifies that the step will success under all circumstances.
939
-
940
- The decorator will create an optional artifact, specified by `var`, which
941
- contains the exception raised. You can use it to detect the presence
942
- of errors, indicating that all happy-path artifacts produced by the step
943
- are missing.
944
-
782
+ This decorator is used to run Ollama APIs as Metaflow task sidecars.
783
+
784
+ User code call
785
+ --------------
786
+ @ollama(
787
+ models=[...],
788
+ ...
789
+ )
790
+
791
+ Valid backend options
792
+ ---------------------
793
+ - 'local': Run as a separate process on the local task machine.
794
+ - (TODO) 'managed': Outerbounds hosts and selects compute provider.
795
+ - (TODO) 'remote': Spin up separate instance to serve Ollama models.
796
+
797
+ Valid model options
798
+ -------------------
799
+ Any model here https://ollama.com/search, e.g. 'llama3.2', 'llama3.3'
800
+
945
801
 
946
802
  Parameters
947
803
  ----------
948
- var : str, optional, default None
949
- Name of the artifact in which to store the caught exception.
950
- If not specified, the exception is not stored.
951
- print_exception : bool, default True
952
- Determines whether or not the exception is printed to
953
- stdout when caught.
804
+ models: list[str]
805
+ List of Ollama containers running models in sidecars.
806
+ backend: str
807
+ Determines where and how to run the Ollama process.
808
+ force_pull: bool
809
+ Whether to run `ollama pull` no matter what, or first check the remote cache in Metaflow datastore for this model key.
810
+ cache_update_policy: str
811
+ Cache update policy: "auto", "force", or "never".
812
+ force_cache_update: bool
813
+ Simple override for "force" cache update policy.
814
+ debug: bool
815
+ Whether to turn on verbose debugging logs.
816
+ circuit_breaker_config: dict
817
+ Configuration for circuit breaker protection. Keys: failure_threshold, recovery_timeout, reset_timeout.
818
+ timeout_config: dict
819
+ Configuration for various operation timeouts. Keys: pull, stop, health_check, install, server_startup.
954
820
  """
955
821
  ...
956
822
 
957
823
  @typing.overload
958
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
824
+ def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
825
+ """
826
+ Specifies the Conda environment for the step.
827
+
828
+ Information in this decorator will augment any
829
+ attributes set in the `@conda_base` flow-level decorator. Hence,
830
+ you can use `@conda_base` to set packages required by all
831
+ steps and use `@conda` to specify step-specific overrides.
832
+
833
+
834
+ Parameters
835
+ ----------
836
+ packages : Dict[str, str], default {}
837
+ Packages to use for this step. The key is the name of the package
838
+ and the value is the version to use.
839
+ libraries : Dict[str, str], default {}
840
+ Supported for backward compatibility. When used with packages, packages will take precedence.
841
+ python : str, optional, default None
842
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
843
+ that the version used will correspond to the version of the Python interpreter used to start the run.
844
+ disabled : bool, default False
845
+ If set to True, disables @conda.
846
+ """
959
847
  ...
960
848
 
961
849
  @typing.overload
962
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
850
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
963
851
  ...
964
852
 
965
- def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
853
+ @typing.overload
854
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
855
+ ...
856
+
857
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
966
858
  """
967
- Specifies that the step will success under all circumstances.
859
+ Specifies the Conda environment for the step.
968
860
 
969
- The decorator will create an optional artifact, specified by `var`, which
970
- contains the exception raised. You can use it to detect the presence
971
- of errors, indicating that all happy-path artifacts produced by the step
972
- are missing.
861
+ Information in this decorator will augment any
862
+ attributes set in the `@conda_base` flow-level decorator. Hence,
863
+ you can use `@conda_base` to set packages required by all
864
+ steps and use `@conda` to specify step-specific overrides.
973
865
 
974
866
 
975
867
  Parameters
976
868
  ----------
977
- var : str, optional, default None
978
- Name of the artifact in which to store the caught exception.
979
- If not specified, the exception is not stored.
980
- print_exception : bool, default True
981
- Determines whether or not the exception is printed to
982
- stdout when caught.
869
+ packages : Dict[str, str], default {}
870
+ Packages to use for this step. The key is the name of the package
871
+ and the value is the version to use.
872
+ libraries : Dict[str, str], default {}
873
+ Supported for backward compatibility. When used with packages, packages will take precedence.
874
+ python : str, optional, default None
875
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
876
+ that the version used will correspond to the version of the Python interpreter used to start the run.
877
+ disabled : bool, default False
878
+ If set to True, disables @conda.
983
879
  """
984
880
  ...
985
881
 
@@ -1017,95 +913,106 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
1017
913
  ...
1018
914
 
1019
915
  @typing.overload
1020
- def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
916
+ def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1021
917
  """
1022
- Specifies the event(s) that this flow depends on.
918
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1023
919
 
1024
- ```
1025
- @trigger(event='foo')
1026
- ```
1027
- or
1028
- ```
1029
- @trigger(events=['foo', 'bar'])
1030
- ```
920
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1031
921
 
1032
- Additionally, you can specify the parameter mappings
1033
- to map event payload to Metaflow parameters for the flow.
1034
- ```
1035
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1036
- ```
1037
- or
1038
- ```
1039
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1040
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1041
- ```
1042
922
 
1043
- 'parameters' can also be a list of strings and tuples like so:
1044
- ```
1045
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1046
- ```
1047
- This is equivalent to:
1048
- ```
1049
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1050
- ```
923
+ Parameters
924
+ ----------
925
+ type : str, default 'default'
926
+ Card type.
927
+ id : str, optional, default None
928
+ If multiple cards are present, use this id to identify this card.
929
+ options : Dict[str, Any], default {}
930
+ Options passed to the card. The contents depend on the card type.
931
+ timeout : int, default 45
932
+ Interrupt reporting if it takes more than this many seconds.
933
+ """
934
+ ...
935
+
936
+ @typing.overload
937
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
938
+ ...
939
+
940
+ @typing.overload
941
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
942
+ ...
943
+
944
+ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
945
+ """
946
+ Creates a human-readable report, a Metaflow Card, after this step completes.
947
+
948
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1051
949
 
1052
950
 
1053
951
  Parameters
1054
952
  ----------
1055
- event : Union[str, Dict[str, Any]], optional, default None
1056
- Event dependency for this flow.
1057
- events : List[Union[str, Dict[str, Any]]], default []
1058
- Events dependency for this flow.
953
+ type : str, default 'default'
954
+ Card type.
955
+ id : str, optional, default None
956
+ If multiple cards are present, use this id to identify this card.
1059
957
  options : Dict[str, Any], default {}
1060
- Backend-specific configuration for tuning eventing behavior.
958
+ Options passed to the card. The contents depend on the card type.
959
+ timeout : int, default 45
960
+ Interrupt reporting if it takes more than this many seconds.
1061
961
  """
1062
962
  ...
1063
963
 
1064
964
  @typing.overload
1065
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
965
+ def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
966
+ """
967
+ Specifies the number of times the task corresponding
968
+ to a step needs to be retried.
969
+
970
+ This decorator is useful for handling transient errors, such as networking issues.
971
+ If your task contains operations that can't be retried safely, e.g. database updates,
972
+ it is advisable to annotate it with `@retry(times=0)`.
973
+
974
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
975
+ decorator will execute a no-op task after all retries have been exhausted,
976
+ ensuring that the flow execution can continue.
977
+
978
+
979
+ Parameters
980
+ ----------
981
+ times : int, default 3
982
+ Number of times to retry this task.
983
+ minutes_between_retries : int, default 2
984
+ Number of minutes between retries.
985
+ """
1066
986
  ...
1067
987
 
1068
- def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
988
+ @typing.overload
989
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
990
+ ...
991
+
992
+ @typing.overload
993
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
994
+ ...
995
+
996
+ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
1069
997
  """
1070
- Specifies the event(s) that this flow depends on.
1071
-
1072
- ```
1073
- @trigger(event='foo')
1074
- ```
1075
- or
1076
- ```
1077
- @trigger(events=['foo', 'bar'])
1078
- ```
998
+ Specifies the number of times the task corresponding
999
+ to a step needs to be retried.
1079
1000
 
1080
- Additionally, you can specify the parameter mappings
1081
- to map event payload to Metaflow parameters for the flow.
1082
- ```
1083
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1084
- ```
1085
- or
1086
- ```
1087
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1088
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1089
- ```
1001
+ This decorator is useful for handling transient errors, such as networking issues.
1002
+ If your task contains operations that can't be retried safely, e.g. database updates,
1003
+ it is advisable to annotate it with `@retry(times=0)`.
1090
1004
 
1091
- 'parameters' can also be a list of strings and tuples like so:
1092
- ```
1093
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1094
- ```
1095
- This is equivalent to:
1096
- ```
1097
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1098
- ```
1005
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1006
+ decorator will execute a no-op task after all retries have been exhausted,
1007
+ ensuring that the flow execution can continue.
1099
1008
 
1100
1009
 
1101
1010
  Parameters
1102
1011
  ----------
1103
- event : Union[str, Dict[str, Any]], optional, default None
1104
- Event dependency for this flow.
1105
- events : List[Union[str, Dict[str, Any]]], default []
1106
- Events dependency for this flow.
1107
- options : Dict[str, Any], default {}
1108
- Backend-specific configuration for tuning eventing behavior.
1012
+ times : int, default 3
1013
+ Number of times to retry this task.
1014
+ minutes_between_retries : int, default 2
1015
+ Number of minutes between retries.
1109
1016
  """
1110
1017
  ...
1111
1018
 
@@ -1153,129 +1060,290 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1153
1060
  ...
1154
1061
 
1155
1062
  @typing.overload
1156
- def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1063
+ def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1157
1064
  """
1158
- Specifies the times when the flow should be run when running on a
1159
- production scheduler.
1065
+ Specifies the flow(s) that this flow depends on.
1066
+
1067
+ ```
1068
+ @trigger_on_finish(flow='FooFlow')
1069
+ ```
1070
+ or
1071
+ ```
1072
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1073
+ ```
1074
+ This decorator respects the @project decorator and triggers the flow
1075
+ when upstream runs within the same namespace complete successfully
1076
+
1077
+ Additionally, you can specify project aware upstream flow dependencies
1078
+ by specifying the fully qualified project_flow_name.
1079
+ ```
1080
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1081
+ ```
1082
+ or
1083
+ ```
1084
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1085
+ ```
1086
+
1087
+ You can also specify just the project or project branch (other values will be
1088
+ inferred from the current project or project branch):
1089
+ ```
1090
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1091
+ ```
1092
+
1093
+ Note that `branch` is typically one of:
1094
+ - `prod`
1095
+ - `user.bob`
1096
+ - `test.my_experiment`
1097
+ - `prod.staging`
1160
1098
 
1161
1099
 
1162
1100
  Parameters
1163
1101
  ----------
1164
- hourly : bool, default False
1165
- Run the workflow hourly.
1166
- daily : bool, default True
1167
- Run the workflow daily.
1168
- weekly : bool, default False
1169
- Run the workflow weekly.
1170
- cron : str, optional, default None
1171
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1172
- specified by this expression.
1173
- timezone : str, optional, default None
1174
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1175
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1102
+ flow : Union[str, Dict[str, str]], optional, default None
1103
+ Upstream flow dependency for this flow.
1104
+ flows : List[Union[str, Dict[str, str]]], default []
1105
+ Upstream flow dependencies for this flow.
1106
+ options : Dict[str, Any], default {}
1107
+ Backend-specific configuration for tuning eventing behavior.
1176
1108
  """
1177
1109
  ...
1178
1110
 
1179
1111
  @typing.overload
1180
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1112
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1181
1113
  ...
1182
1114
 
1183
- def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1115
+ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1184
1116
  """
1185
- Specifies the times when the flow should be run when running on a
1186
- production scheduler.
1117
+ Specifies the flow(s) that this flow depends on.
1118
+
1119
+ ```
1120
+ @trigger_on_finish(flow='FooFlow')
1121
+ ```
1122
+ or
1123
+ ```
1124
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1125
+ ```
1126
+ This decorator respects the @project decorator and triggers the flow
1127
+ when upstream runs within the same namespace complete successfully
1128
+
1129
+ Additionally, you can specify project aware upstream flow dependencies
1130
+ by specifying the fully qualified project_flow_name.
1131
+ ```
1132
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1133
+ ```
1134
+ or
1135
+ ```
1136
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1137
+ ```
1138
+
1139
+ You can also specify just the project or project branch (other values will be
1140
+ inferred from the current project or project branch):
1141
+ ```
1142
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1143
+ ```
1144
+
1145
+ Note that `branch` is typically one of:
1146
+ - `prod`
1147
+ - `user.bob`
1148
+ - `test.my_experiment`
1149
+ - `prod.staging`
1187
1150
 
1188
1151
 
1189
1152
  Parameters
1190
1153
  ----------
1191
- hourly : bool, default False
1192
- Run the workflow hourly.
1193
- daily : bool, default True
1194
- Run the workflow daily.
1195
- weekly : bool, default False
1196
- Run the workflow weekly.
1197
- cron : str, optional, default None
1198
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1199
- specified by this expression.
1200
- timezone : str, optional, default None
1201
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1202
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1154
+ flow : Union[str, Dict[str, str]], optional, default None
1155
+ Upstream flow dependency for this flow.
1156
+ flows : List[Union[str, Dict[str, str]]], default []
1157
+ Upstream flow dependencies for this flow.
1158
+ options : Dict[str, Any], default {}
1159
+ Backend-specific configuration for tuning eventing behavior.
1203
1160
  """
1204
1161
  ...
1205
1162
 
1206
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1163
+ @typing.overload
1164
+ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1207
1165
  """
1208
- Specifies what flows belong to the same project.
1166
+ Specifies the event(s) that this flow depends on.
1209
1167
 
1210
- A project-specific namespace is created for all flows that
1211
- use the same `@project(name)`.
1168
+ ```
1169
+ @trigger(event='foo')
1170
+ ```
1171
+ or
1172
+ ```
1173
+ @trigger(events=['foo', 'bar'])
1174
+ ```
1175
+
1176
+ Additionally, you can specify the parameter mappings
1177
+ to map event payload to Metaflow parameters for the flow.
1178
+ ```
1179
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1180
+ ```
1181
+ or
1182
+ ```
1183
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1184
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1185
+ ```
1186
+
1187
+ 'parameters' can also be a list of strings and tuples like so:
1188
+ ```
1189
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1190
+ ```
1191
+ This is equivalent to:
1192
+ ```
1193
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1194
+ ```
1212
1195
 
1213
1196
 
1214
1197
  Parameters
1215
1198
  ----------
1216
- name : str
1217
- Project name. Make sure that the name is unique amongst all
1218
- projects that use the same production scheduler. The name may
1219
- contain only lowercase alphanumeric characters and underscores.
1199
+ event : Union[str, Dict[str, Any]], optional, default None
1200
+ Event dependency for this flow.
1201
+ events : List[Union[str, Dict[str, Any]]], default []
1202
+ Events dependency for this flow.
1203
+ options : Dict[str, Any], default {}
1204
+ Backend-specific configuration for tuning eventing behavior.
1205
+ """
1206
+ ...
1207
+
1208
+ @typing.overload
1209
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1210
+ ...
1211
+
1212
+ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1213
+ """
1214
+ Specifies the event(s) that this flow depends on.
1220
1215
 
1221
- branch : Optional[str], default None
1222
- The branch to use. If not specified, the branch is set to
1223
- `user.<username>` unless `production` is set to `True`. This can
1224
- also be set on the command line using `--branch` as a top-level option.
1225
- It is an error to specify `branch` in the decorator and on the command line.
1216
+ ```
1217
+ @trigger(event='foo')
1218
+ ```
1219
+ or
1220
+ ```
1221
+ @trigger(events=['foo', 'bar'])
1222
+ ```
1226
1223
 
1227
- production : bool, default False
1228
- Whether or not the branch is the production branch. This can also be set on the
1229
- command line using `--production` as a top-level option. It is an error to specify
1230
- `production` in the decorator and on the command line.
1231
- The project branch name will be:
1232
- - if `branch` is specified:
1233
- - if `production` is True: `prod.<branch>`
1234
- - if `production` is False: `test.<branch>`
1235
- - if `branch` is not specified:
1236
- - if `production` is True: `prod`
1237
- - if `production` is False: `user.<username>`
1224
+ Additionally, you can specify the parameter mappings
1225
+ to map event payload to Metaflow parameters for the flow.
1226
+ ```
1227
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1228
+ ```
1229
+ or
1230
+ ```
1231
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1232
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1233
+ ```
1234
+
1235
+ 'parameters' can also be a list of strings and tuples like so:
1236
+ ```
1237
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1238
+ ```
1239
+ This is equivalent to:
1240
+ ```
1241
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1242
+ ```
1243
+
1244
+
1245
+ Parameters
1246
+ ----------
1247
+ event : Union[str, Dict[str, Any]], optional, default None
1248
+ Event dependency for this flow.
1249
+ events : List[Union[str, Dict[str, Any]]], default []
1250
+ Events dependency for this flow.
1251
+ options : Dict[str, Any], default {}
1252
+ Backend-specific configuration for tuning eventing behavior.
1238
1253
  """
1239
1254
  ...
1240
1255
 
1241
1256
  @typing.overload
1242
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1257
+ def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1243
1258
  """
1244
- Specifies the PyPI packages for all steps of the flow.
1259
+ Specifies the Conda environment for all steps of the flow.
1260
+
1261
+ Use `@conda_base` to set common libraries required by all
1262
+ steps and use `@conda` to specify step-specific additions.
1245
1263
 
1246
- Use `@pypi_base` to set common packages required by all
1247
- steps and use `@pypi` to specify step-specific overrides.
1248
1264
 
1249
1265
  Parameters
1250
1266
  ----------
1251
- packages : Dict[str, str], default: {}
1267
+ packages : Dict[str, str], default {}
1252
1268
  Packages to use for this flow. The key is the name of the package
1253
1269
  and the value is the version to use.
1254
- python : str, optional, default: None
1270
+ libraries : Dict[str, str], default {}
1271
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1272
+ python : str, optional, default None
1255
1273
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1256
1274
  that the version used will correspond to the version of the Python interpreter used to start the run.
1275
+ disabled : bool, default False
1276
+ If set to True, disables Conda.
1257
1277
  """
1258
1278
  ...
1259
1279
 
1260
1280
  @typing.overload
1261
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1281
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1262
1282
  ...
1263
1283
 
1264
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1284
+ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1265
1285
  """
1266
- Specifies the PyPI packages for all steps of the flow.
1286
+ Specifies the Conda environment for all steps of the flow.
1287
+
1288
+ Use `@conda_base` to set common libraries required by all
1289
+ steps and use `@conda` to specify step-specific additions.
1267
1290
 
1268
- Use `@pypi_base` to set common packages required by all
1269
- steps and use `@pypi` to specify step-specific overrides.
1270
1291
 
1271
1292
  Parameters
1272
1293
  ----------
1273
- packages : Dict[str, str], default: {}
1294
+ packages : Dict[str, str], default {}
1274
1295
  Packages to use for this flow. The key is the name of the package
1275
1296
  and the value is the version to use.
1276
- python : str, optional, default: None
1297
+ libraries : Dict[str, str], default {}
1298
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1299
+ python : str, optional, default None
1277
1300
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1278
1301
  that the version used will correspond to the version of the Python interpreter used to start the run.
1302
+ disabled : bool, default False
1303
+ If set to True, disables Conda.
1304
+ """
1305
+ ...
1306
+
1307
+ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1308
+ """
1309
+ The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
1310
+ This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1311
+
1312
+
1313
+ Parameters
1314
+ ----------
1315
+ timeout : int
1316
+ Time, in seconds before the task times out and fails. (Default: 3600)
1317
+ poke_interval : int
1318
+ Time in seconds that the job should wait in between each try. (Default: 60)
1319
+ mode : str
1320
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1321
+ exponential_backoff : bool
1322
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1323
+ pool : str
1324
+ the slot pool this task should run in,
1325
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1326
+ soft_fail : bool
1327
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1328
+ name : str
1329
+ Name of the sensor on Airflow
1330
+ description : str
1331
+ Description of sensor in the Airflow UI
1332
+ external_dag_id : str
1333
+ The dag_id that contains the task you want to wait for.
1334
+ external_task_ids : List[str]
1335
+ The list of task_ids that you want to wait for.
1336
+ If None (default value) the sensor waits for the DAG. (Default: None)
1337
+ allowed_states : List[str]
1338
+ Iterable of allowed states, (Default: ['success'])
1339
+ failed_states : List[str]
1340
+ Iterable of failed or dis-allowed states. (Default: None)
1341
+ execution_delta : datetime.timedelta
1342
+ time difference with the previous execution to look at,
1343
+ the default is the same logical date as the current task or DAG. (Default: None)
1344
+ check_existence: bool
1345
+ Set to True to check if the external task exists or check if
1346
+ the DAG to wait for exists. (Default: True)
1279
1347
  """
1280
1348
  ...
1281
1349
 
@@ -1393,198 +1461,130 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
1393
1461
  """
1394
1462
  ...
1395
1463
 
1396
- @typing.overload
1397
- def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1464
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1398
1465
  """
1399
- Specifies the flow(s) that this flow depends on.
1466
+ Specifies what flows belong to the same project.
1400
1467
 
1401
- ```
1402
- @trigger_on_finish(flow='FooFlow')
1403
- ```
1404
- or
1405
- ```
1406
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1407
- ```
1408
- This decorator respects the @project decorator and triggers the flow
1409
- when upstream runs within the same namespace complete successfully
1468
+ A project-specific namespace is created for all flows that
1469
+ use the same `@project(name)`.
1410
1470
 
1411
- Additionally, you can specify project aware upstream flow dependencies
1412
- by specifying the fully qualified project_flow_name.
1413
- ```
1414
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1415
- ```
1416
- or
1417
- ```
1418
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1419
- ```
1420
1471
 
1421
- You can also specify just the project or project branch (other values will be
1422
- inferred from the current project or project branch):
1423
- ```
1424
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1425
- ```
1472
+ Parameters
1473
+ ----------
1474
+ name : str
1475
+ Project name. Make sure that the name is unique amongst all
1476
+ projects that use the same production scheduler. The name may
1477
+ contain only lowercase alphanumeric characters and underscores.
1426
1478
 
1427
- Note that `branch` is typically one of:
1428
- - `prod`
1429
- - `user.bob`
1430
- - `test.my_experiment`
1431
- - `prod.staging`
1479
+ branch : Optional[str], default None
1480
+ The branch to use. If not specified, the branch is set to
1481
+ `user.<username>` unless `production` is set to `True`. This can
1482
+ also be set on the command line using `--branch` as a top-level option.
1483
+ It is an error to specify `branch` in the decorator and on the command line.
1484
+
1485
+ production : bool, default False
1486
+ Whether or not the branch is the production branch. This can also be set on the
1487
+ command line using `--production` as a top-level option. It is an error to specify
1488
+ `production` in the decorator and on the command line.
1489
+ The project branch name will be:
1490
+ - if `branch` is specified:
1491
+ - if `production` is True: `prod.<branch>`
1492
+ - if `production` is False: `test.<branch>`
1493
+ - if `branch` is not specified:
1494
+ - if `production` is True: `prod`
1495
+ - if `production` is False: `user.<username>`
1496
+ """
1497
+ ...
1498
+
1499
+ @typing.overload
1500
+ def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1501
+ """
1502
+ Specifies the times when the flow should be run when running on a
1503
+ production scheduler.
1432
1504
 
1433
1505
 
1434
1506
  Parameters
1435
1507
  ----------
1436
- flow : Union[str, Dict[str, str]], optional, default None
1437
- Upstream flow dependency for this flow.
1438
- flows : List[Union[str, Dict[str, str]]], default []
1439
- Upstream flow dependencies for this flow.
1440
- options : Dict[str, Any], default {}
1441
- Backend-specific configuration for tuning eventing behavior.
1508
+ hourly : bool, default False
1509
+ Run the workflow hourly.
1510
+ daily : bool, default True
1511
+ Run the workflow daily.
1512
+ weekly : bool, default False
1513
+ Run the workflow weekly.
1514
+ cron : str, optional, default None
1515
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1516
+ specified by this expression.
1517
+ timezone : str, optional, default None
1518
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1519
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1442
1520
  """
1443
1521
  ...
1444
1522
 
1445
1523
  @typing.overload
1446
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1524
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1447
1525
  ...
1448
1526
 
1449
- def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1527
+ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1450
1528
  """
1451
- Specifies the flow(s) that this flow depends on.
1452
-
1453
- ```
1454
- @trigger_on_finish(flow='FooFlow')
1455
- ```
1456
- or
1457
- ```
1458
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1459
- ```
1460
- This decorator respects the @project decorator and triggers the flow
1461
- when upstream runs within the same namespace complete successfully
1462
-
1463
- Additionally, you can specify project aware upstream flow dependencies
1464
- by specifying the fully qualified project_flow_name.
1465
- ```
1466
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1467
- ```
1468
- or
1469
- ```
1470
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1471
- ```
1472
-
1473
- You can also specify just the project or project branch (other values will be
1474
- inferred from the current project or project branch):
1475
- ```
1476
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1477
- ```
1478
-
1479
- Note that `branch` is typically one of:
1480
- - `prod`
1481
- - `user.bob`
1482
- - `test.my_experiment`
1483
- - `prod.staging`
1529
+ Specifies the times when the flow should be run when running on a
1530
+ production scheduler.
1484
1531
 
1485
1532
 
1486
1533
  Parameters
1487
1534
  ----------
1488
- flow : Union[str, Dict[str, str]], optional, default None
1489
- Upstream flow dependency for this flow.
1490
- flows : List[Union[str, Dict[str, str]]], default []
1491
- Upstream flow dependencies for this flow.
1492
- options : Dict[str, Any], default {}
1493
- Backend-specific configuration for tuning eventing behavior.
1535
+ hourly : bool, default False
1536
+ Run the workflow hourly.
1537
+ daily : bool, default True
1538
+ Run the workflow daily.
1539
+ weekly : bool, default False
1540
+ Run the workflow weekly.
1541
+ cron : str, optional, default None
1542
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1543
+ specified by this expression.
1544
+ timezone : str, optional, default None
1545
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1546
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1494
1547
  """
1495
1548
  ...
1496
1549
 
1497
1550
  @typing.overload
1498
- def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1551
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1499
1552
  """
1500
- Specifies the Conda environment for all steps of the flow.
1501
-
1502
- Use `@conda_base` to set common libraries required by all
1503
- steps and use `@conda` to specify step-specific additions.
1553
+ Specifies the PyPI packages for all steps of the flow.
1504
1554
 
1555
+ Use `@pypi_base` to set common packages required by all
1556
+ steps and use `@pypi` to specify step-specific overrides.
1505
1557
 
1506
1558
  Parameters
1507
1559
  ----------
1508
- packages : Dict[str, str], default {}
1560
+ packages : Dict[str, str], default: {}
1509
1561
  Packages to use for this flow. The key is the name of the package
1510
1562
  and the value is the version to use.
1511
- libraries : Dict[str, str], default {}
1512
- Supported for backward compatibility. When used with packages, packages will take precedence.
1513
- python : str, optional, default None
1563
+ python : str, optional, default: None
1514
1564
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1515
1565
  that the version used will correspond to the version of the Python interpreter used to start the run.
1516
- disabled : bool, default False
1517
- If set to True, disables Conda.
1518
1566
  """
1519
1567
  ...
1520
1568
 
1521
1569
  @typing.overload
1522
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1570
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1523
1571
  ...
1524
1572
 
1525
- def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1573
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1526
1574
  """
1527
- Specifies the Conda environment for all steps of the flow.
1528
-
1529
- Use `@conda_base` to set common libraries required by all
1530
- steps and use `@conda` to specify step-specific additions.
1575
+ Specifies the PyPI packages for all steps of the flow.
1531
1576
 
1577
+ Use `@pypi_base` to set common packages required by all
1578
+ steps and use `@pypi` to specify step-specific overrides.
1532
1579
 
1533
1580
  Parameters
1534
1581
  ----------
1535
- packages : Dict[str, str], default {}
1582
+ packages : Dict[str, str], default: {}
1536
1583
  Packages to use for this flow. The key is the name of the package
1537
1584
  and the value is the version to use.
1538
- libraries : Dict[str, str], default {}
1539
- Supported for backward compatibility. When used with packages, packages will take precedence.
1540
- python : str, optional, default None
1585
+ python : str, optional, default: None
1541
1586
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1542
1587
  that the version used will correspond to the version of the Python interpreter used to start the run.
1543
- disabled : bool, default False
1544
- If set to True, disables Conda.
1545
- """
1546
- ...
1547
-
1548
- def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1549
- """
1550
- The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
1551
- This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1552
-
1553
-
1554
- Parameters
1555
- ----------
1556
- timeout : int
1557
- Time, in seconds before the task times out and fails. (Default: 3600)
1558
- poke_interval : int
1559
- Time in seconds that the job should wait in between each try. (Default: 60)
1560
- mode : str
1561
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1562
- exponential_backoff : bool
1563
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1564
- pool : str
1565
- the slot pool this task should run in,
1566
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1567
- soft_fail : bool
1568
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1569
- name : str
1570
- Name of the sensor on Airflow
1571
- description : str
1572
- Description of sensor in the Airflow UI
1573
- external_dag_id : str
1574
- The dag_id that contains the task you want to wait for.
1575
- external_task_ids : List[str]
1576
- The list of task_ids that you want to wait for.
1577
- If None (default value) the sensor waits for the DAG. (Default: None)
1578
- allowed_states : List[str]
1579
- Iterable of allowed states, (Default: ['success'])
1580
- failed_states : List[str]
1581
- Iterable of failed or dis-allowed states. (Default: None)
1582
- execution_delta : datetime.timedelta
1583
- time difference with the previous execution to look at,
1584
- the default is the same logical date as the current task or DAG. (Default: None)
1585
- check_existence: bool
1586
- Set to True to check if the external task exists or check if
1587
- the DAG to wait for exists. (Default: True)
1588
1588
  """
1589
1589
  ...
1590
1590