metaflow-stubs 2.17.2__py2.py3-none-any.whl → 2.17.4__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (166) hide show
  1. metaflow-stubs/__init__.pyi +477 -477
  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 +3 -3
  9. metaflow-stubs/events.pyi +3 -3
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +6 -6
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +4 -4
  14. metaflow-stubs/meta_files.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +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 +22 -22
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/multicore_utils.pyi +2 -2
  23. metaflow-stubs/packaging_sys/__init__.pyi +5 -5
  24. metaflow-stubs/packaging_sys/backend.pyi +3 -3
  25. metaflow-stubs/packaging_sys/distribution_support.pyi +5 -5
  26. metaflow-stubs/packaging_sys/tar_backend.pyi +6 -6
  27. metaflow-stubs/packaging_sys/utils.pyi +2 -2
  28. metaflow-stubs/packaging_sys/v1.pyi +4 -4
  29. metaflow-stubs/parameters.pyi +4 -4
  30. metaflow-stubs/plugins/__init__.pyi +13 -13
  31. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  32. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  33. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  34. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  35. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  36. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  37. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  38. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  39. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  40. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  41. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  42. metaflow-stubs/plugins/argo/argo_workflows.pyi +7 -3
  43. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
  44. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
  45. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  46. metaflow-stubs/plugins/argo/exit_hooks.pyi +3 -3
  47. metaflow-stubs/plugins/aws/__init__.pyi +3 -3
  48. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  50. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  51. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  52. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  53. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  54. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  55. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  56. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  58. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  59. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  60. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
  64. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  65. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  67. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  68. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  69. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  70. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  71. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  72. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  81. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  82. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  83. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  84. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  85. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  86. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  87. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  88. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  89. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  90. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  92. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  93. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  94. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  95. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  96. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  97. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  98. metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
  100. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  103. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  104. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  105. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  106. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  107. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  108. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
  110. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  112. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  114. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  115. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  116. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  119. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  121. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  122. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  124. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  125. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  126. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  127. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  128. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  129. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  130. metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
  131. metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
  132. metaflow-stubs/plugins/secrets/utils.pyi +2 -2
  133. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  134. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  135. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  136. metaflow-stubs/plugins/uv/__init__.pyi +2 -2
  137. metaflow-stubs/plugins/uv/uv_environment.pyi +2 -2
  138. metaflow-stubs/pylint_wrapper.pyi +2 -2
  139. metaflow-stubs/runner/__init__.pyi +2 -2
  140. metaflow-stubs/runner/deployer.pyi +33 -33
  141. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  142. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  143. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  144. metaflow-stubs/runner/nbrun.pyi +2 -2
  145. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  146. metaflow-stubs/runner/utils.pyi +4 -4
  147. metaflow-stubs/system/__init__.pyi +2 -2
  148. metaflow-stubs/system/system_logger.pyi +3 -3
  149. metaflow-stubs/system/system_monitor.pyi +2 -2
  150. metaflow-stubs/tagging_util.pyi +2 -2
  151. metaflow-stubs/tuple_util.pyi +2 -2
  152. metaflow-stubs/user_configs/__init__.pyi +2 -2
  153. metaflow-stubs/user_configs/config_options.pyi +3 -3
  154. metaflow-stubs/user_configs/config_parameters.pyi +6 -6
  155. metaflow-stubs/user_decorators/__init__.pyi +2 -2
  156. metaflow-stubs/user_decorators/common.pyi +2 -2
  157. metaflow-stubs/user_decorators/mutable_flow.pyi +5 -5
  158. metaflow-stubs/user_decorators/mutable_step.pyi +6 -6
  159. metaflow-stubs/user_decorators/user_flow_decorator.pyi +4 -4
  160. metaflow-stubs/user_decorators/user_step_decorator.pyi +7 -7
  161. metaflow-stubs/version.pyi +2 -2
  162. {metaflow_stubs-2.17.2.dist-info → metaflow_stubs-2.17.4.dist-info}/METADATA +2 -2
  163. metaflow_stubs-2.17.4.dist-info/RECORD +166 -0
  164. metaflow_stubs-2.17.2.dist-info/RECORD +0 -166
  165. {metaflow_stubs-2.17.2.dist-info → metaflow_stubs-2.17.4.dist-info}/WHEEL +0 -0
  166. {metaflow_stubs-2.17.2.dist-info → metaflow_stubs-2.17.4.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.17.2 #
4
- # Generated on 2025-08-19T21:01:04.587987 #
3
+ # MF version: 2.17.4 #
4
+ # Generated on 2025-08-25T17:38:02.332471 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -40,16 +40,16 @@ from .user_decorators.user_step_decorator import StepMutator as StepMutator
40
40
  from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
41
41
  from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
42
42
  from . import metaflow_git as metaflow_git
43
- from . import events as events
44
43
  from . import tuple_util as tuple_util
44
+ from . import events as events
45
45
  from . import runner as runner
46
46
  from . import plugins as plugins
47
47
  from .plugins.datatools.s3.s3 import S3 as S3
48
48
  from . import includefile as includefile
49
49
  from .includefile import IncludeFile as IncludeFile
50
50
  from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
51
- from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
52
51
  from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
52
+ from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
53
53
  from . import cards as cards
54
54
  from . import client as client
55
55
  from .client.core import namespace as namespace
@@ -153,61 +153,53 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
153
153
  ...
154
154
 
155
155
  @typing.overload
156
- 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]]]:
156
+ 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]]]:
157
157
  """
158
- Specifies the Conda environment for the step.
158
+ Specifies that the step will success under all circumstances.
159
159
 
160
- Information in this decorator will augment any
161
- attributes set in the `@conda_base` flow-level decorator. Hence,
162
- you can use `@conda_base` to set packages required by all
163
- steps and use `@conda` to specify step-specific overrides.
160
+ The decorator will create an optional artifact, specified by `var`, which
161
+ contains the exception raised. You can use it to detect the presence
162
+ of errors, indicating that all happy-path artifacts produced by the step
163
+ are missing.
164
164
 
165
165
 
166
166
  Parameters
167
167
  ----------
168
- packages : Dict[str, str], default {}
169
- Packages to use for this step. The key is the name of the package
170
- and the value is the version to use.
171
- libraries : Dict[str, str], default {}
172
- Supported for backward compatibility. When used with packages, packages will take precedence.
173
- python : str, optional, default None
174
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
175
- that the version used will correspond to the version of the Python interpreter used to start the run.
176
- disabled : bool, default False
177
- If set to True, disables @conda.
168
+ var : str, optional, default None
169
+ Name of the artifact in which to store the caught exception.
170
+ If not specified, the exception is not stored.
171
+ print_exception : bool, default True
172
+ Determines whether or not the exception is printed to
173
+ stdout when caught.
178
174
  """
