metaflow-stubs 2.12.39__py2.py3-none-any.whl → 2.13.1__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 (144) hide show
  1. metaflow-stubs/__init__.pyi +266 -265
  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 +3 -3
  11. metaflow-stubs/flowspec.pyi +7 -7
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +4 -4
  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 +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +6 -2
  20. metaflow-stubs/metaflow_current.pyi +27 -27
  21. metaflow-stubs/multicore_utils.pyi +2 -2
  22. metaflow-stubs/parameters.pyi +5 -5
  23. metaflow-stubs/plugins/__init__.pyi +14 -14
  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 +2 -2
  34. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  35. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -9
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -5
  37. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
  38. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +31 -3
  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 +9 -10
  46. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  47. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +16 -14
  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 +4 -4
  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 +4 -4
  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 +4 -2
  69. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  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 +2 -2
  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 +4 -4
  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 +25 -2
  100. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +4 -21
  101. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  102. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +12 -3
  103. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +3 -7
  104. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +10 -4
  105. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  106. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  107. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  108. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  109. metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
  110. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  111. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  112. metaflow-stubs/plugins/pypi/utils.pyi +6 -2
  113. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  114. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  115. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  116. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  117. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  120. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  121. metaflow-stubs/pylint_wrapper.pyi +2 -2
  122. metaflow-stubs/runner/__init__.pyi +2 -2
  123. metaflow-stubs/runner/deployer.pyi +28 -28
  124. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  125. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  126. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  127. metaflow-stubs/runner/nbrun.pyi +2 -2
  128. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  129. metaflow-stubs/runner/utils.pyi +4 -4
  130. metaflow-stubs/system/__init__.pyi +2 -2
  131. metaflow-stubs/system/system_logger.pyi +3 -3
  132. metaflow-stubs/system/system_monitor.pyi +2 -2
  133. metaflow-stubs/tagging_util.pyi +2 -2
  134. metaflow-stubs/tuple_util.pyi +2 -2
  135. metaflow-stubs/user_configs/__init__.pyi +2 -2
  136. metaflow-stubs/user_configs/config_decorators.pyi +6 -6
  137. metaflow-stubs/user_configs/config_options.pyi +9 -4
  138. metaflow-stubs/user_configs/config_parameters.pyi +7 -7
  139. metaflow-stubs/version.pyi +2 -2
  140. {metaflow_stubs-2.12.39.dist-info → metaflow_stubs-2.13.1.dist-info}/METADATA +2 -2
  141. metaflow_stubs-2.13.1.dist-info/RECORD +144 -0
  142. {metaflow_stubs-2.12.39.dist-info → metaflow_stubs-2.13.1.dist-info}/WHEEL +1 -1
  143. metaflow_stubs-2.12.39.dist-info/RECORD +0 -144
  144. {metaflow_stubs-2.12.39.dist-info → metaflow_stubs-2.13.1.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.39 #
4
- # Generated on 2024-12-10T16:02:32.687901 #
3
+ # MF version: 2.13.1 #
4
+ # Generated on 2025-01-06T13:29:15.375037 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import typing
12
11
  import datetime
12
+ import typing
13
13
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
14
14
  StepFlag = typing.NewType("StepFlag", bool)
15
15
 
@@ -31,6 +31,7 @@ from .parameters import Parameter as Parameter
31
31
  from .parameters import JSONTypeClass as JSONTypeClass
32
32
  from .parameters import JSONType as JSONType
33
33
  from .user_configs.config_parameters import Config as Config
34
+ from .user_configs.config_parameters import ConfigValue as ConfigValue
34
35
  from .user_configs.config_parameters import config_expr as config_expr
35
36
  from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
36
37
  from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
@@ -142,236 +143,236 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
142
143
  ...
143
144
 
144
145
  @typing.overload
145
- 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]]]:
146
+ 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]]]:
146
147
  """
147
- Specifies secrets to be retrieved and injected as environment variables prior to
148
- the execution of a step.
148
+ Specifies the number of times the task corresponding
149
+ to a step needs to be retried.
150
+
151
+ This decorator is useful for handling transient errors, such as networking issues.
152
+ If your task contains operations that can't be retried safely, e.g. database updates,
153
+ it is advisable to annotate it with `@retry(times=0)`.
154
+
155
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
156
+ decorator will execute a no-op task after all retries have been exhausted,
157
+ ensuring that the flow execution can continue.
149
158
  """
150
159
  ...
151
160
 
152
161
  @typing.overload
