metaflow-stubs 2.15.4__py2.py3-none-any.whl → 2.15.6__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 (146) hide show
  1. metaflow-stubs/__init__.pyi +583 -583
  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 +6 -6
  8. metaflow-stubs/client/filecache.pyi +3 -3
  9. metaflow-stubs/events.pyi +3 -3
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +5 -5
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +3 -3
  14. metaflow-stubs/info_file.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 +3 -3
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +27 -27
  21. metaflow-stubs/multicore_utils.pyi +2 -2
  22. metaflow-stubs/parameters.pyi +3 -3
  23. metaflow-stubs/plugins/__init__.pyi +13 -13
  24. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  29. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  30. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  31. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  32. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_client.pyi +3 -3
  34. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  35. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
  37. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
  38. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +6 -4
  39. metaflow-stubs/plugins/aws/__init__.pyi +3 -3
  40. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  41. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  45. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  46. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  47. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +5 -5
  48. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  56. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  57. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  58. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +5 -5
  61. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  62. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  63. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  64. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  66. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  73. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  77. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  78. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  79. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  80. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  81. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  82. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  83. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  84. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  85. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  86. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  87. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  88. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  89. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  90. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  92. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  93. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +5 -5
  94. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  95. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  96. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  97. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  98. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
  100. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  101. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  102. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  103. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  105. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  106. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  107. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  109. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  110. metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
  111. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  112. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  114. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  115. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  116. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  118. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +4 -4
  119. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  121. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  122. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  123. metaflow-stubs/pylint_wrapper.pyi +2 -2
  124. metaflow-stubs/runner/__init__.pyi +2 -2
  125. metaflow-stubs/runner/deployer.pyi +33 -31
  126. metaflow-stubs/runner/deployer_impl.pyi +2 -2
  127. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  128. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  129. metaflow-stubs/runner/nbrun.pyi +2 -2
  130. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  131. metaflow-stubs/runner/utils.pyi +4 -4
  132. metaflow-stubs/system/__init__.pyi +2 -2
  133. metaflow-stubs/system/system_logger.pyi +2 -2
  134. metaflow-stubs/system/system_monitor.pyi +2 -2
  135. metaflow-stubs/tagging_util.pyi +2 -2
  136. metaflow-stubs/tuple_util.pyi +2 -2
  137. metaflow-stubs/user_configs/__init__.pyi +2 -2
  138. metaflow-stubs/user_configs/config_decorators.pyi +5 -5
  139. metaflow-stubs/user_configs/config_options.pyi +3 -3
  140. metaflow-stubs/user_configs/config_parameters.pyi +5 -5
  141. metaflow-stubs/version.pyi +2 -2
  142. {metaflow_stubs-2.15.4.dist-info → metaflow_stubs-2.15.6.dist-info}/METADATA +2 -2
  143. metaflow_stubs-2.15.6.dist-info/RECORD +146 -0
  144. {metaflow_stubs-2.15.4.dist-info → metaflow_stubs-2.15.6.dist-info}/WHEEL +1 -1
  145. metaflow_stubs-2.15.4.dist-info/RECORD +0 -146
  146. {metaflow_stubs-2.15.4.dist-info → metaflow_stubs-2.15.6.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.15.4 #
4
- # Generated on 2025-03-05T12:14:55.417380 #
3
+ # MF version: 2.15.6 #
4
+ # Generated on 2025-03-17T21:08:12.538673 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -42,8 +42,8 @@ from . import plugins as plugins
42
42
  from .plugins.datatools.s3.s3 import S3 as S3
43
43
  from . import includefile as includefile
44
44
  from .includefile import IncludeFile as IncludeFile
45
- from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
46
45
  from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
46
+ from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
47
47
  from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
48
48
  from . import cards as cards
49
49
  from . import client as client
@@ -145,6 +145,155 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
145
145
  """
146
146
  ...
147
147
 
148
+ @typing.overload
149
+ 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, 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]]]:
150
+ """
151
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
152
+
153
+
154
+ Parameters
155
+ ----------
156
+ cpu : int, default 1
157
+ Number of CPUs required for this step. If `@resources` is
158
+ also present, the maximum value from all decorators is used.
159
+ gpu : int, default 0
160
+ Number of GPUs required for this step. If `@resources` is
161
+ also present, the maximum value from all decorators is used.
162
+ memory : int, default 4096
163
+ Memory size (in MB) required for this step. If
164
+ `@resources` is also present, the maximum value from all decorators is
165
+ used.
166
+ image : str, optional, default None
167
+ Docker image to use when launching on AWS Batch. If not specified, and
168
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
169
+ not, a default Docker image mapping to the current version of Python is used.
170
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
171
+ AWS Batch Job Queue to submit the job to.
172
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
173
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
174
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
175
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
176
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
177
+ shared_memory : int, optional, default None
178
+ The value for the size (in MiB) of the /dev/shm volume for this step.
179
+ This parameter maps to the `--shm-size` option in Docker.
180
+ max_swap : int, optional, default None
181
+ The total amount of swap memory (in MiB) a container can use for this
182
+ step. This parameter is translated to the `--memory-swap` option in
183
+ Docker where the value is the sum of the container memory plus the
184
+ `max_swap` value.
185
+ swappiness : int, optional, default None
186
+ This allows you to tune memory swappiness behavior for this step.
187
+ A swappiness value of 0 causes swapping not to happen unless absolutely
188
+ necessary. A swappiness value of 100 causes pages to be swapped very
189
+ aggressively. Accepted values are whole numbers between 0 and 100.
190
+ use_tmpfs : bool, default False
191
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
192
+ not available on Fargate compute environments
193
+ tmpfs_tempdir : bool, default True
194
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
195
+ tmpfs_size : int, optional, default None
196
+ The value for the size (in MiB) of the tmpfs mount for this step.
197
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
198
+ memory allocated for this step.
199
+ tmpfs_path : str, optional, default None
200
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
201
+ inferentia : int, default 0
202
+ Number of Inferentia chips required for this step.
203
+ trainium : int, default None
204
+ Alias for inferentia. Use only one of the two.
205
+ efa : int, default 0
206
+ Number of elastic fabric adapter network devices to attach to container
207
+ ephemeral_storage : int, default None
208
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
209
+ This is only relevant for Fargate compute environments
210
+ log_driver: str, optional, default None
211
+ The log driver to use for the Amazon ECS container.
212
+ log_options: List[str], optional, default None
213
+ List of strings containing options for the chosen log driver. The configurable values
214
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
215
+ Example: [`awslogs-group:aws/batch/job`]
216
+ """
217
+ ...
218
+
219
+ @typing.overload
220
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
221
+ ...
222
+
223
+ @typing.overload
224
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
225
+ ...
226
+
227
+ 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, 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):
228
+ """
229
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
230
+
231
+
232
+ Parameters
233
+ ----------
234
+ cpu : int, default 1
235
+ Number of CPUs required for this step. If `@resources` is
236
+ also present, the maximum value from all decorators is used.
237
+ gpu : int, default 0
238
+ Number of GPUs required for this step. If `@resources` is
239
+ also present, the maximum value from all decorators is used.
240
+ memory : int, default 4096
241
+ Memory size (in MB) required for this step. If
242
+ `@resources` is also present, the maximum value from all decorators is
243
+ used.
244
+ image : str, optional, default None
245
+ Docker image to use when launching on AWS Batch. If not specified, and
246
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
247
+ not, a default Docker image mapping to the current version of Python is used.
248
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
249
+ AWS Batch Job Queue to submit the job to.
250
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
251
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
252
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
253
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
254
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
255
+ shared_memory : int, optional, default None
256
+ The value for the size (in MiB) of the /dev/shm volume for this step.
257
+ This parameter maps to the `--shm-size` option in Docker.
258
+ max_swap : int, optional, default None
259
+ The total amount of swap memory (in MiB) a container can use for this
260
+ step. This parameter is translated to the `--memory-swap` option in
261
+ Docker where the value is the sum of the container memory plus the
262
+ `max_swap` value.
263
+ swappiness : int, optional, default None
264
+ This allows you to tune memory swappiness behavior for this step.
265
+ A swappiness value of 0 causes swapping not to happen unless absolutely
266
+ necessary. A swappiness value of 100 causes pages to be swapped very
267
+ aggressively. Accepted values are whole numbers between 0 and 100.
268
+ use_tmpfs : bool, default False
269
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
270
+ not available on Fargate compute environments
271
+ tmpfs_tempdir : bool, default True
272
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
273
+ tmpfs_size : int, optional, default None
274
+ The value for the size (in MiB) of the tmpfs mount for this step.
275
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
276
+ memory allocated for this step.
277
+ tmpfs_path : str, optional, default None
278
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
279
+ inferentia : int, default 0
280
+ Number of Inferentia chips required for this step.
281
+ trainium : int, default None
282
+ Alias for inferentia. Use only one of the two.
283
+ efa : int, default 0
284
+ Number of elastic fabric adapter network devices to attach to container
285
+ ephemeral_storage : int, default None
286
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
287
+ This is only relevant for Fargate compute environments
288
+ log_driver: str, optional, default None
289
+ The log driver to use for the Amazon ECS container.
290
+ log_options: List[str], optional, default None
291
+ List of strings containing options for the chosen log driver. The configurable values
292
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
293
+ Example: [`awslogs-group:aws/batch/job`]
294
+ """
295
+ ...
296
+
148
297
  @typing.overload
149
298
  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]]]:
150
299
  """
@@ -201,178 +350,97 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
201
350
  ...
202
351
 
203
352
  @typing.overload
204
- 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]]]:
353
+ 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]]]:
205
354
  """
206
- Specifies the Conda environment for the step.
355
+ Specifies a timeout for your step.
207
356
 
208
- Information in this decorator will augment any
209
- attributes set in the `@conda_base` flow-level decorator. Hence,
210
- you can use `@conda_base` to set packages required by all
211
- steps and use `@conda` to specify step-specific overrides.
357
+ This decorator is useful if this step may hang indefinitely.
358
+
359
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
360
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
361
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
362
+
363
+ Note that all the values specified in parameters are added together so if you specify
364
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
212
365
 
213
366
 
214
367
  Parameters
215
368
  ----------
216
- packages : Dict[str, str], default {}
217
- Packages to use for this step. The key is the name of the package
218
- and the value is the version to use.
219
- libraries : Dict[str, str], default {}
220
- Supported for backward compatibility. When used with packages, packages will take precedence.
221
- python : str, optional, default None
222
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
223
- that the version used will correspond to the version of the Python interpreter used to start the run.
224
- disabled : bool, default False
225
- If set to True, disables @conda.
369
+ seconds : int, default 0
370
+ Number of seconds to wait prior to timing out.
371
+ minutes : int, default 0
372
+ Number of minutes to wait prior to timing out.
373
+ hours : int, default 0
374
+ Number of hours to wait prior to timing out.
226
375
  """