179
175
  ...
180
176
 
181
177
  @typing.overload
182
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
178
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
183
179
  ...
184
180
 
185
181
  @typing.overload
186
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
182
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
187
183
  ...
188
184
 
189
- 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):
185
+ 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):
190
186
  """
191
- Specifies the Conda environment for the step.
187
+ Specifies that the step will success under all circumstances.
192
188
 
193
- Information in this decorator will augment any
194
- attributes set in the `@conda_base` flow-level decorator. Hence,
195
- you can use `@conda_base` to set packages required by all
196
- steps and use `@conda` to specify step-specific overrides.
189
+ The decorator will create an optional artifact, specified by `var`, which
190
+ contains the exception raised. You can use it to detect the presence
191
+ of errors, indicating that all happy-path artifacts produced by the step
192
+ are missing.
197
193
 
198
194
 
199
195
  Parameters
200
196
  ----------
201
- packages : Dict[str, str], default {}
202
- Packages to use for this step. The key is the name of the package
203
- and the value is the version to use.
204
- libraries : Dict[str, str], default {}
205
- Supported for backward compatibility. When used with packages, packages will take precedence.
206
- python : str, optional, default None
207
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
208
- that the version used will correspond to the version of the Python interpreter used to start the run.
209
- disabled : bool, default False
210
- If set to True, disables @conda.
197
+ var : str, optional, default None
198
+ Name of the artifact in which to store the caught exception.
199
+ If not specified, the exception is not stored.
200
+ print_exception : bool, default True
201
+ Determines whether or not the exception is printed to
202
+ stdout when caught.
211
203
  """
212
204
  ...
213
205
 
@@ -251,35 +243,132 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
251
243
  ...
252
244
 
253
245
  @typing.overload
254
- 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]]]:
246
+ 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]]]:
255
247
  """
256
- Specifies environment variables to be set prior to the execution of a step.
248
+ Specifies the PyPI packages for the step.
249
+
250
+ Information in this decorator will augment any
251
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
252
+ you can use `@pypi_base` to set packages required by all
253
+ steps and use `@pypi` to specify step-specific overrides.
257
254
 
258
255
 
259
256
  Parameters
260
257
  ----------
261
- vars : Dict[str, str], default {}
262
- Dictionary of environment variables to set.
258
+ packages : Dict[str, str], default: {}
259
+ Packages to use for this step. The key is the name of the package
260
+ and the value is the version to use.
261
+ python : str, optional, default: None
262
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
263
+ that the version used will correspond to the version of the Python interpreter used to start the run.
263
264
  """
264
265
  ...
265
266
 
266
267
  @typing.overload
267
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
268
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
268
269
  ...
269
270
 
270
271
  @typing.overload
271
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
272
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
272
273
  ...
273
274
 
274
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
275
+ 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):
275
276
  """
276
- Specifies environment variables to be set prior to the execution of a step.
277
+ Specifies the PyPI packages for the step.
278
+
279
+ Information in this decorator will augment any
280
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
281
+ you can use `@pypi_base` to set packages required by all
282
+ steps and use `@pypi` to specify step-specific overrides.
277
283
 
278
284
 
279
285
  Parameters
280
286
  ----------
281
- vars : Dict[str, str], default {}
282
- Dictionary of environment variables to set.
287
+ packages : Dict[str, str], default: {}
288
+ Packages to use for this step. The key is the name of the package
289
+ and the value is the version to use.
290
+ python : str, optional, default: None
291
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
292
+ that the version used will correspond to the version of the Python interpreter used to start the run.
293
+ """
294
+ ...
295
+
296
+ @typing.overload
297
+ 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]]]:
298
+ """
299
+ Specifies the resources needed when executing this step.
300
+
301
+ Use `@resources` to specify the resource requirements
302
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
303
+
304
+ You can choose the compute layer on the command line by executing e.g.
305
+ ```
306
+ python myflow.py run --with batch
307
+ ```
308
+ or
309
+ ```
310
+ python myflow.py run --with kubernetes
311
+ ```
312
+ which executes the flow on the desired system using the
313
+ requirements specified in `@resources`.
314
+
315
+
316
+ Parameters
317
+ ----------
318
+ cpu : int, default 1
319
+ Number of CPUs required for this step.
320
+ gpu : int, optional, default None
321
+ Number of GPUs required for this step.
322
+ disk : int, optional, default None
323
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
324
+ memory : int, default 4096
325
+ Memory size (in MB) required for this step.
326
+ shared_memory : int, optional, default None
327
+ The value for the size (in MiB) of the /dev/shm volume for this step.
328
+ This parameter maps to the `--shm-size` option in Docker.
329
+ """
330
+ ...
331
+
332
+ @typing.overload
333
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
334
+ ...
335
+
336
+ @typing.overload
337
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
338
+ ...
339
+
340
+ 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):
341
+ """
342
+ Specifies the resources needed when executing this step.
343
+
344
+ Use `@resources` to specify the resource requirements
345
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
346
+
347
+ You can choose the compute layer on the command line by executing e.g.
348
+ ```
349
+ python myflow.py run --with batch
350
+ ```
351
+ or
352
+ ```
353
+ python myflow.py run --with kubernetes
354
+ ```
355
+ which executes the flow on the desired system using the
356
+ requirements specified in `@resources`.
357
+
358
+
359
+ Parameters
360
+ ----------
361
+ cpu : int, default 1
362
+ Number of CPUs required for this step.
363
+ gpu : int, optional, default None
364
+ Number of GPUs required for this step.
365
+ disk : int, optional, default None
366
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
367
+ memory : int, default 4096
368
+ Memory size (in MB) required for this step.
369
+ shared_memory : int, optional, default None
370
+ The value for the size (in MiB) of the /dev/shm volume for this step.
371
+ This parameter maps to the `--shm-size` option in Docker.
283
372
  """
