metaflow-stubs 2.18.6__py2.py3-none-any.whl → 2.18.7__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.

Potentially problematic release.


This version of metaflow-stubs might be problematic. Click here for more details.

Files changed (166) hide show
  1. metaflow-stubs/__init__.pyi +582 -582
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +5 -5
  8. metaflow-stubs/client/filecache.pyi +2 -2
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +4 -4
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +3 -3
  14. metaflow-stubs/meta_files.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +35 -35
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/multicore_utils.pyi +2 -2
  23. metaflow-stubs/packaging_sys/__init__.pyi +6 -6
  24. metaflow-stubs/packaging_sys/backend.pyi +4 -4
  25. metaflow-stubs/packaging_sys/distribution_support.pyi +4 -4
  26. metaflow-stubs/packaging_sys/tar_backend.pyi +4 -4
  27. metaflow-stubs/packaging_sys/utils.pyi +2 -2
  28. metaflow-stubs/packaging_sys/v1.pyi +2 -2
  29. metaflow-stubs/parameters.pyi +3 -3
  30. metaflow-stubs/plugins/__init__.pyi +15 -15
  31. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  32. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  33. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  34. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  35. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  36. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  37. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  38. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  39. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  40. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  41. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  42. metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
  43. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  44. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  45. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
  46. metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
  47. metaflow-stubs/plugins/aws/__init__.pyi +3 -3
  48. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  50. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  51. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  52. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  53. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  54. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  55. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  56. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  58. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  59. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  60. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  64. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +2 -2
  65. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  67. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  68. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  69. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  70. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  71. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  72. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  74. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
  81. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  82. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  83. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  84. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  85. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  86. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  87. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  88. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  89. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  90. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  92. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  93. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  94. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  95. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  96. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  97. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  98. metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
  100. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  103. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  104. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  105. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  106. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  107. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  108. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  110. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  112. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  114. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  115. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  116. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  119. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  121. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  122. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  124. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  125. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  126. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  127. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  128. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  129. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  130. metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
  131. metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
  132. metaflow-stubs/plugins/secrets/utils.pyi +2 -2
  133. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  134. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  135. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  136. metaflow-stubs/plugins/uv/__init__.pyi +2 -2
  137. metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
  138. metaflow-stubs/pylint_wrapper.pyi +2 -2
  139. metaflow-stubs/runner/__init__.pyi +2 -2
  140. metaflow-stubs/runner/deployer.pyi +33 -33
  141. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  142. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  143. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  144. metaflow-stubs/runner/nbrun.pyi +2 -2
  145. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  146. metaflow-stubs/runner/utils.pyi +4 -4
  147. metaflow-stubs/system/__init__.pyi +2 -2
  148. metaflow-stubs/system/system_logger.pyi +2 -2
  149. metaflow-stubs/system/system_monitor.pyi +2 -2
  150. metaflow-stubs/tagging_util.pyi +2 -2
  151. metaflow-stubs/tuple_util.pyi +2 -2
  152. metaflow-stubs/user_configs/__init__.pyi +2 -2
  153. metaflow-stubs/user_configs/config_options.pyi +2 -2
  154. metaflow-stubs/user_configs/config_parameters.pyi +5 -5
  155. metaflow-stubs/user_decorators/__init__.pyi +2 -2
  156. metaflow-stubs/user_decorators/common.pyi +2 -2
  157. metaflow-stubs/user_decorators/mutable_flow.pyi +5 -5
  158. metaflow-stubs/user_decorators/mutable_step.pyi +5 -5
  159. metaflow-stubs/user_decorators/user_flow_decorator.pyi +4 -4
  160. metaflow-stubs/user_decorators/user_step_decorator.pyi +6 -6
  161. metaflow-stubs/version.pyi +2 -2
  162. {metaflow_stubs-2.18.6.dist-info → metaflow_stubs-2.18.7.dist-info}/METADATA +2 -2
  163. metaflow_stubs-2.18.7.dist-info/RECORD +166 -0
  164. metaflow_stubs-2.18.6.dist-info/RECORD +0 -166
  165. {metaflow_stubs-2.18.6.dist-info → metaflow_stubs-2.18.7.dist-info}/WHEEL +0 -0
  166. {metaflow_stubs-2.18.6.dist-info → metaflow_stubs-2.18.7.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.18.6 #
4
- # Generated on 2025-09-17T19:37:30.074072 #
3
+ # MF version: 2.18.7 #
4
+ # Generated on 2025-09-18T19:24:16.691351 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -40,16 +40,16 @@ from .user_decorators.user_step_decorator import StepMutator as StepMutator
40
40
  from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
41
41
  from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
42
42
  from . import events as events
43
- from . import tuple_util as tuple_util
44
43
  from . import metaflow_git as metaflow_git
44
+ from . import tuple_util as tuple_util
45
45
  from . import runner as runner
46
46
  from . import plugins as plugins
47
47
  from .plugins.datatools.s3.s3 import S3 as S3
48
48
  from . import includefile as includefile
49
49
  from .includefile import IncludeFile as IncludeFile
50
+ from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
50
51
  from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
51
52
  from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
52
- from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
53
53
  from . import cards as cards
54
54
  from . import client as client
55
55
  from .client.core import namespace as namespace
@@ -152,6 +152,155 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
152
152
  """
153
153
  ...
154
154
 
155
+ @typing.overload
156
+ 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]]]:
157
+ """
158
+ Specifies a timeout for your step.
159
+
160
+ This decorator is useful if this step may hang indefinitely.
161
+
162
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
163
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
164
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
165
+
166
+ Note that all the values specified in parameters are added together so if you specify
167
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
168
+
169
+
170
+ Parameters
171
+ ----------
172
+ seconds : int, default 0
173
+ Number of seconds to wait prior to timing out.
174
+ minutes : int, default 0
175
+ Number of minutes to wait prior to timing out.
176
+ hours : int, default 0
177
+ Number of hours to wait prior to timing out.
178
+ """
179
+ ...
180
+
181
+ @typing.overload
182
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
183
+ ...
184
+
185
+ @typing.overload
186
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
187
+ ...
188
+
189
+ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
190
+ """
191
+ Specifies a timeout for your step.
192
+
193
+ This decorator is useful if this step may hang indefinitely.
194
+
195
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
196
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
197
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
198
+
199
+ Note that all the values specified in parameters are added together so if you specify
200
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
201
+
202
+
203
+ Parameters
204
+ ----------
205
+ seconds : int, default 0
206
+ Number of seconds to wait prior to timing out.
207
+ minutes : int, default 0
208
+ Number of minutes to wait prior to timing out.
209
+ hours : int, default 0
210
+ Number of hours to wait prior to timing out.
211
+ """
212
+ ...
213
+
214
+ @typing.overload
215
+ 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]]]:
216
+ """
217
+ Specifies that the step will success under all circumstances.
218
+
219
+ The decorator will create an optional artifact, specified by `var`, which
220
+ contains the exception raised. You can use it to detect the presence
221
+ of errors, indicating that all happy-path artifacts produced by the step
222
+ are missing.
223
+
224
+
225
+ Parameters
226
+ ----------
227
+ var : str, optional, default None
228
+ Name of the artifact in which to store the caught exception.
229
+ If not specified, the exception is not stored.
230
+ print_exception : bool, default True
231
+ Determines whether or not the exception is printed to
232
+ stdout when caught.
233
+ """
234
+ ...
235
+
236
+ @typing.overload
237
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
238
+ ...
239
+
240
+ @typing.overload
241
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
242
+ ...
243
+
244
+ 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):
245
+ """
246
+ Specifies that the step will success under all circumstances.
247
+
248
+ The decorator will create an optional artifact, specified by `var`, which
249
+ contains the exception raised. You can use it to detect the presence
250
+ of errors, indicating that all happy-path artifacts produced by the step
251
+ are missing.
252
+
253
+
254
+ Parameters
255
+ ----------
256
+ var : str, optional, default None
257
+ Name of the artifact in which to store the caught exception.
258
+ If not specified, the exception is not stored.
259
+ print_exception : bool, default True
260
+ Determines whether or not the exception is printed to
261
+ stdout when caught.
262
+ """
263
+ ...
264
+
265
+ @typing.overload
266
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[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]]]:
267
+ """
268
+ Specifies secrets to be retrieved and injected as environment variables prior to
269
+ the execution of a step.
270
+
271
+
272
+ Parameters
273
+ ----------
274
+ sources : List[Union[str, Dict[str, Any]]], default: []
275
+ List of secret specs, defining how the secrets are to be retrieved
276
+ role : str, optional, default: None
277
+ Role to use for fetching secrets
278
+ """
279
+ ...
280
+
281
+ @typing.overload
282
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
283
+ ...
284
+
285
+ @typing.overload
286
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
287
+ ...
288
+
289
+ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
290
+ """
291
+ Specifies secrets to be retrieved and injected as environment variables prior to
292
+ the execution of a step.
293
+
294
+
295
+ Parameters
296
+ ----------
297
+ sources : List[Union[str, Dict[str, Any]]], default: []
298
+ List of secret specs, defining how the secrets are to be retrieved
299
+ role : str, optional, default: None
300
+ Role to use for fetching secrets
301
+ """
302
+ ...
303
+
155
304
  @typing.overload
156
305
  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]]]:
157
306
  """
@@ -207,10 +356,9 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
207
356
  """
208
357
  ...
209
358
 
210
- @typing.overload
211
- def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[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]]]:
359
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = 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
360
  """
213
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
361
+ Specifies that this step should execute on Kubernetes.
214
362
 
215
363
 
216
364
  Parameters
@@ -218,77 +366,259 @@ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optio
218
366
  cpu : int, default 1
219
367
  Number of CPUs required for this step. If `@resources` is
220
368
  also present, the maximum value from all decorators is used.
221
- gpu : int, default 0
222
- Number of GPUs required for this step. If `@resources` is
223
- also present, the maximum value from all decorators is used.
224
369
  memory : int, default 4096
225
370
  Memory size (in MB) required for this step. If
226
371
  `@resources` is also present, the maximum value from all decorators is
227
372
  used.
373
+ disk : int, default 10240
374
+ Disk size (in MB) required for this step. If
375
+ `@resources` is also present, the maximum value from all decorators is
376
+ used.
228
377
  image : str, optional, default None
229
- Docker image to use when launching on AWS Batch. If not specified, and
230
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
378
+ Docker image to use when launching on Kubernetes. If not specified, and
379
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
231
380
  not, a default Docker image mapping to the current version of Python is used.
232
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
233
- AWS Batch Job Queue to submit the job to.
234
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
235
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
236
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
237
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
238
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
239
- shared_memory : int, optional, default None
240
- The value for the size (in MiB) of the /dev/shm volume for this step.
241
- This parameter maps to the `--shm-size` option in Docker.
242
- max_swap : int, optional, default None
243
- The total amount of swap memory (in MiB) a container can use for this
244
- step. This parameter is translated to the `--memory-swap` option in
245
- Docker where the value is the sum of the container memory plus the
246
- `max_swap` value.
247
- swappiness : int, optional, default None
248
- This allows you to tune memory swappiness behavior for this step.
249
- A swappiness value of 0 causes swapping not to happen unless absolutely
250
- necessary. A swappiness value of 100 causes pages to be swapped very
251
- aggressively. Accepted values are whole numbers between 0 and 100.
252
- aws_batch_tags: Dict[str, str], optional, default None
253
- Sets arbitrary AWS tags on the AWS Batch compute environment.
254
- Set as string key-value pairs.
381
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
382
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
383
+ image_pull_secrets: List[str], default []
384
+ The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
385
+ Kubernetes image pull secrets to use when pulling container images
386
+ in Kubernetes.
387
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
388
+ Kubernetes service account to use when launching pod in Kubernetes.
389
+ secrets : List[str], optional, default None
390
+ Kubernetes secrets to use when launching pod in Kubernetes. These
391
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
392
+ in Metaflow configuration.
393
+ node_selector: Union[Dict[str,str], str], optional, default None
394
+ Kubernetes node selector(s) to apply to the pod running the task.
395
+ Can be passed in as a comma separated string of values e.g.
396
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
397
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
398
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
399
+ Kubernetes namespace to use when launching pod in Kubernetes.
400
+ gpu : int, optional, default None
401
+ Number of GPUs required for this step. A value of zero implies that
402
+ the scheduled node should not have GPUs.
403
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
404
+ The vendor of the GPUs to be used for this step.
405
+ tolerations : List[Dict[str,str]], default []
406
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
407
+ Kubernetes tolerations to use when launching pod in Kubernetes.
408
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
409
+ Kubernetes labels to use when launching pod in Kubernetes.
410
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
411
+ Kubernetes annotations to use when launching pod in Kubernetes.
255
412
  use_tmpfs : bool, default False
256
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
257
- not available on Fargate compute environments
413
+ This enables an explicit tmpfs mount for this step.
258
414
  tmpfs_tempdir : bool, default True
259
415
  sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
260
- tmpfs_size : int, optional, default None
416
+ tmpfs_size : int, optional, default: None
261
417
  The value for the size (in MiB) of the tmpfs mount for this step.
262
418
  This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
263
419
  memory allocated for this step.
264
- tmpfs_path : str, optional, default None
265
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
266
- inferentia : int, default 0
267
- Number of Inferentia chips required for this step.
268
- trainium : int, default None
269
- Alias for inferentia. Use only one of the two.
270
- efa : int, default 0
271
- Number of elastic fabric adapter network devices to attach to container
272
- ephemeral_storage : int, default None
273
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
274
- This is only relevant for Fargate compute environments
275
- log_driver: str, optional, default None
276
- The log driver to use for the Amazon ECS container.
277
- log_options: List[str], optional, default None
278
- List of strings containing options for the chosen log driver. The configurable values
279
- depend on the `log driver` chosen. Validation of these options is not supported yet.
280
- Example: [`awslogs-group:aws/batch/job`]
281
- """
282
- ...
283
-
284
- @typing.overload
285
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
286
- ...
287
-
288
- @typing.overload
289
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
290
- ...
291
-
420
+ tmpfs_path : str, optional, default /metaflow_temp
421
+ Path to tmpfs mount for this step.
422
+ persistent_volume_claims : Dict[str, str], optional, default None
423
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
424
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
425
+ shared_memory: int, optional
426
+ Shared memory size (in MiB) required for this step
427
+ port: int, optional
428
+ Port number to specify in the Kubernetes job object
429
+ compute_pool : str, optional, default None
430
+ Compute pool to be used for for this step.
431
+ If not specified, any accessible compute pool within the perimeter is used.
432
+ hostname_resolution_timeout: int, default 10 * 60
433
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
434
+ Only applicable when @parallel is used.
435
+ qos: str, default: Burstable
436
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
437
+
438
+ security_context: Dict[str, Any], optional, default None
439
+ Container security context. Applies to the task container. Allows the following keys:
440
+ - privileged: bool, optional, default None
441
+ - allow_privilege_escalation: bool, optional, default None
442
+ - run_as_user: int, optional, default None
443
+ - run_as_group: int, optional, default None
444
+ - run_as_non_root: bool, optional, default None
445
+ """
446
+ ...
447
+
448
+ @typing.overload
449
+ 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]]]:
450
+ """
451
+ Specifies the Conda environment for the step.
452
+
453
+ Information in this decorator will augment any
454
+ attributes set in the `@conda_base` flow-level decorator. Hence,
455
+ you can use `@conda_base` to set packages required by all
456
+ steps and use `@conda` to specify step-specific overrides.
457
+
458
+
459
+ Parameters
460
+ ----------
461
+ packages : Dict[str, str], default {}
462
+ Packages to use for this step. The key is the name of the package
463
+ and the value is the version to use.
464
+ libraries : Dict[str, str], default {}
465
+ Supported for backward compatibility. When used with packages, packages will take precedence.
466
+ python : str, optional, default None
467
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
468
+ that the version used will correspond to the version of the Python interpreter used to start the run.
469
+ disabled : bool, default False
470
+ If set to True, disables @conda.
471
+ """
472
+ ...
473
+
474
+ @typing.overload
475
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
476
+ ...
477
+
478
+ @typing.overload
479
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
480
+ ...
481
+
482
+ 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):
483
+ """
484
+ Specifies the Conda environment for the step.
485
+
486
+ Information in this decorator will augment any
487
+ attributes set in the `@conda_base` flow-level decorator. Hence,
488
+ you can use `@conda_base` to set packages required by all
489
+ steps and use `@conda` to specify step-specific overrides.
490
+
491
+
492
+ Parameters
493
+ ----------
494
+ packages : Dict[str, str], default {}
495
+ Packages to use for this step. The key is the name of the package
496
+ and the value is the version to use.
497
+ libraries : Dict[str, str], default {}
498
+ Supported for backward compatibility. When used with packages, packages will take precedence.
499
+ python : str, optional, default None
500
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
501
+ that the version used will correspond to the version of the Python interpreter used to start the run.
502
+ disabled : bool, default False
503
+ If set to True, disables @conda.
504
+ """
505
+ ...
506
+
507
+ @typing.overload
508
+ def environment(*, vars: typing.Dict[str, 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]]]:
509
+ """
510
+ Specifies environment variables to be set prior to the execution of a step.
511
+
512
+
513
+ Parameters
514
+ ----------
515
+ vars : Dict[str, str], default {}
516
+ Dictionary of environment variables to set.
517
+ """
518
+ ...
519
+
520
+ @typing.overload
521
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
522
+ ...
523
+
524
+ @typing.overload
525
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
526
+ ...
527
+
528
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
529
+ """
530
+ Specifies environment variables to be set prior to the execution of a step.
531
+
532
+
533
+ Parameters
534
+ ----------
535
+ vars : Dict[str, str], default {}
536
+ Dictionary of environment variables to set.
537
+ """
538
+ ...
539
+
540
+ @typing.overload
541
+ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[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]]]:
542
+ """
543
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
544
+
545
+
546
+ Parameters
547
+ ----------
548
+ cpu : int, default 1
549
+ Number of CPUs required for this step. If `@resources` is
550
+ also present, the maximum value from all decorators is used.
551
+ gpu : int, default 0
552
+ Number of GPUs required for this step. If `@resources` is
553
+ also present, the maximum value from all decorators is used.
554
+ memory : int, default 4096
555
+ Memory size (in MB) required for this step. If
556
+ `@resources` is also present, the maximum value from all decorators is
557
+ used.
558
+ image : str, optional, default None
559
+ Docker image to use when launching on AWS Batch. If not specified, and
560
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
561
+ not, a default Docker image mapping to the current version of Python is used.
562
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
563
+ AWS Batch Job Queue to submit the job to.
564
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
565
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
566
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
567
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
568
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
569
+ shared_memory : int, optional, default None
570
+ The value for the size (in MiB) of the /dev/shm volume for this step.
571
+ This parameter maps to the `--shm-size` option in Docker.
572
+ max_swap : int, optional, default None
573
+ The total amount of swap memory (in MiB) a container can use for this
574
+ step. This parameter is translated to the `--memory-swap` option in
575
+ Docker where the value is the sum of the container memory plus the
576
+ `max_swap` value.
577
+ swappiness : int, optional, default None
578
+ This allows you to tune memory swappiness behavior for this step.
579
+ A swappiness value of 0 causes swapping not to happen unless absolutely
580
+ necessary. A swappiness value of 100 causes pages to be swapped very
581
+ aggressively. Accepted values are whole numbers between 0 and 100.
582
+ aws_batch_tags: Dict[str, str], optional, default None
583
+ Sets arbitrary AWS tags on the AWS Batch compute environment.
584
+ Set as string key-value pairs.
585
+ use_tmpfs : bool, default False
586
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
587
+ not available on Fargate compute environments
588
+ tmpfs_tempdir : bool, default True
589
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
590
+ tmpfs_size : int, optional, default None
591
+ The value for the size (in MiB) of the tmpfs mount for this step.
592
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
593
+ memory allocated for this step.
594
+ tmpfs_path : str, optional, default None
595
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
596
+ inferentia : int, default 0
597
+ Number of Inferentia chips required for this step.
598
+ trainium : int, default None
599
+ Alias for inferentia. Use only one of the two.
600
+ efa : int, default 0
601
+ Number of elastic fabric adapter network devices to attach to container
602
+ ephemeral_storage : int, default None
603
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
604
+ This is only relevant for Fargate compute environments
605
+ log_driver: str, optional, default None
606
+ The log driver to use for the Amazon ECS container.
607
+ log_options: List[str], optional, default None
608
+ List of strings containing options for the chosen log driver. The configurable values
609
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
610
+ Example: [`awslogs-group:aws/batch/job`]
611
+ """
612
+ ...
613
+
614
+ @typing.overload
615
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
616
+ ...
617
+
618
+ @typing.overload
619
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
620
+ ...
621
+
292
622
  def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None):