227
376
  ...
228
377
 
229
378
  @typing.overload
230
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
379
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
231
380
  ...
232
381
 
233
382
  @typing.overload
234
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
383
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
235
384
  ...
236
385
 
237
- 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):
386
+ 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):
238
387
  """
239
- Specifies the Conda environment for the step.
388
+ Specifies a timeout for your step.
240
389
 
241
- Information in this decorator will augment any
242
- attributes set in the `@conda_base` flow-level decorator. Hence,
243
- you can use `@conda_base` to set packages required by all
244
- steps and use `@conda` to specify step-specific overrides.
390
+ This decorator is useful if this step may hang indefinitely.
391
+
392
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
393
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
394
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
395
+
396
+ Note that all the values specified in parameters are added together so if you specify
397
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
245
398
 
246
399
 
247
400
  Parameters
248
401
  ----------
249
- packages : Dict[str, str], default {}
250
- Packages to use for this step. The key is the name of the package
251
- and the value is the version to use.
252
- libraries : Dict[str, str], default {}
253
- Supported for backward compatibility. When used with packages, packages will take precedence.
254
- python : str, optional, default None
255
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
256
- that the version used will correspond to the version of the Python interpreter used to start the run.
257
- disabled : bool, default False
258
- If set to True, disables @conda.
402
+ seconds : int, default 0
403
+ Number of seconds to wait prior to timing out.
404
+ minutes : int, default 0
405
+ Number of minutes to wait prior to timing out.
406
+ hours : int, default 0
407
+ Number of hours to wait prior to timing out.
259
408
  """