284
373
  ...
285
374
 
@@ -343,102 +432,54 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
343
432
  ...
344
433
 
345
434
  @typing.overload
346
- 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]]]:
435
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
347
436
  """
348
- Creates a human-readable report, a Metaflow Card, after this step completes.
349
-
350
- Note that you may add multiple `@card` decorators in a step with different parameters.
351
-
352
-
353
- Parameters
354
- ----------
355
- type : str, default 'default'
356
- Card type.
357
- id : str, optional, default None
358
- If multiple cards are present, use this id to identify this card.
359
- options : Dict[str, Any], default {}
360
- Options passed to the card. The contents depend on the card type.
361
- timeout : int, default 45
362
- Interrupt reporting if it takes more than this many seconds.
437
+ Decorator prototype for all step decorators. This function gets specialized
438
+ and imported for all decorators types by _import_plugin_decorators().
363
439
  """
364
440
  ...
365
441
 
366
442
  @typing.overload
367
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
368
- ...
369
-
370
- @typing.overload
371
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
443
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
372
444
  ...
373
445
 
374
- 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):
446
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
375
447
  """
376
- Creates a human-readable report, a Metaflow Card, after this step completes.
377
-
378
- Note that you may add multiple `@card` decorators in a step with different parameters.
379
-
380
-
381
- Parameters
382
- ----------
383
- type : str, default 'default'
384
- Card type.
385
- id : str, optional, default None
386
- If multiple cards are present, use this id to identify this card.
387
- options : Dict[str, Any], default {}
388
- Options passed to the card. The contents depend on the card type.
389
- timeout : int, default 45
390
- Interrupt reporting if it takes more than this many seconds.
448
+ Decorator prototype for all step decorators. This function gets specialized
449
+ and imported for all decorators types by _import_plugin_decorators().
391
450
  """
392
451
  ...
393
452
 
394
453
  @typing.overload
395
- 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]]]:
454
+ 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]]]:
396
455
  """
397
- Specifies that the step will success under all circumstances.
398
-
399
- The decorator will create an optional artifact, specified by `var`, which
400
- contains the exception raised. You can use it to detect the presence
401
- of errors, indicating that all happy-path artifacts produced by the step
402
- are missing.
456
+ Specifies environment variables to be set prior to the execution of a step.
403
457
 
404
458
 
405
459
  Parameters
406
460
  ----------
407
- var : str, optional, default None
408
- Name of the artifact in which to store the caught exception.
409
- If not specified, the exception is not stored.
410
- print_exception : bool, default True
411
- Determines whether or not the exception is printed to
412
- stdout when caught.
461
+ vars : Dict[str, str], default {}
462
+ Dictionary of environment variables to set.
413
463
  """
414
464
  ...
415
465
 
416
466
  @typing.overload
417
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
467
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
418
468
  ...
419
469
 
420
470
  @typing.overload
421
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
471
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
422
472
  ...
423
473
 
424
- 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):
474
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
425
475
  """
426
- Specifies that the step will success under all circumstances.
427
-
428
- The decorator will create an optional artifact, specified by `var`, which
429
- contains the exception raised. You can use it to detect the presence
430
- of errors, indicating that all happy-path artifacts produced by the step
431
- are missing.
476
+ Specifies environment variables to be set prior to the execution of a step.
432
477
 
433
478
 
434
479
  Parameters
435
480
  ----------
436
- var : str, optional, default None
437
- Name of the artifact in which to store the caught exception.
438
- If not specified, the exception is not stored.
439
- print_exception : bool, default True
440
- Determines whether or not the exception is printed to
441
- stdout when caught.
481
+ vars : Dict[str, str], default {}
482
+ Dictionary of environment variables to set.
442
483
  """
443
484
  ...
444
485
 
@@ -498,81 +539,200 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
498
539
  ...
499
540
 
500
541
  @typing.overload