293
623
  """
294
624
  Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
@@ -363,21 +693,51 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
363
693
  ...
364
694
 
365
695
  @typing.overload
366
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
696
+ 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]]]:
367
697
  """
368
- Decorator prototype for all step decorators. This function gets specialized
369
- and imported for all decorators types by _import_plugin_decorators().
698
+ Creates a human-readable report, a Metaflow Card, after this step completes.
699
+
700
+ Note that you may add multiple `@card` decorators in a step with different parameters.
701
+
702
+
703
+ Parameters
704
+ ----------
705
+ type : str, default 'default'
706
+ Card type.
707
+ id : str, optional, default None
708
+ If multiple cards are present, use this id to identify this card.
709
+ options : Dict[str, Any], default {}
710
+ Options passed to the card. The contents depend on the card type.
711
+ timeout : int, default 45
712
+ Interrupt reporting if it takes more than this many seconds.
370
713
  """
371
714
  ...
372
715
 
373
716
  @typing.overload
374
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
717
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
375
718
  ...
376
719
 
377
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
720
+ @typing.overload
721
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
722
+ ...
723
+
724
+ 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):
378
725
  """
379
- Decorator prototype for all step decorators. This function gets specialized
380
- and imported for all decorators types by _import_plugin_decorators().
726
+ Creates a human-readable report, a Metaflow Card, after this step completes.
727
+
728
+ Note that you may add multiple `@card` decorators in a step with different parameters.
729
+
730
+
731
+ Parameters
732
+ ----------
733
+ type : str, default 'default'
734
+ Card type.
735
+ id : str, optional, default None
736
+ If multiple cards are present, use this id to identify this card.
737
+ options : Dict[str, Any], default {}
738
+ Options passed to the card. The contents depend on the card type.
739
+ timeout : int, default 45
740
+ Interrupt reporting if it takes more than this many seconds.
381
741
  """
382
742
  ...
383
743
 
@@ -433,161 +793,21 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
433
793
  ...
434
794
 
435
795
  @typing.overload
436
- 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]]]:
796
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
437
797
  """