260
409
  ...
261
410
 
262
411
  @typing.overload
263
- 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]]]:
412
+ def pypi(*, packages: typing.Dict[str, str] = {}, python: 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]]]:
264
413
  """
265
- Specifies that the step will success under all circumstances.
414
+ Specifies the PyPI packages for the step.
266
415
 
267
- The decorator will create an optional artifact, specified by `var`, which
268
- contains the exception raised. You can use it to detect the presence
269
- of errors, indicating that all happy-path artifacts produced by the step
270
- are missing.
416
+ Information in this decorator will augment any
417
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
418
+ you can use `@pypi_base` to set packages required by all
419
+ steps and use `@pypi` to specify step-specific overrides.
271
420
 
272
421
 
273
422
  Parameters
274
423
  ----------
275
- var : str, optional, default None
276
- Name of the artifact in which to store the caught exception.
277
- If not specified, the exception is not stored.
278
- print_exception : bool, default True
279
- Determines whether or not the exception is printed to
280
- stdout when caught.
424
+ packages : Dict[str, str], default: {}
425
+ Packages to use for this step. The key is the name of the package
426
+ and the value is the version to use.
427
+ python : str, optional, default: None
428
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
429
+ that the version used will correspond to the version of the Python interpreter used to start the run.
281
430
  """
282
431
  ...
283
432
 
284
433
  @typing.overload
285
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
434
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
286
435
  ...
287
436
 
288
437
  @typing.overload
289
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
438
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
290
439
  ...
291
440
 
292
- 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):
441
+ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
293
442
  """
294
- Specifies that the step will success under all circumstances.
295
-
296
- The decorator will create an optional artifact, specified by `var`, which
297
- contains the exception raised. You can use it to detect the presence
298
- of errors, indicating that all happy-path artifacts produced by the step
299
- are missing.
300
-
301
-
302
- Parameters
303
- ----------
304
- var : str, optional, default None
305
- Name of the artifact in which to store the caught exception.
306
- If not specified, the exception is not stored.
307
- print_exception : bool, default True
308
- Determines whether or not the exception is printed to
309
- stdout when caught.
310
- """
311
- ...
312
-
313
- @typing.overload
314
- 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]]]:
315
- """
316
- Specifies a timeout for your step.
317
-
318
- This decorator is useful if this step may hang indefinitely.
319
-
320
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
321
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
322
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
323
-
324
- Note that all the values specified in parameters are added together so if you specify
325
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
326
-
327
-
328
- Parameters
329
- ----------
330
- seconds : int, default 0
331
- Number of seconds to wait prior to timing out.
332
- minutes : int, default 0
333
- Number of minutes to wait prior to timing out.
334
- hours : int, default 0
335
- Number of hours to wait prior to timing out.
336
- """
337
- ...
338
-
339
- @typing.overload
340
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
341
- ...
342
-
343
- @typing.overload
344
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
345
- ...
346
-
347
- 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):
348
- """
349
- Specifies a timeout for your step.
350
-
351
- This decorator is useful if this step may hang indefinitely.
352
-
353
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
354
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
355
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
356
-
357
- Note that all the values specified in parameters are added together so if you specify
358
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
359
-
360
-
361
- Parameters
362
- ----------
363
- seconds : int, default 0
364
- Number of seconds to wait prior to timing out.
365
- minutes : int, default 0
366
- Number of minutes to wait prior to timing out.
367
- hours : int, default 0
368
- Number of hours to wait prior to timing out.
369
- """
370
- ...
371
-
372
- @typing.overload
373
- def pypi(*, packages: typing.Dict[str, str] = {}, python: 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]]]:
374
- """
375
- Specifies the PyPI packages for the step.
443
+ Specifies the PyPI packages for the step.
376
444
 
377
445
  Information in this decorator will augment any
378
446
  attributes set in the `@pyi_base` flow-level decorator. Hence,
@@ -392,31 +460,37 @@ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] =
392
460
  ...
393
461
 
394
462
  @typing.overload
395
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
463
+ 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]]]:
464
+ """
465
+ Specifies secrets to be retrieved and injected as environment variables prior to
466
+ the execution of a step.
467
+
468
+
469
+ Parameters
470
+ ----------
471
+ sources : List[Union[str, Dict[str, Any]]], default: []
472
+ List of secret specs, defining how the secrets are to be retrieved
473
+ """
396
474
  ...
397
475
 
398
476
  @typing.overload
399
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
477
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
400
478
  ...
401
479
 
402
- def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
480
+ @typing.overload
481
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
482
+ ...
483
+
484
+ 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]]] = []):
403
485
  """
404
- Specifies the PyPI packages for the step.
405
-
406
- Information in this decorator will augment any
407
- attributes set in the `@pyi_base` flow-level decorator. Hence,
408
- you can use `@pypi_base` to set packages required by all
409
- steps and use `@pypi` to specify step-specific overrides.
486
+ Specifies secrets to be retrieved and injected as environment variables prior to
487
+ the execution of a step.
410
488
 
411
489
 
412
490
  Parameters
413
491
  ----------