501
- 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]]]:
542
+ 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]]]:
502
543
  """
503
- Specifies the resources needed when executing this step.
504
-
505
- Use `@resources` to specify the resource requirements
506
- independently of the specific compute layer (`@batch`, `@kubernetes`).
507
-
508
- You can choose the compute layer on the command line by executing e.g.
509
- ```
510
- python myflow.py run --with batch
511
- ```
512
- or
513
- ```
514
- python myflow.py run --with kubernetes
515
- ```
516
- which executes the flow on the desired system using the
517
- requirements specified in `@resources`.
544
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
518
545
 
519
546
 
520
547
  Parameters
521
548
  ----------
522
549
  cpu : int, default 1
523
- Number of CPUs required for this step.
524
- gpu : int, optional, default None
525
- Number of GPUs required for this step.
526
- disk : int, optional, default None
527
- Disk size (in MB) required for this step. Only applies on Kubernetes.
550
+ Number of CPUs required for this step. If `@resources` is
551
+ also present, the maximum value from all decorators is used.
552
+ gpu : int, default 0
553
+ Number of GPUs required for this step. If `@resources` is
554
+ also present, the maximum value from all decorators is used.
528
555
  memory : int, default 4096
529
- Memory size (in MB) required for this step.
556
+ Memory size (in MB) required for this step. If
557
+ `@resources` is also present, the maximum value from all decorators is
558
+ used.
559
+ image : str, optional, default None
560
+ Docker image to use when launching on AWS Batch. If not specified, and
561
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
562
+ not, a default Docker image mapping to the current version of Python is used.
563
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
564
+ AWS Batch Job Queue to submit the job to.
565
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
566
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
567
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
568
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
569
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
530
570
  shared_memory : int, optional, default None
531
571
  The value for the size (in MiB) of the /dev/shm volume for this step.
532
572
  This parameter maps to the `--shm-size` option in Docker.
573
+ max_swap : int, optional, default None
574
+ The total amount of swap memory (in MiB) a container can use for this
575
+ step. This parameter is translated to the `--memory-swap` option in
576
+ Docker where the value is the sum of the container memory plus the
577
+ `max_swap` value.
578
+ swappiness : int, optional, default None
579
+ This allows you to tune memory swappiness behavior for this step.
580
+ A swappiness value of 0 causes swapping not to happen unless absolutely
581
+ necessary. A swappiness value of 100 causes pages to be swapped very
582
+ aggressively. Accepted values are whole numbers between 0 and 100.
583
+ use_tmpfs : bool, default False
584
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
585
+ not available on Fargate compute environments
586
+ tmpfs_tempdir : bool, default True
587
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
588
+ tmpfs_size : int, optional, default None
589
+ The value for the size (in MiB) of the tmpfs mount for this step.
590
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
591
+ memory allocated for this step.
592
+ tmpfs_path : str, optional, default None
593
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
594
+ inferentia : int, default 0
595
+ Number of Inferentia chips required for this step.
596
+ trainium : int, default None
597
+ Alias for inferentia. Use only one of the two.
598
+ efa : int, default 0
599
+ Number of elastic fabric adapter network devices to attach to container
600
+ ephemeral_storage : int, default None
601
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
602
+ This is only relevant for Fargate compute environments
603
+ log_driver: str, optional, default None
604
+ The log driver to use for the Amazon ECS container.
605
+ log_options: List[str], optional, default None
606
+ List of strings containing options for the chosen log driver. The configurable values
607
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
608
+ Example: [`awslogs-group:aws/batch/job`]
533
609
  """
534
610
  ...
535
611
 
536
612
  @typing.overload
537
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
613
+ def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
538
614
  ...
539
615
 
540
616
  @typing.overload
541
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
617
+ def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
542
618
  ...
543
619
 