153
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
162
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
154
163
  ...
155
164
 
156
165
  @typing.overload
157
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
166
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
158
167
  ...
159
168
 
160
- 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]]] = []):
169
+ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
161
170
  """
162
- Specifies secrets to be retrieved and injected as environment variables prior to
163
- the execution of a step.
171
+ Specifies the number of times the task corresponding
172
+ to a step needs to be retried.
173
+
174
+ This decorator is useful for handling transient errors, such as networking issues.
175
+ If your task contains operations that can't be retried safely, e.g. database updates,
176
+ it is advisable to annotate it with `@retry(times=0)`.
177
+
178
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
179
+ decorator will execute a no-op task after all retries have been exhausted,
180
+ ensuring that the flow execution can continue.
164
181
  """
165
182
  ...
166
183
 
167
184
  @typing.overload
168
- 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]]]:
185
+ 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]]]:
169
186
  """
170
- Specifies the Conda environment for the step.
187
+ Specifies the PyPI packages for the step.
171
188
 
172
189
  Information in this decorator will augment any
173
- attributes set in the `@conda_base` flow-level decorator. Hence,
174
- you can use `@conda_base` to set packages required by all
175
- steps and use `@conda` to specify step-specific overrides.
190
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
191
+ you can use `@pypi_base` to set packages required by all
192
+ steps and use `@pypi` to specify step-specific overrides.
176
193
  """
177
194
  ...
178
195
 
179
196
  @typing.overload
180
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
197
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
181
198
  ...
182
199
 
183
200
  @typing.overload
184
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
201
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
185
202
  ...
186
203
 
187
- 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):
204
+ 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):
188
205
  """
189
- Specifies the Conda environment for the step.
206
+ Specifies the PyPI packages for the step.
190
207
 
191
208
  Information in this decorator will augment any
192
- attributes set in the `@conda_base` flow-level decorator. Hence,
193
- you can use `@conda_base` to set packages required by all
194
- steps and use `@conda` to specify step-specific overrides.
209
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
210
+ you can use `@pypi_base` to set packages required by all
211
+ steps and use `@pypi` to specify step-specific overrides.
195
212
  """
196
213
  ...
197
214
 
198
215
  @typing.overload
199
- def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
216
+ 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]]]:
200
217
  """
201
- Specifies the resources needed when executing this step.
202
-
203
- Use `@resources` to specify the resource requirements
204
- independently of the specific compute layer (`@batch`, `@kubernetes`).
205
-
206
- You can choose the compute layer on the command line by executing e.g.
207
- ```
208
- python myflow.py run --with batch
209
- ```
210
- or
211
- ```
212
- python myflow.py run --with kubernetes
213
- ```
214
- which executes the flow on the desired system using the
215
- requirements specified in `@resources`.
218
+ Specifies environment variables to be set prior to the execution of a step.
216
219
  """
217
220
  ...
218
221
 
219
222
  @typing.overload
220
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
223
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
221
224
  ...
222
225
 
223
226
  @typing.overload
224
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
227
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
225
228
  ...
226
229
 
227
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
230
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
228
231
  """
229
- Specifies the resources needed when executing this step.
230
-
231
- Use `@resources` to specify the resource requirements
232
- independently of the specific compute layer (`@batch`, `@kubernetes`).
233
-
234
- You can choose the compute layer on the command line by executing e.g.
235
- ```
236
- python myflow.py run --with batch
237
- ```
238
- or
239
- ```
240
- python myflow.py run --with kubernetes
241
- ```
242
- which executes the flow on the desired system using the
243
- requirements specified in `@resources`.
232
+ Specifies environment variables to be set prior to the execution of a step.
244
233
  """
245
234
  ...
246
235
 
247
236
  @typing.overload
248
- 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]]]:
237
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
249
238
  """
250
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
239
+ Decorator prototype for all step decorators. This function gets specialized
240
+ and imported for all decorators types by _import_plugin_decorators().
251
241
  """
252
242
  ...
253
243
 
254
244
  @typing.overload
255
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
256
- ...
257
-
258
- @typing.overload
259
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
245
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
260
246
  ...
261
247
 
262
- 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):
248
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
263
249
  """
264
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
250
+ Decorator prototype for all step decorators. This function gets specialized
251
+ and imported for all decorators types by _import_plugin_decorators().
265
252
  """
266
253
  ...
267
254
 
268
255
  @typing.overload