438
- Specifies that the step will success under all circumstances.
439
-
440
- The decorator will create an optional artifact, specified by `var`, which
441
- contains the exception raised. You can use it to detect the presence
442
- of errors, indicating that all happy-path artifacts produced by the step
443
- are missing.
444
-
445
-
446
- Parameters
447
- ----------
448
- var : str, optional, default None
449
- Name of the artifact in which to store the caught exception.
450
- If not specified, the exception is not stored.
451
- print_exception : bool, default True
452
- Determines whether or not the exception is printed to
453
- stdout when caught.
454
- """
455
- ...
456
-
457
- @typing.overload
458
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
459
- ...
460
-
461
- @typing.overload
462
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
463
- ...
464
-
465
- 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):
466
- """
467
- Specifies that the step will success under all circumstances.
468
-
469
- The decorator will create an optional artifact, specified by `var`, which
470
- contains the exception raised. You can use it to detect the presence
471
- of errors, indicating that all happy-path artifacts produced by the step
472
- are missing.
473
-
474
-
475
- Parameters
476
- ----------
477
- var : str, optional, default None
478
- Name of the artifact in which to store the caught exception.
479
- If not specified, the exception is not stored.
480
- print_exception : bool, default True
481
- Determines whether or not the exception is printed to
482
- stdout when caught.
483
- """
484
- ...
485
-
486
- @typing.overload
487
- 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]]]:
488
- """
489
- Creates a human-readable report, a Metaflow Card, after this step completes.
490
-
491
- Note that you may add multiple `@card` decorators in a step with different parameters.
492
-
493
-
494
- Parameters
495
- ----------
496
- type : str, default 'default'
497
- Card type.
498
- id : str, optional, default None
499
- If multiple cards are present, use this id to identify this card.
500
- options : Dict[str, Any], default {}
501
- Options passed to the card. The contents depend on the card type.
502
- timeout : int, default 45
503
- Interrupt reporting if it takes more than this many seconds.
504
- """
505
- ...
506
-
507
- @typing.overload
508
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
509
- ...
510
-
511
- @typing.overload
512
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
513
- ...
514
-
515
- 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):
516
- """
517
- Creates a human-readable report, a Metaflow Card, after this step completes.
518
-
519
- Note that you may add multiple `@card` decorators in a step with different parameters.
520
-
521
-
522
- Parameters
523
- ----------
524
- type : str, default 'default'
525
- Card type.
526
- id : str, optional, default None
527
- If multiple cards are present, use this id to identify this card.
528
- options : Dict[str, Any], default {}
529
- Options passed to the card. The contents depend on the card type.
530
- timeout : int, default 45
531
- Interrupt reporting if it takes more than this many seconds.
532
- """
533
- ...
534
-
535
- @typing.overload
536
- 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]]]:
537
- """
538
- Specifies a timeout for your step.
539
-
540
- This decorator is useful if this step may hang indefinitely.
541
-
542
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
543
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
544
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
545
-
546
- Note that all the values specified in parameters are added together so if you specify
547
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
548
-
549
-
550
- Parameters
551
- ----------
552
- seconds : int, default 0
553
- Number of seconds to wait prior to timing out.
554
- minutes : int, default 0
555
- Number of minutes to wait prior to timing out.
556
- hours : int, default 0
557
- Number of hours to wait prior to timing out.
798
+ Decorator prototype for all step decorators. This function gets specialized
799
+ and imported for all decorators types by _import_plugin_decorators().
558
800
  """
559
801
  ...
560
802
 
561
803
  @typing.overload
562
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
563
- ...
564
-
565
- @typing.overload
566
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
804
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
567
805
  ...
568
806
 
569
- def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
807
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
570
808
  """