544
- 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):
620
+ 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):
545
621
  """
546
- Specifies the resources needed when executing this step.
547
-
548
- Use `@resources` to specify the resource requirements
549
- independently of the specific compute layer (`@batch`, `@kubernetes`).
550
-
551
- You can choose the compute layer on the command line by executing e.g.
552
- ```
553
- python myflow.py run --with batch
554
- ```
555
- or
556
- ```
557
- python myflow.py run --with kubernetes
558
- ```
559
- which executes the flow on the desired system using the
560
- requirements specified in `@resources`.
622
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
561
623
 
562
624
 
563
625
  Parameters
564
626
  ----------
565
627
  cpu : int, default 1
566
- Number of CPUs required for this step.
567
- gpu : int, optional, default None
568
- Number of GPUs required for this step.
569
- disk : int, optional, default None
570
- Disk size (in MB) required for this step. Only applies on Kubernetes.
628
+ Number of CPUs required for this step. If `@resources` is
629
+ also present, the maximum value from all decorators is used.
630
+ gpu : int, default 0
631
+ Number of GPUs required for this step. If `@resources` is
632
+ also present, the maximum value from all decorators is used.
571
633
  memory : int, default 4096
572
- Memory size (in MB) required for this step.
634
+ Memory size (in MB) required for this step. If
635
+ `@resources` is also present, the maximum value from all decorators is
636
+ used.
637
+ image : str, optional, default None
638
+ Docker image to use when launching on AWS Batch. If not specified, and
639
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
640
+ not, a default Docker image mapping to the current version of Python is used.
641
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
642
+ AWS Batch Job Queue to submit the job to.
643
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
644
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
645
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
646
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
647
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
573
648
  shared_memory : int, optional, default None
574
649
  The value for the size (in MiB) of the /dev/shm volume for this step.
575
650
  This parameter maps to the `--shm-size` option in Docker.
651
+ max_swap : int, optional, default None
652
+ The total amount of swap memory (in MiB) a container can use for this
653
+ step. This parameter is translated to the `--memory-swap` option in
654
+ Docker where the value is the sum of the container memory plus the
655
+ `max_swap` value.
656
+ swappiness : int, optional, default None
657
+ This allows you to tune memory swappiness behavior for this step.
658
+ A swappiness value of 0 causes swapping not to happen unless absolutely
659
+ necessary. A swappiness value of 100 causes pages to be swapped very
660
+ aggressively. Accepted values are whole numbers between 0 and 100.
661
+ use_tmpfs : bool, default False
662
+ This enables an explicit tmpfs mount for this step. Note that tmpfs is
663
+ not available on Fargate compute environments
664
+ tmpfs_tempdir : bool, default True
665
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
666
+ tmpfs_size : int, optional, default None
667
+ The value for the size (in MiB) of the tmpfs mount for this step.
668
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
669
+ memory allocated for this step.
670
+ tmpfs_path : str, optional, default None
671
+ Path to tmpfs mount for this step. Defaults to /metaflow_temp.
672
+ inferentia : int, default 0
673
+ Number of Inferentia chips required for this step.
674
+ trainium : int, default None
675
+ Alias for inferentia. Use only one of the two.
676
+ efa : int, default 0
677
+ Number of elastic fabric adapter network devices to attach to container
678
+ ephemeral_storage : int, default None
679
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
680
+ This is only relevant for Fargate compute environments
681
+ log_driver: str, optional, default None
682
+ The log driver to use for the Amazon ECS container.
683
+ log_options: List[str], optional, default None
684
+ List of strings containing options for the chosen log driver. The configurable values
685
+ depend on the `log driver` chosen. Validation of these options is not supported yet.
686
+ Example: [`awslogs-group:aws/batch/job`]
687
+ """
688
+ ...
689
+
690
+ @typing.overload
691
+ 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]]]:
692
+ """
693
+ Creates a human-readable report, a Metaflow Card, after this step completes.
694
+
695
+ Note that you may add multiple `@card` decorators in a step with different parameters.
696
+
697
+
698
+ Parameters
699
+ ----------
700
+ type : str, default 'default'
701
+ Card type.
702
+ id : str, optional, default None
703
+ If multiple cards are present, use this id to identify this card.
704
+ options : Dict[str, Any], default {}
705
+ Options passed to the card. The contents depend on the card type.
706
+ timeout : int, default 45
707
+ Interrupt reporting if it takes more than this many seconds.
708
+ """
709
+ ...
710
+
711
+ @typing.overload
712
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
713
+ ...
714
+
715
+ @typing.overload
716
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
717
+ ...
718
+
719
+ 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):
720
+ """
721
+ Creates a human-readable report, a Metaflow Card, after this step completes.
722
+
723
+ Note that you may add multiple `@card` decorators in a step with different parameters.
724
+
725
+
726
+ Parameters
727
+ ----------
728
+ type : str, default 'default'
729
+ Card type.
730
+ id : str, optional, default None
731
+ If multiple cards are present, use this id to identify this card.
732
+ options : Dict[str, Any], default {}
733
+ Options passed to the card. The contents depend on the card type.
734
+ timeout : int, default 45
735
+ Interrupt reporting if it takes more than this many seconds.
576
736
  """
577
737
  ...
578
738
 
@@ -666,221 +826,145 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
666
826
  ...
667
827
 
668
828
  @typing.overload
669
- 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]]]:
829
+ 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]]]:
670
830
  """
671
- Specifies the PyPI packages for the step.
831
+ Specifies the Conda environment for the step.
672
832
 
673
833
  Information in this decorator will augment any
674
- attributes set in the `@pyi_base` flow-level decorator. Hence,
675
- you can use `@pypi_base` to set packages required by all
676
- steps and use `@pypi` to specify step-specific overrides.
834
+ attributes set in the `@conda_base` flow-level decorator. Hence,
835
+ you can use `@conda_base` to set packages required by all
836
+ steps and use `@conda` to specify step-specific overrides.
677
837
 
678
838
 
679
839
  Parameters
680
840
  ----------
681
- packages : Dict[str, str], default: {}
841
+ packages : Dict[str, str], default {}
682
842
  Packages to use for this step. The key is the name of the package
683
843
  and the value is the version to use.
684
- python : str, optional, default: None
844
+ libraries : Dict[str, str], default {}
845
+ Supported for backward compatibility. When used with packages, packages will take precedence.
846
+ python : str, optional, default None
685
847
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
686
848
  that the version used will correspond to the version of the Python interpreter used to start the run.
849
+ disabled : bool, default False
850
+ If set to True, disables @conda.
687
851
  """
688
852
  ...
689
853
 
690
854
  @typing.overload
691
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
855
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
692
856
  ...
693
857
 
694
858
  @typing.overload
695
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
859
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
696
860
  ...
697
861
 
698
- 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):
862
+ 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):
699
863
  """
700
- Specifies the PyPI packages for the step.
864
+ Specifies the Conda environment for the step.
701
865
 
702
866
  Information in this decorator will augment any
703
- attributes set in the `@pyi_base` flow-level decorator. Hence,
704
- you can use `@pypi_base` to set packages required by all
705
- steps and use `@pypi` to specify step-specific overrides.
867
+ attributes set in the `@conda_base` flow-level decorator. Hence,
868
+ you can use `@conda_base` to set packages required by all
869
+ steps and use `@conda` to specify step-specific overrides.
706
870
 
707
871
 
708
872
  Parameters
709
873
  ----------
710
- packages : Dict[str, str], default: {}
874
+ packages : Dict[str, str], default {}
711
875
  Packages to use for this step. The key is the name of the package
712
876
  and the value is the version to use.
713
- python : str, optional, default: None
877
+ libraries : Dict[str, str], default {}
878
+ Supported for backward compatibility. When used with packages, packages will take precedence.
879
+ python : str, optional, default None
714
880
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
715
881
  that the version used will correspond to the version of the Python interpreter used to start the run.
882
+ disabled : bool, default False
883
+ If set to True, disables @conda.
716
884
  """