414
- packages : Dict[str, str], default: {}
415
- Packages to use for this step. The key is the name of the package
416
- and the value is the version to use.
417
- python : str, optional, default: None
418
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
419
- that the version used will correspond to the version of the Python interpreter used to start the run.
492
+ sources : List[Union[str, Dict[str, Any]]], default: []
493
+ List of secret specs, defining how the secrets are to be retrieved
420
494
  """
421
495
  ...
422
496
 
@@ -454,51 +528,21 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
454
528
  ...
455
529
 
456
530
  @typing.overload
457
- 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]]]:
531
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
458
532
  """
459
- Creates a human-readable report, a Metaflow Card, after this step completes.
460
-
461
- Note that you may add multiple `@card` decorators in a step with different parameters.
462
-
463
-
464
- Parameters
465
- ----------
466
- type : str, default 'default'
467
- Card type.
468
- id : str, optional, default None
469
- If multiple cards are present, use this id to identify this card.
470
- options : Dict[str, Any], default {}
471
- Options passed to the card. The contents depend on the card type.
472
- timeout : int, default 45
473
- Interrupt reporting if it takes more than this many seconds.
533
+ Decorator prototype for all step decorators. This function gets specialized
534
+ and imported for all decorators types by _import_plugin_decorators().
474
535
  """
475
536
  ...
476
537
 
477
538
  @typing.overload
478
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
479
- ...
480
-
481
- @typing.overload
482
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
539
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
483
540
  ...
484
541
 
485
- 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):
542
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
486
543
  """
487
- Creates a human-readable report, a Metaflow Card, after this step completes.
488
-
489
- Note that you may add multiple `@card` decorators in a step with different parameters.
490
-
491
-
492
- Parameters
493
- ----------
494
- type : str, default 'default'
495
- Card type.
496
- id : str, optional, default None
497
- If multiple cards are present, use this id to identify this card.
498
- options : Dict[str, Any], default {}
499
- Options passed to the card. The contents depend on the card type.
500
- timeout : int, default 45
501
- Interrupt reporting if it takes more than this many seconds.
544
+ Decorator prototype for all step decorators. This function gets specialized
545
+ and imported for all decorators types by _import_plugin_decorators().
502
546
  """
503
547
  ...
504
548
 
@@ -582,170 +626,161 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
582
626
  ...
583
627
 
584
628
  @typing.overload
585
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
629
+ 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]]]:
586
630
  """
587
- Decorator prototype for all step decorators. This function gets specialized
588
- and imported for all decorators types by _import_plugin_decorators().
631
+ Creates a human-readable report, a Metaflow Card, after this step completes.
632
+
633
+ Note that you may add multiple `@card` decorators in a step with different parameters.
634
+
635
+
636
+ Parameters
637
+ ----------
638
+ type : str, default 'default'
639
+ Card type.
640
+ id : str, optional, default None
641
+ If multiple cards are present, use this id to identify this card.
642
+ options : Dict[str, Any], default {}
643
+ Options passed to the card. The contents depend on the card type.
644
+ timeout : int, default 45
645
+ Interrupt reporting if it takes more than this many seconds.
589
646
  """
590
647
  ...
591
648
 
592
649
  @typing.overload
593
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
650
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
594
651
  ...
595
652
 
596
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
653
+ @typing.overload
654
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
655
+ ...
656
+
657
+ 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):
597
658
  """
598
- Decorator prototype for all step decorators. This function gets specialized
599
- and imported for all decorators types by _import_plugin_decorators().
659
+ Creates a human-readable report, a Metaflow Card, after this step completes.
660
+
661
+ Note that you may add multiple `@card` decorators in a step with different parameters.
662
+
663
+
664
+ Parameters
665
+ ----------
666
+ type : str, default 'default'
667
+ Card type.
668
+ id : str, optional, default None
669
+ If multiple cards are present, use this id to identify this card.
670
+ options : Dict[str, Any], default {}
671
+ Options passed to the card. The contents depend on the card type.
672
+ timeout : int, default 45
673
+ Interrupt reporting if it takes more than this many seconds.
600
674
  """
601
675
  ...
602
676
 
603
677
  @typing.overload
604
- 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, 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]]]:
678
+ 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]]]:
605
679
  """
606
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
680
+ Specifies the Conda environment for the step.
681
+
682
+ Information in this decorator will augment any
683
+ attributes set in the `@conda_base` flow-level decorator. Hence,
684
+ you can use `@conda_base` to set packages required by all
685
+ steps and use `@conda` to specify step-specific overrides.
607
686
 
608
687
 
609
688
  Parameters
610
689
  ----------