269
- 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]]]:
256
+ 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]]]:
270
257
  """
271
- Creates a human-readable report, a Metaflow Card, after this step completes.
258
+ Specifies a timeout for your step.
272
259
 
273
- Note that you may add multiple `@card` decorators in a step with different parameters.
260
+ This decorator is useful if this step may hang indefinitely.
261
+
262
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
263
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
264
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
265
+
266
+ Note that all the values specified in parameters are added together so if you specify
267
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
274
268
  """
275
269
  ...
276
270
 
277
271
  @typing.overload
278
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
272
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
279
273
  ...
280
274
 
281
275
  @typing.overload
282
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
276
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
283
277
  ...
284
278
 
285
- 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):
279
+ 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):
286
280
  """
287
- Creates a human-readable report, a Metaflow Card, after this step completes.
281
+ Specifies a timeout for your step.
288
282
 
289
- Note that you may add multiple `@card` decorators in a step with different parameters.
283
+ This decorator is useful if this step may hang indefinitely.
284
+
285
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
286
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
287
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
288
+
289
+ Note that all the values specified in parameters are added together so if you specify
290
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
290
291
  """
291
292
  ...
292
293
 
293
294
  @typing.overload
294
- 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]]]:
295
+ 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]]]:
295
296
  """
296
- Specifies environment variables to be set prior to the execution of a step.
297
+ Specifies the Conda environment for the step.
298
+
299
+ Information in this decorator will augment any
300
+ attributes set in the `@conda_base` flow-level decorator. Hence,
301
+ you can use `@conda_base` to set packages required by all
302
+ steps and use `@conda` to specify step-specific overrides.
297
303
  """
298
304
  ...
299
305
 
300
306
  @typing.overload
301
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
307
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
302
308
  ...
303
309
 
304
310
  @typing.overload
305
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
306
- ...
307
-
308
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
309
- """
310
- Specifies environment variables to be set prior to the execution of a step.
311
- """
311
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
312
312
  ...
313
313
 
314
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', 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[str] = [], 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') -> 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]]]:
314
+ 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):
315
315
  """
316
- Specifies that this step should execute on Kubernetes.
316
+ Specifies the Conda environment for the step.
317
+
318
+ Information in this decorator will augment any
319
+ attributes set in the `@conda_base` flow-level decorator. Hence,
320
+ you can use `@conda_base` to set packages required by all
321
+ steps and use `@conda` to specify step-specific overrides.
317
322
  """
318
323
  ...
319
324
 
320
325
  @typing.overload
321
- 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]]]:
326
+ 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]]]:
322
327
  """
323
- Specifies the number of times the task corresponding
324
- to a step needs to be retried.
325
-
326
- This decorator is useful for handling transient errors, such as networking issues.
327
- If your task contains operations that can't be retried safely, e.g. database updates,
328
- it is advisable to annotate it with `@retry(times=0)`.
328
+ Creates a human-readable report, a Metaflow Card, after this step completes.
329
329
 
330
- This can be used in conjunction with the `@catch` decorator. The `@catch`
331
- decorator will execute a no-op task after all retries have been exhausted,
332
- ensuring that the flow execution can continue.
330
+ Note that you may add multiple `@card` decorators in a step with different parameters.
333
331
  """
334
332
  ...
335
333
 
336
334
  @typing.overload
337
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
335
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
338
336
  ...
339
337
 
340
338
  @typing.overload
341
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
339
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
342
340
  ...
343
341
 
344
- def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
342
+ 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):
345
343
  """
346
- Specifies the number of times the task corresponding
347
- to a step needs to be retried.
348
-
349
- This decorator is useful for handling transient errors, such as networking issues.
350
- If your task contains operations that can't be retried safely, e.g. database updates,
351
- it is advisable to annotate it with `@retry(times=0)`.
344
+ Creates a human-readable report, a Metaflow Card, after this step completes.
352
345
 
353
- This can be used in conjunction with the `@catch` decorator. The `@catch`
354
- decorator will execute a no-op task after all retries have been exhausted,
355
- ensuring that the flow execution can continue.
346
+ Note that you may add multiple `@card` decorators in a step with different parameters.
347
+ """
348
+ ...
349
+
350
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', 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[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') -> 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]]]:
351
+ """
352
+ Specifies that this step should execute on Kubernetes.
356
353
  """
357
354
  ...
358
355
 
359
356
  @typing.overload
360
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
357
+ 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]]]:
361
358
  """
362
- Decorator prototype for all step decorators. This function gets specialized
363
- and imported for all decorators types by _import_plugin_decorators().
359
+ Specifies secrets to be retrieved and injected as environment variables prior to
360
+ the execution of a step.
364
361
  """