717
885
  ...
718
886
 
719
- @typing.overload
720
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
721
- """
722
- Decorator prototype for all step decorators. This function gets specialized
723
- and imported for all decorators types by _import_plugin_decorators().
724
- """
725
- ...
726
-
727
- @typing.overload
728
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
729
- ...
730
-
731
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
732
- """
733
- Decorator prototype for all step decorators. This function gets specialized
734
- and imported for all decorators types by _import_plugin_decorators().
735
- """
736
- ...
737
-
738
- @typing.overload
739
- 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]]]:
740
- """
741
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
742
-
743
-
744
- Parameters
745
- ----------
746
- cpu : int, default 1
747
- Number of CPUs required for this step. If `@resources` is
748
- also present, the maximum value from all decorators is used.
749
- gpu : int, default 0
750
- Number of GPUs required for this step. If `@resources` is
751
- also present, the maximum value from all decorators is used.
752
- memory : int, default 4096
753
- Memory size (in MB) required for this step. If
754
- `@resources` is also present, the maximum value from all decorators is
755
- used.
756
- image : str, optional, default None
757
- Docker image to use when launching on AWS Batch. If not specified, and
758
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
759
- not, a default Docker image mapping to the current version of Python is used.
760
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
761
- AWS Batch Job Queue to submit the job to.
762
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
763
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
764
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
765
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
766
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
767
- shared_memory : int, optional, default None
768
- The value for the size (in MiB) of the /dev/shm volume for this step.
769
- This parameter maps to the `--shm-size` option in Docker.
770
- max_swap : int, optional, default None
771
- The total amount of swap memory (in MiB) a container can use for this
772
- step. This parameter is translated to the `--memory-swap` option in
773
- Docker where the value is the sum of the container memory plus the
774
- `max_swap` value.
775
- swappiness : int, optional, default None
776
- This allows you to tune memory swappiness behavior for this step.
777
- A swappiness value of 0 causes swapping not to happen unless absolutely
778
- necessary. A swappiness value of 100 causes pages to be swapped very
779
- aggressively. Accepted values are whole numbers between 0 and 100.
780
- use_tmpfs : bool, default False
781
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
782
- not available on Fargate compute environments
783
- tmpfs_tempdir : bool, default True
784
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
785
- tmpfs_size : int, optional, default None
786
- The value for the size (in MiB) of the tmpfs mount for this step.
787
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
788
- memory allocated for this step.
789
- tmpfs_path : str, optional, default None
790
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
791
- inferentia : int, default 0
792
- Number of Inferentia chips required for this step.
793
- trainium : int, default None
794
- Alias for inferentia. Use only one of the two.
795
- efa : int, default 0
796
- Number of elastic fabric adapter network devices to attach to container
797
- ephemeral_storage : int, default None
798
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
799
- This is only relevant for Fargate compute environments
800
- log_driver: str, optional, default None
801
- The log driver to use for the Amazon ECS container.
802
- log_options: List[str], optional, default None
803
- List of strings containing options for the chosen log driver. The configurable values
804
- depend on the `log driver` chosen. Validation of these options is not supported yet.
805
- Example: [`awslogs-group:aws/batch/job`]
806
- """
807
- ...
808
-
809
- @typing.overload
810
- def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
811
- ...
812
-
813
- @typing.overload
814
- def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
815
- ...
816
-
817
- 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):
887
+ 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]]:
818
888
  """
819
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
889
+ 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.
890
+ 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.
820
891
 
821
892
 
822
893
  Parameters
823
894
  ----------
824
- cpu : int, default 1
825
- Number of CPUs required for this step. If `@resources` is
826
- also present, the maximum value from all decorators is used.
827
- gpu : int, default 0
828
- Number of GPUs required for this step. If `@resources` is
829
- also present, the maximum value from all decorators is used.
830
- memory : int, default 4096
831
- Memory size (in MB) required for this step. If
832
- `@resources` is also present, the maximum value from all decorators is
833
- used.
834
- image : str, optional, default None
835
- Docker image to use when launching on AWS Batch. If not specified, and
836
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
837
- not, a default Docker image mapping to the current version of Python is used.
838
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
839
- AWS Batch Job Queue to submit the job to.
840
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
841
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
842
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
843
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
844
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
845
- shared_memory : int, optional, default None
846
- The value for the size (in MiB) of the /dev/shm volume for this step.
847
- This parameter maps to the `--shm-size` option in Docker.
848
- max_swap : int, optional, default None
849
- The total amount of swap memory (in MiB) a container can use for this
850
- step. This parameter is translated to the `--memory-swap` option in
851
- Docker where the value is the sum of the container memory plus the
852
- `max_swap` value.
853
- swappiness : int, optional, default None
854
- This allows you to tune memory swappiness behavior for this step.
855
- A swappiness value of 0 causes swapping not to happen unless absolutely
856
- necessary. A swappiness value of 100 causes pages to be swapped very
857
- aggressively. Accepted values are whole numbers between 0 and 100.
858
- use_tmpfs : bool, default False
859
- This enables an explicit tmpfs mount for this step. Note that tmpfs is
860
- not available on Fargate compute environments
861
- tmpfs_tempdir : bool, default True
862
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
863
- tmpfs_size : int, optional, default None
864
- The value for the size (in MiB) of the tmpfs mount for this step.
865
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
866
- memory allocated for this step.
867
- tmpfs_path : str, optional, default None
868
- Path to tmpfs mount for this step. Defaults to /metaflow_temp.
869
- inferentia : int, default 0
870
- Number of Inferentia chips required for this step.
871
- trainium : int, default None
872
- Alias for inferentia. Use only one of the two.
873
- efa : int, default 0
874
- Number of elastic fabric adapter network devices to attach to container
875
- ephemeral_storage : int, default None
876
- The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
877
- This is only relevant for Fargate compute environments
878
- log_driver: str, optional, default None
879
- The log driver to use for the Amazon ECS container.
880
- log_options: List[str], optional, default None
881
- List of strings containing options for the chosen log driver. The configurable values
882
- depend on the `log driver` chosen. Validation of these options is not supported yet.
883
- Example: [`awslogs-group:aws/batch/job`]
895
+ timeout : int
896
+ Time, in seconds before the task times out and fails. (Default: 3600)
897
+ poke_interval : int
898
+ Time in seconds that the job should wait in between each try. (Default: 60)
899
+ mode : str
900
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
901
+ exponential_backoff : bool
902
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
903
+ pool : str
904
+ the slot pool this task should run in,
905
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
906
+ soft_fail : bool
907
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
908
+ name : str
909
+ Name of the sensor on Airflow
910
+ description : str
911
+ Description of sensor in the Airflow UI
912
+ external_dag_id : str
913
+ The dag_id that contains the task you want to wait for.
914
+ external_task_ids : List[str]
915
+ The list of task_ids that you want to wait for.
916
+ If None (default value) the sensor waits for the DAG. (Default: None)
917
+ allowed_states : List[str]
918
+ Iterable of allowed states, (Default: ['success'])
919
+ failed_states : List[str]
920
+ Iterable of failed or dis-allowed states. (Default: None)
921
+ execution_delta : datetime.timedelta
922
+ time difference with the previous execution to look at,
923
+ the default is the same logical date as the current task or DAG. (Default: None)
924
+ check_existence: bool
925
+ Set to True to check if the external task exists or check if
926
+ the DAG to wait for exists. (Default: True)
927
+ """
928
+ ...
929
+
930
+ @typing.overload
931
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
932
+ """
933
+ Specifies the PyPI packages for all steps of the flow.
934
+
935
+ Use `@pypi_base` to set common packages required by all
936
+ steps and use `@pypi` to specify step-specific overrides.
937
+
938
+ Parameters
939
+ ----------
940
+ packages : Dict[str, str], default: {}
941
+ Packages to use for this flow. The key is the name of the package
942
+ and the value is the version to use.
943
+ python : str, optional, default: None
944
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
945
+ that the version used will correspond to the version of the Python interpreter used to start the run.
946
+ """
947
+ ...
948
+
949
+ @typing.overload
950
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
951
+ ...
952
+
953
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
954
+ """
955
+ Specifies the PyPI packages for all steps of the flow.
956
+
957
+ Use `@pypi_base` to set common packages required by all
958
+ steps and use `@pypi` to specify step-specific overrides.
959
+
960
+ Parameters
961
+ ----------
962
+ packages : Dict[str, str], default: {}
963
+ Packages to use for this flow. The key is the name of the package
964
+ and the value is the version to use.
965
+ python : str, optional, default: None
966
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
967
+ that the version used will correspond to the version of the Python interpreter used to start the run.
884
968
  """