611
- cpu : int, default 1
612
- Number of CPUs required for this step. If `@resources` is
613
- also present, the maximum value from all decorators is used.
614
- gpu : int, default 0
615
- Number of GPUs required for this step. If `@resources` is
616
- also present, the maximum value from all decorators is used.
617
- memory : int, default 4096
618
- Memory size (in MB) required for this step. If
619
- `@resources` is also present, the maximum value from all decorators is
620
- used.
621
- image : str, optional, default None
622
- Docker image to use when launching on AWS Batch. If not specified, and
623
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
624
- not, a default Docker image mapping to the current version of Python is used.
625
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
626
- AWS Batch Job Queue to submit the job to.
627
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
628
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
629
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
630
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
631
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
632
- shared_memory : int, optional, default None
633
- The value for the size (in MiB) of the /dev/shm volume for this step.
634
- This parameter maps to the `--shm-size` option in Docker.
635
- max_swap : int, optional, default None
636
- The total amount of swap memory (in MiB) a container can use for this
637
- step. This parameter is translated to the `--memory-swap` option in
638
- Docker where the value is the sum of the container memory plus the
639
- `max_swap` value.
640
- swappiness : int, optional, default None
641
- This allows you to tune memory swappiness behavior for this step.
642
- A swappiness value of 0 causes swapping not to happen unless absolutely
643
- necessary. A swappiness value of 100 causes pages to be swapped very
644
- aggressively. Accepted values are whole numbers between 0 and 100.
645
- use_tmpfs : bool, default False
646
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
647
- not available on Fargate compute environments
648
- tmpfs_tempdir : bool, default True
649
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
650
- tmpfs_size : int, optional, default None
651
- The value for the size (in MiB) of the tmpfs mount for this step.
652
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
653
- memory allocated for this step.
654
- tmpfs_path : str, optional, default None
655
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
656
- inferentia : int, default 0
657
- Number of Inferentia chips required for this step.
658
- trainium : int, default None
659
- Alias for inferentia. Use only one of the two.
660
- efa : int, default 0
661
- Number of elastic fabric adapter network devices to attach to container
662
- ephemeral_storage : int, default None
663
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
664
- This is only relevant for Fargate compute environments
665
- log_driver: str, optional, default None
666
- The log driver to use for the Amazon ECS container.
667
- log_options: List[str], optional, default None
668
- List of strings containing options for the chosen log driver. The configurable values
669
- depend on the `log driver` chosen. Validation of these options is not supported yet.
670
- Example: [`awslogs-group:aws/batch/job`]
690
+ packages : Dict[str, str], default {}
691
+ Packages to use for this step. The key is the name of the package
692
+ and the value is the version to use.
693
+ libraries : Dict[str, str], default {}
694
+ Supported for backward compatibility. When used with packages, packages will take precedence.
695
+ python : str, optional, default None
696
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
697
+ that the version used will correspond to the version of the Python interpreter used to start the run.
698
+ disabled : bool, default False
699
+ If set to True, disables @conda.
671
700
  """
672
701
  ...
673
702
 
674
703
  @typing.overload
675
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
704
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
676
705
  ...
677
706
 
678
707
  @typing.overload
679
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
708
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
680
709
  ...
681
710
 
682
- 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, 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):
711
+ 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):
683
712
  """
684
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
713
+ Specifies the Conda environment for the step.
714
+
715
+ Information in this decorator will augment any
716
+ attributes set in the `@conda_base` flow-level decorator. Hence,
717
+ you can use `@conda_base` to set packages required by all
718
+ steps and use `@conda` to specify step-specific overrides.
685
719
 
686
720
 
687
721
  Parameters
688
722
  ----------
689
- cpu : int, default 1
690
- Number of CPUs required for this step. If `@resources` is
691
- also present, the maximum value from all decorators is used.
692
- gpu : int, default 0
693
- Number of GPUs required for this step. If `@resources` is
694
- also present, the maximum value from all decorators is used.
695
- memory : int, default 4096
696
- Memory size (in MB) required for this step. If
697
- `@resources` is also present, the maximum value from all decorators is
698
- used.
699
- image : str, optional, default None
700
- Docker image to use when launching on AWS Batch. If not specified, and
701
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
702
- not, a default Docker image mapping to the current version of Python is used.
703
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
704
- AWS Batch Job Queue to submit the job to.
705
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
706
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
707
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
708
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
709
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
710
- shared_memory : int, optional, default None
711
- The value for the size (in MiB) of the /dev/shm volume for this step.
712
- This parameter maps to the `--shm-size` option in Docker.
713
- max_swap : int, optional, default None
714
- The total amount of swap memory (in MiB) a container can use for this
715
- step. This parameter is translated to the `--memory-swap` option in
716
- Docker where the value is the sum of the container memory plus the
717
- `max_swap` value.
718
- swappiness : int, optional, default None
719
- This allows you to tune memory swappiness behavior for this step.
720
- A swappiness value of 0 causes swapping not to happen unless absolutely
721
- necessary. A swappiness value of 100 causes pages to be swapped very
722
- aggressively. Accepted values are whole numbers between 0 and 100.
723
- use_tmpfs : bool, default False
724
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
725
- not available on Fargate compute environments
726
- tmpfs_tempdir : bool, default True
727
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
728
- tmpfs_size : int, optional, default None
729
- The value for the size (in MiB) of the tmpfs mount for this step.
730
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
731
- memory allocated for this step.
732
- tmpfs_path : str, optional, default None
733
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
734
- inferentia : int, default 0
735
- Number of Inferentia chips required for this step.
736
- trainium : int, default None
737
- Alias for inferentia. Use only one of the two.
738
- efa : int, default 0
739
- Number of elastic fabric adapter network devices to attach to container
740
- ephemeral_storage : int, default None
741
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
742
- This is only relevant for Fargate compute environments
743
- log_driver: str, optional, default None
744
- The log driver to use for the Amazon ECS container.
745
- log_options: List[str], optional, default None
746
- List of strings containing options for the chosen log driver. The configurable values
747
- depend on the `log driver` chosen. Validation of these options is not supported yet.
748
- Example: [`awslogs-group:aws/batch/job`]
723
+ packages : Dict[str, str], default {}
724
+ Packages to use for this step. The key is the name of the package
725
+ and the value is the version to use.
726
+ libraries : Dict[str, str], default {}
727
+ Supported for backward compatibility. When used with packages, packages will take precedence.
728
+ python : str, optional, default None
729
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
730
+ that the version used will correspond to the version of the Python interpreter used to start the run.
731
+ disabled : bool, default False
732
+ If set to True, disables @conda.
733
+ """
734
+ ...
735
+
736
+ @typing.overload
737
+ 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]]]:
738
+ """
739
+ Specifies that the step will success under all circumstances.
740
+
741
+ The decorator will create an optional artifact, specified by `var`, which
742
+ contains the exception raised. You can use it to detect the presence
743
+ of errors, indicating that all happy-path artifacts produced by the step
744
+ are missing.
745
+
746
+
747
+ Parameters
748
+ ----------
749
+ var : str, optional, default None
750
+ Name of the artifact in which to store the caught exception.
751
+ If not specified, the exception is not stored.
752
+ print_exception : bool, default True
753
+ Determines whether or not the exception is printed to
754
+ stdout when caught.
755
+ """
756
+ ...
757
+
758
+ @typing.overload
759
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
760
+ ...
761
+
762
+ @typing.overload
763
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
764
+ ...
765
+
766
+ 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):
767
+ """
768
+ Specifies that the step will success under all circumstances.
769
+
770
+ The decorator will create an optional artifact, specified by `var`, which
771
+ contains the exception raised. You can use it to detect the presence
772
+ of errors, indicating that all happy-path artifacts produced by the step
773
+ are missing.
774
+
775
+
776
+ Parameters
777
+ ----------
778
+ var : str, optional, default None
779
+ Name of the artifact in which to store the caught exception.
780
+ If not specified, the exception is not stored.
781
+ print_exception : bool, default True
782
+ Determines whether or not the exception is printed to
783
+ stdout when caught.
749
784
  """
750
785
  ...
751
786
 
@@ -826,38 +861,81 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
826
861
  """