365
362
  ...
366
363
 
367
364
  @typing.overload
368
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
365
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
369
366
  ...
370
367
 
371
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
368
+ @typing.overload
369
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
370
+ ...
371
+
372
+ 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]]] = []):
372
373
  """
373
- Decorator prototype for all step decorators. This function gets specialized
374
- and imported for all decorators types by _import_plugin_decorators().
374
+ Specifies secrets to be retrieved and injected as environment variables prior to
375
+ the execution of a step.
375
376
  """
376
377
  ...
377
378
 
@@ -407,72 +408,184 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
407
408
  ...
408
409
 
409
410
  @typing.overload
410
- 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]]]:
411
+ def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
411
412
  """
412
- Specifies the PyPI packages for the step.
413
+ Specifies the resources needed when executing this step.
413
414
 
414
- Information in this decorator will augment any
415
- attributes set in the `@pyi_base` flow-level decorator. Hence,
416
- you can use `@pypi_base` to set packages required by all
417
- steps and use `@pypi` to specify step-specific overrides.
415
+ Use `@resources` to specify the resource requirements
416
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
417
+
418
+ You can choose the compute layer on the command line by executing e.g.
419
+ ```
420
+ python myflow.py run --with batch
421
+ ```
422
+ or
423
+ ```
424
+ python myflow.py run --with kubernetes
425
+ ```
426
+ which executes the flow on the desired system using the
427
+ requirements specified in `@resources`.
418
428
  """
419
429
  ...
420
430
 
421
431
  @typing.overload
422
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
432
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
423
433
  ...
424
434
 
425
435
  @typing.overload
426
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
436
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
427
437
  ...
428
438
 
429
- 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):
439
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
430
440
  """
431
- Specifies the PyPI packages for the step.
441
+ Specifies the resources needed when executing this step.
432
442
 
433
- Information in this decorator will augment any
434
- attributes set in the `@pyi_base` flow-level decorator. Hence,
435
- you can use `@pypi_base` to set packages required by all
436
- steps and use `@pypi` to specify step-specific overrides.
443
+ Use `@resources` to specify the resource requirements
444
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
445
+
446
+ You can choose the compute layer on the command line by executing e.g.
447
+ ```
448
+ python myflow.py run --with batch
449
+ ```
450
+ or
451
+ ```
452
+ python myflow.py run --with kubernetes
453
+ ```
454
+ which executes the flow on the desired system using the
455
+ requirements specified in `@resources`.
437
456
  """
438
457
  ...
439
458
 
440
459
  @typing.overload
441
- 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]]]:
460
+ 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]]]:
442
461
  """
443
- Specifies a timeout for your step.
462
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
463
+ """
464
+ ...
465
+
466
+ @typing.overload
467
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
468
+ ...
469
+
470
+ @typing.overload
471
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
472
+ ...
473
+
474
+ 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):
475
+ """
476
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
477
+ """
478
+ ...
479
+
480
+ @typing.overload
481
+ 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]]:
482
+ """
483
+ Specifies the Conda environment for all steps of the flow.
444
484
 
445
- This decorator is useful if this step may hang indefinitely.
485
+ Use `@conda_base` to set common libraries required by all
486
+ steps and use `@conda` to specify step-specific additions.
487
+ """
488
+ ...
489
+
490
+ @typing.overload
491
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
492
+ ...
493
+
494
+ 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):
495
+ """
496
+ Specifies the Conda environment for all steps of the flow.
446
497
 
447
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
448
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
449
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
498
+ Use `@conda_base` to set common libraries required by all
499
+ steps and use `@conda` to specify step-specific additions.
500
+ """
501
+ ...
502
+
503
+ 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]]:
504
+ """
505
+ 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.
506
+ 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.
507
+ """
508
+ ...
509
+
510
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
511
+ """
512
+ Specifies what flows belong to the same project.
450
513
 
451
- Note that all the values specified in parameters are added together so if you specify
452
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
514
+ A project-specific namespace is created for all flows that
515
+ use the same `@project(name)`.
453
516
  """
454
517
  ...
455
518
 
456
519
  @typing.overload