571
- Specifies a timeout for your step.
572
-
573
- This decorator is useful if this step may hang indefinitely.
574
-
575
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
576
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
577
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
578
-
579
- Note that all the values specified in parameters are added together so if you specify
580
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
581
-
582
-
583
- Parameters
584
- ----------
585
- seconds : int, default 0
586
- Number of seconds to wait prior to timing out.
587
- minutes : int, default 0
588
- Number of minutes to wait prior to timing out.
589
- hours : int, default 0
590
- Number of hours to wait prior to timing out.
809
+ Decorator prototype for all step decorators. This function gets specialized
810
+ and imported for all decorators types by _import_plugin_decorators().
591
811
  """
592
812
  ...
593
813
 
@@ -671,222 +891,215 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
671
891
  ...
672
892
 
673
893
  @typing.overload
674
- 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]]]:
894
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
675
895
  """
676
- Specifies the Conda environment for the step.
677
-
678
- Information in this decorator will augment any
679
- attributes set in the `@conda_base` flow-level decorator. Hence,
680
- you can use `@conda_base` to set packages required by all
681
- steps and use `@conda` to specify step-specific overrides.
896
+ Specifies the PyPI packages for all steps of the flow.
682
897
 
898
+ Use `@pypi_base` to set common packages required by all
899
+ steps and use `@pypi` to specify step-specific overrides.
683
900
 