827
862
  ...
828
863
 
829
- @typing.overload
830
- 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]]]:
864
+ 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]]:
831
865
  """
832
- Specifies secrets to be retrieved and injected as environment variables prior to
833
- the execution of a step.
866
+ 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.
867
+ 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.
834
868
 
835
869
 
836
870
  Parameters
837
871
  ----------
838
- sources : List[Union[str, Dict[str, Any]]], default: []
839
- List of secret specs, defining how the secrets are to be retrieved
872
+ timeout : int
873
+ Time, in seconds before the task times out and fails. (Default: 3600)
874
+ poke_interval : int
875
+ Time in seconds that the job should wait in between each try. (Default: 60)
876
+ mode : str
877
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
878
+ exponential_backoff : bool
879
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
880
+ pool : str
881
+ the slot pool this task should run in,
882
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
883
+ soft_fail : bool
884
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
885
+ name : str
886
+ Name of the sensor on Airflow
887
+ description : str
888
+ Description of sensor in the Airflow UI
889
+ external_dag_id : str
890
+ The dag_id that contains the task you want to wait for.
891
+ external_task_ids : List[str]
892
+ The list of task_ids that you want to wait for.
893
+ If None (default value) the sensor waits for the DAG. (Default: None)
894
+ allowed_states : List[str]
895
+ Iterable of allowed states, (Default: ['success'])
896
+ failed_states : List[str]
897
+ Iterable of failed or dis-allowed states. (Default: None)
898
+ execution_delta : datetime.timedelta
899
+ time difference with the previous execution to look at,
900
+ the default is the same logical date as the current task or DAG. (Default: None)
901
+ check_existence: bool
902
+ Set to True to check if the external task exists or check if
903
+ the DAG to wait for exists. (Default: True)
840
904
  """
841
905
  ...
842
906
 
843
- @typing.overload
844
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
845
- ...
846
-
847
- @typing.overload
848
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
849
- ...
850
-
851
- 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]]] = []):
907
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
852
908
  """
853
- Specifies secrets to be retrieved and injected as environment variables prior to
854
- the execution of a step.
909
+ Specifies what flows belong to the same project.
910
+
911
+ A project-specific namespace is created for all flows that
912
+ use the same `@project(name)`.
855
913
 
856
914
 
857
915
  Parameters
858
916
  ----------
859
- sources : List[Union[str, Dict[str, Any]]], default: []
860
- List of secret specs, defining how the secrets are to be retrieved
917
+ name : str
918
+ Project name. Make sure that the name is unique amongst all
919
+ projects that use the same production scheduler. The name may
920
+ contain only lowercase alphanumeric characters and underscores.
921
+
922
+ branch : Optional[str], default None
923
+ The branch to use. If not specified, the branch is set to
924
+ `user.<username>` unless `production` is set to `True`. This can
925
+ also be set on the command line using `--branch` as a top-level option.
926
+ It is an error to specify `branch` in the decorator and on the command line.
927
+
928
+ production : bool, default False
929
+ Whether or not the branch is the production branch. This can also be set on the
930
+ command line using `--production` as a top-level option. It is an error to specify
931
+ `production` in the decorator and on the command line.
932
+ The project branch name will be:
933
+ - if `branch` is specified:
934
+ - if `production` is True: `prod.<branch>`
935
+ - if `production` is False: `test.<branch>`
936
+ - if `branch` is not specified:
937
+ - if `production` is True: `prod`
938
+ - if `production` is False: `user.<username>`
861
939
  """
862
940
  ...
863
941
 
@@ -902,46 +980,147 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
902
980
  """
903
981
  ...
904
982
 
905
- 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]]:
983
+ @typing.overload
984
+ 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]]:
906
985
  """
907
- 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.
908
- 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.
986
+ Specifies the Conda environment for all steps of the flow.
987
+
988
+ Use `@conda_base` to set common libraries required by all
989
+ steps and use `@conda` to specify step-specific additions.
909
990
 
910
991
 
911
992
  Parameters
912
993
  ----------