457
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
520
+ 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]]:
521
+ """
522
+ Specifies the event(s) that this flow depends on.
523
+
524
+ ```
525
+ @trigger(event='foo')
526
+ ```
527
+ or
528
+ ```
529
+ @trigger(events=['foo', 'bar'])
530
+ ```
531
+
532
+ Additionally, you can specify the parameter mappings
533
+ to map event payload to Metaflow parameters for the flow.
534
+ ```
535
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
536
+ ```
537
+ or
538
+ ```
539
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
540
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
541
+ ```
542
+
543
+ 'parameters' can also be a list of strings and tuples like so:
544
+ ```
545
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
546
+ ```
547
+ This is equivalent to:
548
+ ```
549
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
550
+ ```
551
+ """
458
552
  ...
459
553
 
460
554
  @typing.overload
461
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
555
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
462
556
  ...
463
557
 
464
- 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):
558
+ 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] = {}):
465
559
  """
466
- Specifies a timeout for your step.
560
+ Specifies the event(s) that this flow depends on.
467
561
 
468
- This decorator is useful if this step may hang indefinitely.
562
+ ```
563
+ @trigger(event='foo')
564
+ ```
565
+ or
566
+ ```
567
+ @trigger(events=['foo', 'bar'])
568
+ ```
469
569
 
470
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
471
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
472
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
570
+ Additionally, you can specify the parameter mappings
571
+ to map event payload to Metaflow parameters for the flow.
572
+ ```
573
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
574
+ ```
575
+ or
576
+ ```
577
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
578
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
579
+ ```
473
580
 
474
- Note that all the values specified in parameters are added together so if you specify
475
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
581
+ 'parameters' can also be a list of strings and tuples like so:
582
+ ```
583
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
584
+ ```
585
+ This is equivalent to:
586
+ ```
587
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
588
+ ```
476
589
  """
477
590
  ...
478
591
 
@@ -557,32 +670,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
557
670
  """
558
671
  ...
559
672
 
560
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
561
- """
562
- Specifies what flows belong to the same project.
563
-
564
- A project-specific namespace is created for all flows that
565
- use the same `@project(name)`.
566
- """
567
- ...
568
-
569
- 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]]:
570
- """
571
- 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.
572
- 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.
573
- """
574
- ...
575
-
576
- 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]]:
577
- """
578
- 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)
579
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
580
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
581
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
582
- starts only after all sensors finish.
583
- """
584
- ...
585
-
586
673
  @typing.overload
587
674
  def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
588
675
  """
@@ -606,99 +693,13 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
606
693
  """
607
694
  ...
608
695
 
609
- @typing.overload
610
- 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]]:
611
- """
612
- Specifies the Conda environment for all steps of the flow.
613
-
614
- Use `@conda_base` to set common libraries required by all
615
- steps and use `@conda` to specify step-specific additions.
616
- """
617
- ...
618
-
619
- @typing.overload
620
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
621
- ...
622
-
623
- 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):
624
- """
625
- Specifies the Conda environment for all steps of the flow.
626
-
627
- Use `@conda_base` to set common libraries required by all
628
- steps and use `@conda` to specify step-specific additions.
629
- """
630
- ...
631
-
632
- @typing.overload
633
- 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]]:
634
- """
635
- Specifies the event(s) that this flow depends on.
636
-
637
- ```
638
- @trigger(event='foo')
639
- ```
640
- or
641
- ```
642
- @trigger(events=['foo', 'bar'])
643
- ```
644
-
645
- Additionally, you can specify the parameter mappings
646
- to map event payload to Metaflow parameters for the flow.
647
- ```
648
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
649
- ```
650
- or
651
- ```
652
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
653
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
654
- ```
655
-
656
- 'parameters' can also be a list of strings and tuples like so:
657
- ```
658
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
659
- ```
660
- This is equivalent to:
661
- ```
662
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
663
- ```
664
- """
665
- ...
666
-
667
- @typing.overload
668
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
669
- ...
670
-
671
- 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] = {}):
696
+ 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]]:
672
697
  """
673
- Specifies the event(s) that this flow depends on.
674
-
675
- ```
676
- @trigger(event='foo')
677
- ```
678
- or
679
- ```
680
- @trigger(events=['foo', 'bar'])
681
- ```
682
-
683
- Additionally, you can specify the parameter mappings
684
- to map event payload to Metaflow parameters for the flow.
685
- ```
686
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
687
- ```
688
- or
689
- ```
690
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
691
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
692
- ```
693
-
694
- 'parameters' can also be a list of strings and tuples like so:
695
- ```
696
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
697
- ```
698
- This is equivalent to:
699
- ```
700
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
701
- ```
698
+ 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)
699
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
700
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
701
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
702
+ starts only after all sensors finish.
702
703
  """
703
704
  ...
704
705