684
901
  Parameters
685
902
  ----------
686
- packages : Dict[str, str], default {}
687
- Packages to use for this step. The key is the name of the package
903
+ packages : Dict[str, str], default: {}
904
+ Packages to use for this flow. The key is the name of the package
688
905
  and the value is the version to use.
689
- libraries : Dict[str, str], default {}
690
- Supported for backward compatibility. When used with packages, packages will take precedence.
691
- python : str, optional, default None
906
+ python : str, optional, default: None
692
907
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
693
908
  that the version used will correspond to the version of the Python interpreter used to start the run.
694
- disabled : bool, default False
695
- If set to True, disables @conda.
696
909
  """
697
910
  ...
698
911
 
699
912
  @typing.overload
700
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
701
- ...
702
-
703
- @typing.overload
704
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
913
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
705
914
  ...
706
915
 
707
- 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):
916
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
708
917
  """
709
- Specifies the Conda environment for the step.
710
-
711
- Information in this decorator will augment any
712
- attributes set in the `@conda_base` flow-level decorator. Hence,
713
- you can use `@conda_base` to set packages required by all
714
- steps and use `@conda` to specify step-specific overrides.
918
+ Specifies the PyPI packages for all steps of the flow.
715
919
 
920
+ Use `@pypi_base` to set common packages required by all
921
+ steps and use `@pypi` to specify step-specific overrides.
716
922
 