913
- timeout : int
914
- Time, in seconds before the task times out and fails. (Default: 3600)
915
- poke_interval : int
916
- Time in seconds that the job should wait in between each try. (Default: 60)
917
- mode : str
918
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
919
- exponential_backoff : bool
920
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
921
- pool : str
922
- the slot pool this task should run in,
923
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
924
- soft_fail : bool
925
- Set to true to mark the task as SKIPPED on failure. (Default: False)
926
- name : str
927
- Name of the sensor on Airflow
928
- description : str
929
- Description of sensor in the Airflow UI
930
- external_dag_id : str
931
- The dag_id that contains the task you want to wait for.
932
- external_task_ids : List[str]
933
- The list of task_ids that you want to wait for.
934
- If None (default value) the sensor waits for the DAG. (Default: None)
935
- allowed_states : List[str]
936
- Iterable of allowed states, (Default: ['success'])
937
- failed_states : List[str]
938
- Iterable of failed or dis-allowed states. (Default: None)
939
- execution_delta : datetime.timedelta
940
- time difference with the previous execution to look at,
941
- the default is the same logical date as the current task or DAG. (Default: None)
942
- check_existence: bool
943
- Set to True to check if the external task exists or check if
944
- the DAG to wait for exists. (Default: True)
994
+ packages : Dict[str, str], default {}
995
+ Packages to use for this flow. The key is the name of the package
996
+ and the value is the version to use.
997
+ libraries : Dict[str, str], default {}
998
+ Supported for backward compatibility. When used with packages, packages will take precedence.
999
+ python : str, optional, default None
1000
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1001
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1002
+ disabled : bool, default False
1003
+ If set to True, disables Conda.
1004
+ """
1005
+ ...
1006
+
1007
+ @typing.overload
1008
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1009
+ ...
1010
+
1011
+ 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):
1012
+ """
1013
+ Specifies the Conda environment for all steps of the flow.
1014
+
1015
+ Use `@conda_base` to set common libraries required by all
1016
+ steps and use `@conda` to specify step-specific additions.
1017
+
1018
+
1019
+ Parameters
1020
+ ----------
1021
+ packages : Dict[str, str], default {}
1022
+ Packages to use for this flow. The key is the name of the package
1023
+ and the value is the version to use.
1024
+ libraries : Dict[str, str], default {}
1025
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1026
+ python : str, optional, default None
1027
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1028
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1029
+ disabled : bool, default False
1030
+ If set to True, disables Conda.
1031
+ """
1032
+ ...
1033
+
1034
+ @typing.overload
1035
+ 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]]:
1036
+ """
1037
+ Specifies the event(s) that this flow depends on.
1038
+
1039
+ ```
1040
+ @trigger(event='foo')
1041
+ ```
1042
+ or
1043
+ ```
1044
+ @trigger(events=['foo', 'bar'])
1045
+ ```
1046
+
1047
+ Additionally, you can specify the parameter mappings
1048
+ to map event payload to Metaflow parameters for the flow.
1049
+ ```
1050
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1051
+ ```
1052
+ or
1053
+ ```
1054
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1055
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1056
+ ```
1057
+
1058
+ 'parameters' can also be a list of strings and tuples like so:
1059
+ ```
1060
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1061
+ ```
1062
+ This is equivalent to:
1063
+ ```
1064
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1065
+ ```
1066
+
1067
+
1068
+ Parameters
1069
+ ----------
1070
+ event : Union[str, Dict[str, Any]], optional, default None
1071
+ Event dependency for this flow.
1072
+ events : List[Union[str, Dict[str, Any]]], default []
1073
+ Events dependency for this flow.
1074
+ options : Dict[str, Any], default {}
1075
+ Backend-specific configuration for tuning eventing behavior.
1076
+ """
1077
+ ...
1078
+
1079
+ @typing.overload
1080
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1081
+ ...
1082
+
1083
+ 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] = {}):
1084
+ """
1085
+ Specifies the event(s) that this flow depends on.
1086
+
1087
+ ```
1088
+ @trigger(event='foo')
1089
+ ```
1090
+ or
1091
+ ```
1092
+ @trigger(events=['foo', 'bar'])
1093
+ ```
1094
+
1095
+ Additionally, you can specify the parameter mappings
1096
+ to map event payload to Metaflow parameters for the flow.
1097
+ ```
1098
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1099
+ ```
1100
+ or
1101
+ ```
1102
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1103
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1104
+ ```
1105
+
1106
+ 'parameters' can also be a list of strings and tuples like so:
1107
+ ```
1108
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1109
+ ```
1110
+ This is equivalent to:
1111
+ ```
1112
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1113
+ ```
1114
+
1115
+
1116
+ Parameters
1117
+ ----------
1118
+ event : Union[str, Dict[str, Any]], optional, default None
1119
+ Event dependency for this flow.
1120
+ events : List[Union[str, Dict[str, Any]]], default []
1121
+ Events dependency for this flow.
1122
+ options : Dict[str, Any], default {}
1123
+ Backend-specific configuration for tuning eventing behavior.
945
1124
  """
946
1125
  ...
947
1126
 
@@ -988,57 +1167,6 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
988
1167
  """
989
1168
  ...
990
1169
 
991
- @typing.overload
992
- 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]]:
993
- """
994
- Specifies the times when the flow should be run when running on a
995
- production scheduler.
996
-
997
-
998
- Parameters
999
- ----------
1000
- hourly : bool, default False
1001
- Run the workflow hourly.
1002
- daily : bool, default True
1003
- Run the workflow daily.
1004
- weekly : bool, default False
1005
- Run the workflow weekly.
1006
- cron : str, optional, default None
1007
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1008
- specified by this expression.
1009
- timezone : str, optional, default None
1010
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1011
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1012
- """
1013
- ...
1014
-
1015
- @typing.overload
1016
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1017
- ...
1018
-
1019
- 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):
1020
- """
1021
- Specifies the times when the flow should be run when running on a
1022
- production scheduler.
1023
-
1024
-
1025
- Parameters
1026
- ----------
1027
- hourly : bool, default False
1028
- Run the workflow hourly.
1029
- daily : bool, default True
1030
- Run the workflow daily.
1031
- weekly : bool, default False
1032
- Run the workflow weekly.
1033
- cron : str, optional, default None
1034
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1035
- specified by this expression.
1036
- timezone : str, optional, default None
1037
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1038
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1039
- """
1040
- ...
1041
-
1042
1170
  @typing.overload
1043
1171
  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]]:
1044
1172
  """
@@ -1140,182 +1268,54 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1140
1268
  """
1141
1269
  ...
1142
1270
 