885
969
  ...
886
970
 
@@ -986,43 +1070,53 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
986
1070
  ...
987
1071
 
988
1072
  @typing.overload
989
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1073
+ 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]]:
990
1074
  """
991
- Specifies the PyPI packages for all steps of the flow.
1075
+ Specifies the Conda environment for all steps of the flow.
1076
+
1077
+ Use `@conda_base` to set common libraries required by all
1078
+ steps and use `@conda` to specify step-specific additions.
992
1079
 
993
- Use `@pypi_base` to set common packages required by all
994
- steps and use `@pypi` to specify step-specific overrides.
995
1080
 
996
1081
  Parameters
997
1082
  ----------
998
- packages : Dict[str, str], default: {}
1083
+ packages : Dict[str, str], default {}
999
1084
  Packages to use for this flow. The key is the name of the package
1000
1085
  and the value is the version to use.
1001
- python : str, optional, default: None
1086
+ libraries : Dict[str, str], default {}
1087
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1088
+ python : str, optional, default None
1002
1089
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1003
1090
  that the version used will correspond to the version of the Python interpreter used to start the run.
1091
+ disabled : bool, default False
1092
+ If set to True, disables Conda.
1004
1093
  """
1005
1094
  ...
1006
1095
 
1007
1096
  @typing.overload
1008
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1097
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1009
1098
  ...
1010
1099
 
1011
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1100
+ 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
1101
  """
1013
- Specifies the PyPI packages for all steps of the flow.
1102
+ Specifies the Conda environment for all steps of the flow.
1103
+
1104
+ Use `@conda_base` to set common libraries required by all
1105
+ steps and use `@conda` to specify step-specific additions.
1014
1106
 
1015
- Use `@pypi_base` to set common packages required by all
1016
- steps and use `@pypi` to specify step-specific overrides.
1017
1107
 
1018
1108
  Parameters
1019
1109
  ----------
1020
- packages : Dict[str, str], default: {}
1110
+ packages : Dict[str, str], default {}
1021
1111
  Packages to use for this flow. The key is the name of the package
1022
1112
  and the value is the version to use.
1023
- python : str, optional, default: None
1113
+ libraries : Dict[str, str], default {}
1114
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1115
+ python : str, optional, default None
1024
1116
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1025
1117
  that the version used will correspond to the version of the Python interpreter used to start the run.
1118
+ disabled : bool, default False
1119
+ If set to True, disables Conda.
1026
1120
  """