717
923
  Parameters
718
924
  ----------
719
- packages : Dict[str, str], default {}
720
- Packages to use for this step. The key is the name of the package
925
+ packages : Dict[str, str], default: {}
926
+ Packages to use for this flow. The key is the name of the package
721
927
  and the value is the version to use.
722
- libraries : Dict[str, str], default {}
723
- Supported for backward compatibility. When used with packages, packages will take precedence.
724
- python : str, optional, default None
928
+ python : str, optional, default: None
725
929
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
726
930
  that the version used will correspond to the version of the Python interpreter used to start the run.
727
- disabled : bool, default False
728
- If set to True, disables @conda.
729
931
  """
730
932
  ...
731
933
 
732
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = 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]]]:
934
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
733
935
  """
734
- Specifies that this step should execute on Kubernetes.
936
+ Specifies what flows belong to the same project.
937
+
938
+ A project-specific namespace is created for all flows that
939
+ use the same `@project(name)`.
735
940
 
736
941
 
737
942
  Parameters
738
943
  ----------
739
- cpu : int, default 1
740
- Number of CPUs required for this step. If `@resources` is
741
- also present, the maximum value from all decorators is used.
742
- memory : int, default 4096
743
- Memory size (in MB) required for this step. If
744
- `@resources` is also present, the maximum value from all decorators is
745
- used.
746
- disk : int, default 10240
747
- Disk size (in MB) required for this step. If
748
- `@resources` is also present, the maximum value from all decorators is
749
- used.
750
- image : str, optional, default None
751
- Docker image to use when launching on Kubernetes. If not specified, and
752
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
753
- not, a default Docker image mapping to the current version of Python is used.
754
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
755
- If given, the imagePullPolicy to be applied to the Docker image of the step.
756
- image_pull_secrets: List[str], default []
757
- The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
758
- Kubernetes image pull secrets to use when pulling container images
759
- in Kubernetes.
760
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
761
- Kubernetes service account to use when launching pod in Kubernetes.
762
- secrets : List[str], optional, default None
763
- Kubernetes secrets to use when launching pod in Kubernetes. These
764
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
765
- in Metaflow configuration.
766
- node_selector: Union[Dict[str,str], str], optional, default None
767
- Kubernetes node selector(s) to apply to the pod running the task.
768
- Can be passed in as a comma separated string of values e.g.
769
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
770
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
771
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
772
- Kubernetes namespace to use when launching pod in Kubernetes.
773
- gpu : int, optional, default None
774
- Number of GPUs required for this step. A value of zero implies that
775
- the scheduled node should not have GPUs.
776
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
777
- The vendor of the GPUs to be used for this step.
778
- tolerations : List[Dict[str,str]], default []
779
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
780
- Kubernetes tolerations to use when launching pod in Kubernetes.
781
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
782
- Kubernetes labels to use when launching pod in Kubernetes.
783
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
784
- Kubernetes annotations to use when launching pod in Kubernetes.
785
- use_tmpfs : bool, default False
786
- This enables an explicit tmpfs mount for this step.
787
- tmpfs_tempdir : bool, default True
788
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
789
- tmpfs_size : int, optional, default: None
790
- The value for the size (in MiB) of the tmpfs mount for this step.
791
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
792
- memory allocated for this step.
793
- tmpfs_path : str, optional, default /metaflow_temp
794
- Path to tmpfs mount for this step.
795
- persistent_volume_claims : Dict[str, str], optional, default None
796
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
797
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
798
- shared_memory: int, optional
799
- Shared memory size (in MiB) required for this step
800
- port: int, optional
801
- Port number to specify in the Kubernetes job object
802
- compute_pool : str, optional, default None
803
- Compute pool to be used for for this step.
804
- If not specified, any accessible compute pool within the perimeter is used.
805
- hostname_resolution_timeout: int, default 10 * 60
806
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
807
- Only applicable when @parallel is used.
808
- qos: str, default: Burstable
809
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
944
+ name : str
945
+ Project name. Make sure that the name is unique amongst all
946
+ projects that use the same production scheduler. The name may
947
+ contain only lowercase alphanumeric characters and underscores.
810
948
 
811
- security_context: Dict[str, Any], optional, default None
812
- Container security context. Applies to the task container. Allows the following keys:
813
- - privileged: bool, optional, default None
814
- - allow_privilege_escalation: bool, optional, default None
815
- - run_as_user: int, optional, default None
816
- - run_as_group: int, optional, default None
817
- - run_as_non_root: bool, optional, default None
949
+ branch : Optional[str], default None
950
+ The branch to use. If not specified, the branch is set to
951
+ `user.<username>` unless `production` is set to `True`. This can
952
+ also be set on the command line using `--branch` as a top-level option.
953
+ It is an error to specify `branch` in the decorator and on the command line.
954
+
955
+ production : bool, default False
956
+ Whether or not the branch is the production branch. This can also be set on the
957
+ command line using `--production` as a top-level option. It is an error to specify
958
+ `production` in the decorator and on the command line.
959
+ The project branch name will be:
960
+ - if `branch` is specified:
961
+ - if `production` is True: `prod.<branch>`
962
+ - if `production` is False: `test.<branch>`
963
+ - if `branch` is not specified:
964
+ - if `production` is True: `prod`
965
+ - if `production` is False: `user.<username>`
818
966
  """
819
967
  ...
820
968
 
821
- @typing.overload
822
- def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[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]]]:
969
+ 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]]:
823
970
  """
824
- Specifies secrets to be retrieved and injected as environment variables prior to
825
- the execution of a step.
971
+ 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.
972
+ 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.
826
973
 
827
974
 
828
975
  Parameters
829
976
  ----------