1143
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1144
- """
1145
- Specifies what flows belong to the same project.
1146
-
1147
- A project-specific namespace is created for all flows that
1148
- use the same `@project(name)`.
1149
-
1150
-
1151
- Parameters
1152
- ----------
1153
- name : str
1154
- Project name. Make sure that the name is unique amongst all
1155
- projects that use the same production scheduler. The name may
1156
- contain only lowercase alphanumeric characters and underscores.
1157
-
1158
- branch : Optional[str], default None
1159
- The branch to use. If not specified, the branch is set to
1160
- `user.<username>` unless `production` is set to `True`. This can
1161
- also be set on the command line using `--branch` as a top-level option.
1162
- It is an error to specify `branch` in the decorator and on the command line.
1163
-
1164
- production : bool, default False
1165
- Whether or not the branch is the production branch. This can also be set on the
1166
- command line using `--production` as a top-level option. It is an error to specify
1167
- `production` in the decorator and on the command line.
1168
- The project branch name will be:
1169
- - if `branch` is specified:
1170
- - if `production` is True: `prod.<branch>`
1171
- - if `production` is False: `test.<branch>`
1172
- - if `branch` is not specified:
1173
- - if `production` is True: `prod`
1174
- - if `production` is False: `user.<username>`
1175
- """
1176
- ...
1177
-
1178
- @typing.overload
1179
- 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]]:
1180
- """
1181
- Specifies the event(s) that this flow depends on.
1182
-
1183
- ```
1184
- @trigger(event='foo')
1185
- ```
1186
- or
1187
- ```
1188
- @trigger(events=['foo', 'bar'])
1189
- ```
1190
-
1191
- Additionally, you can specify the parameter mappings
1192
- to map event payload to Metaflow parameters for the flow.
1193
- ```
1194
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1195
- ```
1196
- or
1197
- ```
1198
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1199
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1200
- ```
1201
-
1202
- 'parameters' can also be a list of strings and tuples like so:
1203
- ```
1204
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1205
- ```
1206
- This is equivalent to:
1207
- ```
1208
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1209
- ```
1210
-
1211
-
1212
- Parameters
1213
- ----------
1214
- event : Union[str, Dict[str, Any]], optional, default None
1215
- Event dependency for this flow.
1216
- events : List[Union[str, Dict[str, Any]]], default []
1217
- Events dependency for this flow.
1218
- options : Dict[str, Any], default {}
1219
- Backend-specific configuration for tuning eventing behavior.
1220
- """
1221
- ...
1222
-
1223
- @typing.overload
1224
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1225
- ...
1226
-
1227
- 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] = {}):
1228
- """
1229
- Specifies the event(s) that this flow depends on.
1230
-
1231
- ```
1232
- @trigger(event='foo')
1233
- ```
1234
- or
1235
- ```
1236
- @trigger(events=['foo', 'bar'])
1237
- ```
1238
-
1239
- Additionally, you can specify the parameter mappings
1240
- to map event payload to Metaflow parameters for the flow.
1241
- ```
1242
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1243
- ```
1244
- or
1245
- ```
1246
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1247
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1248
- ```
1249
-
1250
- 'parameters' can also be a list of strings and tuples like so:
1251
- ```
1252
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1253
- ```
1254
- This is equivalent to:
1255
- ```
1256
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1257
- ```
1258
-
1259
-
1260
- Parameters
1261
- ----------
1262
- event : Union[str, Dict[str, Any]], optional, default None
1263
- Event dependency for this flow.
1264
- events : List[Union[str, Dict[str, Any]]], default []
1265
- Events dependency for this flow.
1266
- options : Dict[str, Any], default {}
1267
- Backend-specific configuration for tuning eventing behavior.
1268
- """
1269
- ...
1270
-
1271
1271
  @typing.overload
1272
- 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]]:
1272
+ 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]]:
1273
1273
  """
1274
- Specifies the Conda environment for all steps of the flow.
1275
-
1276
- Use `@conda_base` to set common libraries required by all
1277
- steps and use `@conda` to specify step-specific additions.
1274
+ Specifies the times when the flow should be run when running on a
1275
+ production scheduler.
1278
1276
 
1279
1277
 
1280
1278
  Parameters
1281
1279
  ----------
1282
- packages : Dict[str, str], default {}
1283
- Packages to use for this flow. The key is the name of the package
1284
- and the value is the version to use.
1285
- libraries : Dict[str, str], default {}
1286
- Supported for backward compatibility. When used with packages, packages will take precedence.
1287
- python : str, optional, default None
1288
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1289
- that the version used will correspond to the version of the Python interpreter used to start the run.
1290
- disabled : bool, default False
1291
- If set to True, disables Conda.
1280
+ hourly : bool, default False
1281
+ Run the workflow hourly.
1282
+ daily : bool, default True
1283
+ Run the workflow daily.
1284
+ weekly : bool, default False
1285
+ Run the workflow weekly.
1286
+ cron : str, optional, default None
1287
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1288
+ specified by this expression.
1289
+ timezone : str, optional, default None
1290
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1291
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1292
1292
  """
1293
1293
  ...
1294
1294
 
1295
1295
  @typing.overload
1296
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1296
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1297
1297
  ...
1298
1298
 
1299
- 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):
1299
+ 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):
1300
1300
  """
1301
- Specifies the Conda environment for all steps of the flow.
1302
-
1303
- Use `@conda_base` to set common libraries required by all
1304
- steps and use `@conda` to specify step-specific additions.
1301
+ Specifies the times when the flow should be run when running on a
1302
+ production scheduler.
1305
1303
 
1306
1304
 
1307
1305
  Parameters
1308
1306
  ----------
1309
- packages : Dict[str, str], default {}
1310
- Packages to use for this flow. The key is the name of the package
1311
- and the value is the version to use.
1312
- libraries : Dict[str, str], default {}
1313
- Supported for backward compatibility. When used with packages, packages will take precedence.
1314
- python : str, optional, default None
1315
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1316
- that the version used will correspond to the version of the Python interpreter used to start the run.
1317
- disabled : bool, default False
1318
- If set to True, disables Conda.
1307
+ hourly : bool, default False
1308
+ Run the workflow hourly.
1309
+ daily : bool, default True
1310
+ Run the workflow daily.
1311
+ weekly : bool, default False
1312
+ Run the workflow weekly.
1313
+ cron : str, optional, default None
1314
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1315
+ specified by this expression.
1316
+ timezone : str, optional, default None
1317
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1318
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1319
1319
  """
1320
1320
  ...
1321
1321