1027
1121
  ...
1028
1122
 
@@ -1112,54 +1206,46 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
1112
1206
  """
1113
1207
  ...
1114
1208
 
1115
- @typing.overload
1116
- 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]]:
1117
- """
1118
- Specifies the Conda environment for all steps of the flow.
1119
-
1120
- Use `@conda_base` to set common libraries required by all
1121
- steps and use `@conda` to specify step-specific additions.
1122
-
1123
-
1124
- Parameters
1125
- ----------
1126
- packages : Dict[str, str], default {}
1127
- Packages to use for this flow. The key is the name of the package
1128
- and the value is the version to use.
1129
- libraries : Dict[str, str], default {}
1130
- Supported for backward compatibility. When used with packages, packages will take precedence.
1131
- python : str, optional, default None
1132
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1133
- that the version used will correspond to the version of the Python interpreter used to start the run.
1134
- disabled : bool, default False
1135
- If set to True, disables Conda.
1136
- """
1137
- ...
1138
-
1139
- @typing.overload
1140
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1141
- ...
1142
-
1143
- 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):
1209
+ 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]]:
1144
1210
  """
1145
- Specifies the Conda environment for all steps of the flow.
1146
-
1147
- Use `@conda_base` to set common libraries required by all
1148
- steps and use `@conda` to specify step-specific additions.
1211
+ 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)
1212
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1213
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1214
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1215
+ starts only after all sensors finish.
1149
1216
 
1150
1217
 
1151
1218
  Parameters
1152
1219
  ----------
1153
- packages : Dict[str, str], default {}
1154
- Packages to use for this flow. The key is the name of the package
1155
- and the value is the version to use.
1156
- libraries : Dict[str, str], default {}
1157
- Supported for backward compatibility. When used with packages, packages will take precedence.
1158
- python : str, optional, default None
1159
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1160
- that the version used will correspond to the version of the Python interpreter used to start the run.
1161
- disabled : bool, default False
1162
- If set to True, disables Conda.
1220
+ timeout : int
1221
+ Time, in seconds before the task times out and fails. (Default: 3600)
1222
+ poke_interval : int
1223
+ Time in seconds that the job should wait in between each try. (Default: 60)
1224
+ mode : str
1225
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1226
+ exponential_backoff : bool
1227
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1228
+ pool : str
1229
+ the slot pool this task should run in,
1230
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1231
+ soft_fail : bool
1232
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1233
+ name : str
1234
+ Name of the sensor on Airflow
1235
+ description : str
1236
+ Description of sensor in the Airflow UI
1237
+ bucket_key : Union[str, List[str]]
1238
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1239
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1240
+ bucket_name : str
1241
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1242
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1243
+ wildcard_match : bool
1244
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1245
+ aws_conn_id : str
1246
+ a reference to the s3 connection on Airflow. (Default: None)
1247
+ verify : bool
1248
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1163
1249
  """
1164
1250
  ...
1165
1251
 
@@ -1256,89 +1342,3 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1256
1342
  """
1257
1343
  ...
1258
1344
 
1259
- 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]]:
1260
- """
1261
- 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.
1262
- 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.
1263
-
1264
-
1265
- Parameters
1266
- ----------
1267
- timeout : int
1268
- Time, in seconds before the task times out and fails. (Default: 3600)
1269
- poke_interval : int
1270
- Time in seconds that the job should wait in between each try. (Default: 60)
1271
- mode : str
1272
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1273
- exponential_backoff : bool
1274
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1275
- pool : str
1276
- the slot pool this task should run in,
1277
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1278
- soft_fail : bool
1279
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1280
- name : str
1281
- Name of the sensor on Airflow
1282
- description : str
1283
- Description of sensor in the Airflow UI
1284
- external_dag_id : str
1285
- The dag_id that contains the task you want to wait for.
1286
- external_task_ids : List[str]
1287
- The list of task_ids that you want to wait for.
1288
- If None (default value) the sensor waits for the DAG. (Default: None)
1289
- allowed_states : List[str]
1290
- Iterable of allowed states, (Default: ['success'])
1291
- failed_states : List[str]
1292
- Iterable of failed or dis-allowed states. (Default: None)
1293
- execution_delta : datetime.timedelta
1294
- time difference with the previous execution to look at,
1295
- the default is the same logical date as the current task or DAG. (Default: None)
1296
- check_existence: bool
1297
- Set to True to check if the external task exists or check if
1298
- the DAG to wait for exists. (Default: True)
1299
- """
1300
- ...
1301
-
1302
- 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]]:
1303
- """
1304
- 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)
1305
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1306
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1307
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1308
- starts only after all sensors finish.
1309
-
1310
-
1311
- Parameters
1312
- ----------
1313
- timeout : int
1314
- Time, in seconds before the task times out and fails. (Default: 3600)
1315
- poke_interval : int
1316
- Time in seconds that the job should wait in between each try. (Default: 60)
1317
- mode : str
1318
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1319
- exponential_backoff : bool
1320
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1321
- pool : str
1322
- the slot pool this task should run in,
1323
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1324
- soft_fail : bool
1325
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1326
- name : str
1327
- Name of the sensor on Airflow
1328
- description : str
1329
- Description of sensor in the Airflow UI
1330
- bucket_key : Union[str, List[str]]
1331
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1332
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1333
- bucket_name : str
1334
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1335
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1336
- wildcard_match : bool
1337
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1338
- aws_conn_id : str
1339
- a reference to the s3 connection on Airflow. (Default: None)
1340
- verify : bool
1341
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1342
- """
1343
- ...
1344
-