830
- sources : List[Union[str, Dict[str, Any]]], default: []
831
- List of secret specs, defining how the secrets are to be retrieved
832
- role : str, optional, default: None
833
- Role to use for fetching secrets
977
+ timeout : int
978
+ Time, in seconds before the task times out and fails. (Default: 3600)
979
+ poke_interval : int
980
+ Time in seconds that the job should wait in between each try. (Default: 60)
981
+ mode : str
982
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
983
+ exponential_backoff : bool
984
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
985
+ pool : str
986
+ the slot pool this task should run in,
987
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
988
+ soft_fail : bool
989
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
990
+ name : str
991
+ Name of the sensor on Airflow
992
+ description : str
993
+ Description of sensor in the Airflow UI
994
+ external_dag_id : str
995
+ The dag_id that contains the task you want to wait for.
996
+ external_task_ids : List[str]
997
+ The list of task_ids that you want to wait for.
998
+ If None (default value) the sensor waits for the DAG. (Default: None)
999
+ allowed_states : List[str]
1000
+ Iterable of allowed states, (Default: ['success'])
1001
+ failed_states : List[str]
1002
+ Iterable of failed or dis-allowed states. (Default: None)
1003
+ execution_delta : datetime.timedelta
1004
+ time difference with the previous execution to look at,
1005
+ the default is the same logical date as the current task or DAG. (Default: None)
1006
+ check_existence: bool
1007
+ Set to True to check if the external task exists or check if
1008
+ the DAG to wait for exists. (Default: True)
834
1009
  """
835
1010
  ...
836
1011
 
837
- @typing.overload
838
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
839
- ...
840
-
841
- @typing.overload
842
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
843
- ...
844
-
845
- def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
1012
+ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
846
1013
  """
847
- Specifies secrets to be retrieved and injected as environment variables prior to
848
- the execution of a step.
1014
+ The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
1015
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1016
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1017
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1018
+ starts only after all sensors finish.
849
1019
 
850
1020
 
851
1021
  Parameters
852
1022
  ----------
853
- sources : List[Union[str, Dict[str, Any]]], default: []
854
- List of secret specs, defining how the secrets are to be retrieved
855
- role : str, optional, default: None
856
- Role to use for fetching secrets
1023
+ timeout : int
1024
+ Time, in seconds before the task times out and fails. (Default: 3600)
1025
+ poke_interval : int
1026
+ Time in seconds that the job should wait in between each try. (Default: 60)
1027
+ mode : str
1028
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1029
+ exponential_backoff : bool
1030
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1031
+ pool : str
1032
+ the slot pool this task should run in,
1033
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1034
+ soft_fail : bool
1035
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1036
+ name : str
1037
+ Name of the sensor on Airflow
1038
+ description : str
1039
+ Description of sensor in the Airflow UI
1040
+ bucket_key : Union[str, List[str]]
1041
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1042
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1043
+ bucket_name : str
1044
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1045
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1046
+ wildcard_match : bool
1047
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1048
+ aws_conn_id : str
1049
+ a reference to the s3 connection on Airflow. (Default: None)
1050
+ verify : bool
1051
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
857
1052
  """
858
1053
  ...
859
1054
 
860
1055
  @typing.overload
861
- def environment(*, vars: typing.Dict[str, 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]]]:
1056
+ 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]]:
862
1057
  """
863
- Specifies environment variables to be set prior to the execution of a step.
1058
+ Specifies the times when the flow should be run when running on a
1059
+ production scheduler.
864
1060
 
865
1061
 
866
1062
  Parameters
867
1063
  ----------
868
- vars : Dict[str, str], default {}
869
- Dictionary of environment variables to set.
1064
+ hourly : bool, default False
1065
+ Run the workflow hourly.
1066
+ daily : bool, default True
1067
+ Run the workflow daily.
1068
+ weekly : bool, default False
1069
+ Run the workflow weekly.
1070
+ cron : str, optional, default None
1071
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1072
+ specified by this expression.
1073
+ timezone : str, optional, default None
1074
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1075
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
870
1076
  """
871
1077
  ...
872
1078
 
873
1079
  @typing.overload
874
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
875
- ...
876
-
877
- @typing.overload
878
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1080
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
879
1081
  ...
880
1082
 
881
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1083
+ 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):
882
1084
  """
883
- Specifies environment variables to be set prior to the execution of a step.
1085
+ Specifies the times when the flow should be run when running on a
1086
+ production scheduler.
884
1087
 
885
1088
 
886
1089
  Parameters
887
1090
  ----------
888
- vars : Dict[str, str], default {}
889
- Dictionary of environment variables to set.
1091
+ hourly : bool, default False
1092
+ Run the workflow hourly.
1093
+ daily : bool, default True
1094
+ Run the workflow daily.
1095
+ weekly : bool, default False
1096
+ Run the workflow weekly.
1097
+ cron : str, optional, default None
1098
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1099
+ specified by this expression.
1100
+ timezone : str, optional, default None
1101
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1102
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
890
1103
  """
891
1104
  ...
892
1105
 
@@ -991,47 +1204,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
991
1204
  """
992
1205
  ...
993
1206
 
994
- @typing.overload
995
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
996
- """
997
- Specifies the PyPI packages for all steps of the flow.
998
-
999
- Use `@pypi_base` to set common packages required by all
1000
- steps and use `@pypi` to specify step-specific overrides.
1001
-
1002
- Parameters
1003
- ----------
1004
- packages : Dict[str, str], default: {}
1005
- Packages to use for this flow. The key is the name of the package
1006
- and the value is the version to use.
1007
- python : str, optional, default: None
1008
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1009
- that the version used will correspond to the version of the Python interpreter used to start the run.
1010
- """
1011
- ...
1012
-
1013
- @typing.overload
1014
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1015
- ...
1016
-
1017
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1018
- """
1019
- Specifies the PyPI packages for all steps of the flow.
1020
-
1021
- Use `@pypi_base` to set common packages required by all
1022
- steps and use `@pypi` to specify step-specific overrides.
1023
-
1024
- Parameters
1025
- ----------
1026
- packages : Dict[str, str], default: {}
1027
- Packages to use for this flow. The key is the name of the package
1028
- and the value is the version to use.
1029
- python : str, optional, default: None
1030
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1031
- that the version used will correspond to the version of the Python interpreter used to start the run.
1032
- """
1033
- ...
1034
-
1035
1207
  @typing.overload
1036
1208
  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]]:
1037
1209
  """
@@ -1083,84 +1255,6 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1083
1255
  """
1084
1256
  ...
1085
1257
 
1086
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1087
- """
1088
- Specifies what flows belong to the same project.
1089
-
1090
- A project-specific namespace is created for all flows that
1091
- use the same `@project(name)`.
1092
-
1093
-
1094
- Parameters
1095
- ----------
1096
- name : str
1097
- Project name. Make sure that the name is unique amongst all
1098
- projects that use the same production scheduler. The name may
1099
- contain only lowercase alphanumeric characters and underscores.
1100
-
1101
- branch : Optional[str], default None
1102
- The branch to use. If not specified, the branch is set to
1103
- `user.<username>` unless `production` is set to `True`. This can
1104
- also be set on the command line using `--branch` as a top-level option.
1105
- It is an error to specify `branch` in the decorator and on the command line.
1106
-
1107
- production : bool, default False
1108
- Whether or not the branch is the production branch. This can also be set on the
1109
- command line using `--production` as a top-level option. It is an error to specify
1110
- `production` in the decorator and on the command line.
1111
- The project branch name will be:
1112
- - if `branch` is specified:
1113
- - if `production` is True: `prod.<branch>`
1114
- - if `production` is False: `test.<branch>`
1115
- - if `branch` is not specified:
1116
- - if `production` is True: `prod`
1117
- - if `production` is False: `user.<username>`
1118
- """
1119
- ...
1120
-
1121
- 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]]:
1122
- """
1123
- 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.
1124
- 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.
1125
-
1126
-
1127
- Parameters
1128
- ----------
1129
- timeout : int
1130
- Time, in seconds before the task times out and fails. (Default: 3600)
1131
- poke_interval : int
1132
- Time in seconds that the job should wait in between each try. (Default: 60)
1133
- mode : str
1134
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1135
- exponential_backoff : bool
1136
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1137
- pool : str
1138
- the slot pool this task should run in,
1139
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1140
- soft_fail : bool
1141
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1142
- name : str
1143
- Name of the sensor on Airflow
1144
- description : str
1145
- Description of sensor in the Airflow UI
1146
- external_dag_id : str
1147
- The dag_id that contains the task you want to wait for.
1148
- external_task_ids : List[str]
1149
- The list of task_ids that you want to wait for.
1150
- If None (default value) the sensor waits for the DAG. (Default: None)
1151
- allowed_states : List[str]
1152
- Iterable of allowed states, (Default: ['success'])
1153
- failed_states : List[str]
1154
- Iterable of failed or dis-allowed states. (Default: None)
1155
- execution_delta : datetime.timedelta
1156
- time difference with the previous execution to look at,
1157
- the default is the same logical date as the current task or DAG. (Default: None)
1158
- check_existence: bool
1159
- Set to True to check if the external task exists or check if
1160
- the DAG to wait for exists. (Default: True)
1161
- """
1162
- ...
1163
-
1164
1258
  @typing.overload
1165
1259
  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]]:
1166
1260
  """
@@ -1254,97 +1348,3 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1254
1348
  """
1255
1349
  ...
1256
1350
 
1257
- @typing.overload
1258
- 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]]:
1259
- """
1260
- Specifies the times when the flow should be run when running on a
1261
- production scheduler.
1262
-
1263
-
1264
- Parameters
1265
- ----------
1266
- hourly : bool, default False
1267
- Run the workflow hourly.
1268
- daily : bool, default True
1269
- Run the workflow daily.
1270
- weekly : bool, default False
1271
- Run the workflow weekly.
1272
- cron : str, optional, default None
1273
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1274
- specified by this expression.
1275
- timezone : str, optional, default None
1276
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1277
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1278
- """
1279
- ...
1280
-
1281
- @typing.overload
1282
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1283
- ...
1284
-
1285
- 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):
1286
- """
1287
- Specifies the times when the flow should be run when running on a
1288
- production scheduler.
1289
-
1290
-
1291
- Parameters
1292
- ----------
1293
- hourly : bool, default False
1294
- Run the workflow hourly.
1295
- daily : bool, default True
1296
- Run the workflow daily.
1297
- weekly : bool, default False
1298
- Run the workflow weekly.
1299
- cron : str, optional, default None
1300
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1301
- specified by this expression.
1302
- timezone : str, optional, default None
1303
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1304
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1305
- """
1306
- ...
1307
-
1308
- def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1309
- """
1310
- The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
1311
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1312
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1313
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1314
- starts only after all sensors finish.
1315
-
1316
-
1317
- Parameters
1318
- ----------
1319
- timeout : int
1320
- Time, in seconds before the task times out and fails. (Default: 3600)
1321
- poke_interval : int
1322
- Time in seconds that the job should wait in between each try. (Default: 60)
1323
- mode : str
1324
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1325
- exponential_backoff : bool
1326
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1327
- pool : str
1328
- the slot pool this task should run in,
1329
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1330
- soft_fail : bool
1331
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1332
- name : str
1333
- Name of the sensor on Airflow
1334
- description : str
1335
- Description of sensor in the Airflow UI
1336
- bucket_key : Union[str, List[str]]
1337
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1338
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1339
- bucket_name : str
1340
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1341
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1342
- wildcard_match : bool
1343
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1344
- aws_conn_id : str
1345
- a reference to the s3 connection on Airflow. (Default: None)
1346
- verify : bool
1347
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1348
- """
1349
- ...
1350
-