metaflow-stubs 2.15.7__py2.py3-none-any.whl → 2.15.8__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 (149) hide show
  1. metaflow-stubs/__init__.pyi +365 -364
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +4 -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 +4 -4
  8. metaflow-stubs/client/filecache.pyi +2 -2
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +3 -3
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +3 -3
  14. metaflow-stubs/info_file.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +4 -2
  20. metaflow-stubs/metaflow_current.pyi +35 -35
  21. metaflow-stubs/metaflow_git.pyi +26 -0
  22. metaflow-stubs/multicore_utils.pyi +2 -2
  23. metaflow-stubs/parameters.pyi +3 -3
  24. metaflow-stubs/plugins/__init__.pyi +12 -11
  25. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  29. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  30. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  31. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  32. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  33. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  34. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  35. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  36. metaflow-stubs/plugins/argo/argo_workflows.pyi +10 -4
  37. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  38. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
  39. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  40. metaflow-stubs/plugins/aws/__init__.pyi +3 -3
  41. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  42. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  45. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  46. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  47. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  49. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  56. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
  57. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  58. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  61. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  62. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  63. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  64. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  65. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  67. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  74. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  78. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  79. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  80. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  81. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  82. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  83. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  84. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -3
  85. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  86. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  87. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  88. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  89. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  90. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  91. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  92. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  93. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  94. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  95. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  96. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  97. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  98. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  99. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  100. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  101. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  102. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  103. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  105. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  106. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  107. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  109. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  110. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  111. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  112. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  113. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  114. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  115. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  116. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  119. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  120. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  121. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  122. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  123. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  124. metaflow-stubs/plugins/uv/__init__.pyi +11 -0
  125. metaflow-stubs/plugins/uv/uv_environment.pyi +36 -0
  126. metaflow-stubs/pylint_wrapper.pyi +2 -2
  127. metaflow-stubs/runner/__init__.pyi +2 -2
  128. metaflow-stubs/runner/deployer.pyi +6 -6
  129. metaflow-stubs/runner/deployer_impl.pyi +3 -3
  130. metaflow-stubs/runner/metaflow_runner.pyi +3 -3
  131. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  132. metaflow-stubs/runner/nbrun.pyi +2 -2
  133. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  134. metaflow-stubs/runner/utils.pyi +4 -4
  135. metaflow-stubs/system/__init__.pyi +2 -2
  136. metaflow-stubs/system/system_logger.pyi +2 -2
  137. metaflow-stubs/system/system_monitor.pyi +2 -2
  138. metaflow-stubs/tagging_util.pyi +2 -2
  139. metaflow-stubs/tuple_util.pyi +2 -2
  140. metaflow-stubs/user_configs/__init__.pyi +2 -2
  141. metaflow-stubs/user_configs/config_decorators.pyi +5 -5
  142. metaflow-stubs/user_configs/config_options.pyi +2 -2
  143. metaflow-stubs/user_configs/config_parameters.pyi +5 -5
  144. metaflow-stubs/version.pyi +2 -2
  145. {metaflow_stubs-2.15.7.dist-info → metaflow_stubs-2.15.8.dist-info}/METADATA +2 -2
  146. metaflow_stubs-2.15.8.dist-info/RECORD +149 -0
  147. metaflow_stubs-2.15.7.dist-info/RECORD +0 -146
  148. {metaflow_stubs-2.15.7.dist-info → metaflow_stubs-2.15.8.dist-info}/WHEEL +0 -0
  149. {metaflow_stubs-2.15.7.dist-info → metaflow_stubs-2.15.8.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.15.7 #
4
- # Generated on 2025-03-29T00:30:30.645150 #
3
+ # MF version: 2.15.8 #
4
+ # Generated on 2025-04-17T19:00:19.966511 #
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
 
@@ -36,15 +36,16 @@ from .user_configs.config_parameters import config_expr as config_expr
36
36
  from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
37
37
  from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
38
38
  from . import tuple_util as tuple_util
39
+ from . import metaflow_git as metaflow_git
39
40
  from . import events as events
40
41
  from . import runner as runner
41
42
  from . import plugins as plugins
42
43
  from .plugins.datatools.s3.s3 import S3 as S3
43
44
  from . import includefile as includefile
44
45
  from .includefile import IncludeFile as IncludeFile
46
+ from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
45
47
  from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
46
48
  from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
47
- from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
48
49
  from . import cards as cards
49
50
  from . import client as client
50
51
  from .client.core import namespace as namespace
@@ -146,135 +147,53 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
146
147
  ...
147
148
 
148
149
  @typing.overload
149
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
150
- """
151
- Decorator prototype for all step decorators. This function gets specialized
152
- and imported for all decorators types by _import_plugin_decorators().
153
- """
154
- ...
155
-
156
- @typing.overload
157
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
158
- ...
159
-
160
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
161
- """
162
- Decorator prototype for all step decorators. This function gets specialized
163
- and imported for all decorators types by _import_plugin_decorators().
164
- """
165
- ...
166
-
167
- @typing.overload
168
- 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]]]:
169
- """
170
- Specifies a timeout for your step.
171
-
172
- This decorator is useful if this step may hang indefinitely.
173
-
174
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
175
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
176
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
177
-
178
- Note that all the values specified in parameters are added together so if you specify
179
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
180
-
181
-
182
- Parameters
183
- ----------
184
- seconds : int, default 0
185
- Number of seconds to wait prior to timing out.
186
- minutes : int, default 0
187
- Number of minutes to wait prior to timing out.
188
- hours : int, default 0
189
- Number of hours to wait prior to timing out.
190
- """
191
- ...
192
-
193
- @typing.overload
194
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
195
- ...
196
-
197
- @typing.overload
198
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
199
- ...
200
-
201
- 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):
202
- """
203
- Specifies a timeout for your step.
204
-
205
- This decorator is useful if this step may hang indefinitely.
206
-
207
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
208
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
209
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
210
-
211
- Note that all the values specified in parameters are added together so if you specify
212
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
213
-
214
-
215
- Parameters
216
- ----------
217
- seconds : int, default 0
218
- Number of seconds to wait prior to timing out.
219
- minutes : int, default 0
220
- Number of minutes to wait prior to timing out.
221
- hours : int, default 0
222
- Number of hours to wait prior to timing out.
223
- """
224
- ...
225
-
226
- @typing.overload
227
- def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
150
+ 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]]]:
228
151
  """
229
- Specifies the number of times the task corresponding
230
- to a step needs to be retried.
231
-
232
- This decorator is useful for handling transient errors, such as networking issues.
233
- If your task contains operations that can't be retried safely, e.g. database updates,
234
- it is advisable to annotate it with `@retry(times=0)`.
152
+ Specifies that the step will success under all circumstances.
235
153
 
236
- This can be used in conjunction with the `@catch` decorator. The `@catch`
237
- decorator will execute a no-op task after all retries have been exhausted,
238
- ensuring that the flow execution can continue.
154
+ The decorator will create an optional artifact, specified by `var`, which
155
+ contains the exception raised. You can use it to detect the presence
156
+ of errors, indicating that all happy-path artifacts produced by the step
157
+ are missing.
239
158
 
240
159
 
241
160
  Parameters
242
161
  ----------
243
- times : int, default 3
244
- Number of times to retry this task.
245
- minutes_between_retries : int, default 2
246
- Number of minutes between retries.
162
+ var : str, optional, default None
163
+ Name of the artifact in which to store the caught exception.
164
+ If not specified, the exception is not stored.
165
+ print_exception : bool, default True
166
+ Determines whether or not the exception is printed to
167
+ stdout when caught.
247
168
  """
248
169
  ...
249
170
 
250
171
  @typing.overload
251
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
172
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
252
173
  ...
253
174
 
254
175
  @typing.overload
255
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
176
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
256
177
  ...
257
178
 
258
- 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):
179
+ 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):
259
180
  """
260
- Specifies the number of times the task corresponding
261
- to a step needs to be retried.
262
-
263
- This decorator is useful for handling transient errors, such as networking issues.
264
- If your task contains operations that can't be retried safely, e.g. database updates,
265
- it is advisable to annotate it with `@retry(times=0)`.
181
+ Specifies that the step will success under all circumstances.
266
182
 
267
- This can be used in conjunction with the `@catch` decorator. The `@catch`
268
- decorator will execute a no-op task after all retries have been exhausted,
269
- ensuring that the flow execution can continue.
183
+ The decorator will create an optional artifact, specified by `var`, which
184
+ contains the exception raised. You can use it to detect the presence
185
+ of errors, indicating that all happy-path artifacts produced by the step
186
+ are missing.
270
187
 
271
188
 
272
189
  Parameters
273
190
  ----------
274
- times : int, default 3
275
- Number of times to retry this task.
276
- minutes_between_retries : int, default 2
277
- Number of minutes between retries.
191
+ var : str, optional, default None
192
+ Name of the artifact in which to store the caught exception.
193
+ If not specified, the exception is not stored.
194
+ print_exception : bool, default True
195
+ Determines whether or not the exception is printed to
196
+ stdout when caught.
278
197
  """
279
198
  ...
280
199
 
@@ -427,6 +346,61 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
427
346
  """
428
347
  ...
429
348
 
349
+ @typing.overload
350
+ 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]]]:
351
+ """
352
+ Specifies the number of times the task corresponding
353
+ to a step needs to be retried.
354
+
355
+ This decorator is useful for handling transient errors, such as networking issues.
356
+ If your task contains operations that can't be retried safely, e.g. database updates,
357
+ it is advisable to annotate it with `@retry(times=0)`.
358
+
359
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
360
+ decorator will execute a no-op task after all retries have been exhausted,
361
+ ensuring that the flow execution can continue.
362
+
363
+
364
+ Parameters
365
+ ----------
366
+ times : int, default 3
367
+ Number of times to retry this task.
368
+ minutes_between_retries : int, default 2
369
+ Number of minutes between retries.
370
+ """
371
+ ...
372
+
373
+ @typing.overload
374
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
375
+ ...
376
+
377
+ @typing.overload
378
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
379
+ ...
380
+
381
+ 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):
382
+ """
383
+ Specifies the number of times the task corresponding
384
+ to a step needs to be retried.
385
+
386
+ This decorator is useful for handling transient errors, such as networking issues.
387
+ If your task contains operations that can't be retried safely, e.g. database updates,
388
+ it is advisable to annotate it with `@retry(times=0)`.
389
+
390
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
391
+ decorator will execute a no-op task after all retries have been exhausted,
392
+ ensuring that the flow execution can continue.
393
+
394
+
395
+ Parameters
396
+ ----------
397
+ times : int, default 3
398
+ Number of times to retry this task.
399
+ minutes_between_retries : int, default 2
400
+ Number of minutes between retries.
401
+ """
402
+ ...
403
+
430
404
  @typing.overload
431
405
  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]]]:
432
406
  """
@@ -486,87 +460,174 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
486
460
  """
487
461
  ...
488
462
 
463
+ 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]]]:
464
+ """
465
+ Specifies that this step should execute on Kubernetes.
466
+
467
+
468
+ Parameters
469
+ ----------
470
+ cpu : int, default 1
471
+ Number of CPUs required for this step. If `@resources` is
472
+ also present, the maximum value from all decorators is used.
473
+ memory : int, default 4096
474
+ Memory size (in MB) required for this step. If
475
+ `@resources` is also present, the maximum value from all decorators is
476
+ used.
477
+ disk : int, default 10240
478
+ Disk size (in MB) required for this step. If
479
+ `@resources` is also present, the maximum value from all decorators is
480
+ used.
481
+ image : str, optional, default None
482
+ Docker image to use when launching on Kubernetes. If not specified, and
483
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
484
+ not, a default Docker image mapping to the current version of Python is used.
485
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
486
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
487
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
488
+ Kubernetes service account to use when launching pod in Kubernetes.
489
+ secrets : List[str], optional, default None
490
+ Kubernetes secrets to use when launching pod in Kubernetes. These
491
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
492
+ in Metaflow configuration.
493
+ node_selector: Union[Dict[str,str], str], optional, default None
494
+ Kubernetes node selector(s) to apply to the pod running the task.
495
+ Can be passed in as a comma separated string of values e.g.
496
+ 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
497
+ {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
498
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
499
+ Kubernetes namespace to use when launching pod in Kubernetes.
500
+ gpu : int, optional, default None
501
+ Number of GPUs required for this step. A value of zero implies that
502
+ the scheduled node should not have GPUs.
503
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
504
+ The vendor of the GPUs to be used for this step.
505
+ tolerations : List[str], default []
506
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
507
+ Kubernetes tolerations to use when launching pod in Kubernetes.
508
+ labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
509
+ Kubernetes labels to use when launching pod in Kubernetes.
510
+ annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
511
+ Kubernetes annotations to use when launching pod in Kubernetes.
512
+ use_tmpfs : bool, default False
513
+ This enables an explicit tmpfs mount for this step.
514
+ tmpfs_tempdir : bool, default True
515
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
516
+ tmpfs_size : int, optional, default: None
517
+ The value for the size (in MiB) of the tmpfs mount for this step.
518
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
519
+ memory allocated for this step.
520
+ tmpfs_path : str, optional, default /metaflow_temp
521
+ Path to tmpfs mount for this step.
522
+ persistent_volume_claims : Dict[str, str], optional, default None
523
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
524
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
525
+ shared_memory: int, optional
526
+ Shared memory size (in MiB) required for this step
527
+ port: int, optional
528
+ Port number to specify in the Kubernetes job object
529
+ compute_pool : str, optional, default None
530
+ Compute pool to be used for for this step.
531
+ If not specified, any accessible compute pool within the perimeter is used.
532
+ hostname_resolution_timeout: int, default 10 * 60
533
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
534
+ Only applicable when @parallel is used.
535
+ qos: str, default: Burstable
536
+ Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
537
+ """
538
+ ...
539
+
489
540
  @typing.overload
490
- 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]]]:
541
+ 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]]]:
491
542
  """
492
- Specifies that the step will success under all circumstances.
543
+ Specifies a timeout for your step.
493
544
 
494
- The decorator will create an optional artifact, specified by `var`, which
495
- contains the exception raised. You can use it to detect the presence
496
- of errors, indicating that all happy-path artifacts produced by the step
497
- are missing.
545
+ This decorator is useful if this step may hang indefinitely.
546
+
547
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
548
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
549
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
550
+
551
+ Note that all the values specified in parameters are added together so if you specify
552
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
498
553
 
499
554
 
500
555
  Parameters
501
556
  ----------
502
- var : str, optional, default None
503
- Name of the artifact in which to store the caught exception.
504
- If not specified, the exception is not stored.
505
- print_exception : bool, default True
506
- Determines whether or not the exception is printed to
507
- stdout when caught.
557
+ seconds : int, default 0
558
+ Number of seconds to wait prior to timing out.
559
+ minutes : int, default 0
560
+ Number of minutes to wait prior to timing out.
561
+ hours : int, default 0
562
+ Number of hours to wait prior to timing out.
508
563
  """
509
564
  ...
510
565
 
511
566
  @typing.overload
512
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
567
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
513
568
  ...
514
569
 
515
570
  @typing.overload
516
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
571
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
517
572
  ...
518
573
 
519
- 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):
574
+ 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):
520
575
  """
521
- Specifies that the step will success under all circumstances.
576
+ Specifies a timeout for your step.
522
577
 
523
- The decorator will create an optional artifact, specified by `var`, which
524
- contains the exception raised. You can use it to detect the presence
525
- of errors, indicating that all happy-path artifacts produced by the step
526
- are missing.
578
+ This decorator is useful if this step may hang indefinitely.
579
+
580
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
581
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
582
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
583
+
584
+ Note that all the values specified in parameters are added together so if you specify
585
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
527
586
 
528
587
 
529
588
  Parameters
530
589
  ----------
531
- var : str, optional, default None
532
- Name of the artifact in which to store the caught exception.
533
- If not specified, the exception is not stored.
534
- print_exception : bool, default True
535
- Determines whether or not the exception is printed to
536
- stdout when caught.
590
+ seconds : int, default 0
591
+ Number of seconds to wait prior to timing out.
592
+ minutes : int, default 0
593
+ Number of minutes to wait prior to timing out.
594
+ hours : int, default 0
595
+ Number of hours to wait prior to timing out.
537
596
  """
538
597
  ...
539
598
 
540
599
  @typing.overload
541
- 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]]]:
600
+ 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]]]:
542
601
  """
543
- Specifies environment variables to be set prior to the execution of a step.
602
+ Specifies secrets to be retrieved and injected as environment variables prior to
603
+ the execution of a step.
544
604
 
545
605
 
546
606
  Parameters
547
607
  ----------
548
- vars : Dict[str, str], default {}
549
- Dictionary of environment variables to set.
608
+ sources : List[Union[str, Dict[str, Any]]], default: []
609
+ List of secret specs, defining how the secrets are to be retrieved
550
610
  """
551
611
  ...
552
612
 
553
613
  @typing.overload
554
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
614
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
555
615
  ...
556
616
 
557
617
  @typing.overload
558
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
618
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
559
619
  ...
560
620
 
561
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
621
+ 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]]] = []):
562
622
  """
563
- Specifies environment variables to be set prior to the execution of a step.
623
+ Specifies secrets to be retrieved and injected as environment variables prior to
624
+ the execution of a step.
564
625
 
565
626
 
566
627
  Parameters
567
628
  ----------
568
- vars : Dict[str, str], default {}
569
- Dictionary of environment variables to set.
629
+ sources : List[Union[str, Dict[str, Any]]], default: []
630
+ List of secret specs, defining how the secrets are to be retrieved
570
631
  """
571
632
  ...
572
633
 
@@ -619,6 +680,25 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
619
680
  """
620
681
  ...
621
682
 
683
+ @typing.overload
684
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
685
+ """
686
+ Decorator prototype for all step decorators. This function gets specialized
687
+ and imported for all decorators types by _import_plugin_decorators().
688
+ """
689
+ ...
690
+
691
+ @typing.overload
692
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
693
+ ...
694
+
695
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
696
+ """
697
+ Decorator prototype for all step decorators. This function gets specialized
698
+ and imported for all decorators types by _import_plugin_decorators().
699
+ """
700
+ ...
701
+
622
702
  @typing.overload
623
703
  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]]]:
624
704
  """
@@ -671,114 +751,35 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
671
751
  ...
672
752
 
673
753
  @typing.overload
674
- 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]]]:
754
+ 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]]]:
675
755
  """
676
- Specifies secrets to be retrieved and injected as environment variables prior to
677
- the execution of a step.
756
+ Specifies environment variables to be set prior to the execution of a step.
678
757
 
679
758
 
680
759
  Parameters
681
760
  ----------
682
- sources : List[Union[str, Dict[str, Any]]], default: []
683
- List of secret specs, defining how the secrets are to be retrieved
761
+ vars : Dict[str, str], default {}
762
+ Dictionary of environment variables to set.
684
763
  """
685
764
  ...
686
765
 
687
766
  @typing.overload
688
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
767
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
689
768
  ...
690
769
 
691
770
  @typing.overload
692
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
693
- ...
694
-
695
- 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]]] = []):
696
- """
697
- Specifies secrets to be retrieved and injected as environment variables prior to
698
- the execution of a step.
699
-
700
-
701
- Parameters
702
- ----------
703
- sources : List[Union[str, Dict[str, Any]]], default: []
704
- List of secret specs, defining how the secrets are to be retrieved
705
- """
771
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
706
772
  ...
707
773
 
708
- 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]]]:
774
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
709
775
  """
710
- Specifies that this step should execute on Kubernetes.
776
+ Specifies environment variables to be set prior to the execution of a step.
711
777
 
712
778
 
713
779
  Parameters
714
780
  ----------
715
- cpu : int, default 1
716
- Number of CPUs required for this step. If `@resources` is
717
- also present, the maximum value from all decorators is used.
718
- memory : int, default 4096
719
- Memory size (in MB) required for this step. If
720
- `@resources` is also present, the maximum value from all decorators is
721
- used.
722
- disk : int, default 10240
723
- Disk size (in MB) required for this step. If
724
- `@resources` is also present, the maximum value from all decorators is
725
- used.
726
- image : str, optional, default None
727
- Docker image to use when launching on Kubernetes. If not specified, and
728
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
729
- not, a default Docker image mapping to the current version of Python is used.
730
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
731
- If given, the imagePullPolicy to be applied to the Docker image of the step.
732
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
733
- Kubernetes service account to use when launching pod in Kubernetes.
734
- secrets : List[str], optional, default None
735
- Kubernetes secrets to use when launching pod in Kubernetes. These
736
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
737
- in Metaflow configuration.
738
- node_selector: Union[Dict[str,str], str], optional, default None
739
- Kubernetes node selector(s) to apply to the pod running the task.
740
- Can be passed in as a comma separated string of values e.g.
741
- 'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
742
- {'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
743
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
744
- Kubernetes namespace to use when launching pod in Kubernetes.
745
- gpu : int, optional, default None
746
- Number of GPUs required for this step. A value of zero implies that
747
- the scheduled node should not have GPUs.
748
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
749
- The vendor of the GPUs to be used for this step.
750
- tolerations : List[str], default []
751
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
752
- Kubernetes tolerations to use when launching pod in Kubernetes.
753
- labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
754
- Kubernetes labels to use when launching pod in Kubernetes.
755
- annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
756
- Kubernetes annotations to use when launching pod in Kubernetes.
757
- use_tmpfs : bool, default False
758
- This enables an explicit tmpfs mount for this step.
759
- tmpfs_tempdir : bool, default True
760
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
761
- tmpfs_size : int, optional, default: None
762
- The value for the size (in MiB) of the tmpfs mount for this step.
763
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
764
- memory allocated for this step.
765
- tmpfs_path : str, optional, default /metaflow_temp
766
- Path to tmpfs mount for this step.
767
- persistent_volume_claims : Dict[str, str], optional, default None
768
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
769
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
770
- shared_memory: int, optional
771
- Shared memory size (in MiB) required for this step
772
- port: int, optional
773
- Port number to specify in the Kubernetes job object
774
- compute_pool : str, optional, default None
775
- Compute pool to be used for for this step.
776
- If not specified, any accessible compute pool within the perimeter is used.
777
- hostname_resolution_timeout: int, default 10 * 60
778
- Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
779
- Only applicable when @parallel is used.
780
- qos: str, default: Burstable
781
- Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
781
+ vars : Dict[str, str], default {}
782
+ Dictionary of environment variables to set.
782
783
  """
783
784
  ...
784
785
 
@@ -861,6 +862,41 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
861
862
  """
862
863
  ...
863
864
 
865
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
866
+ """
867
+ Specifies what flows belong to the same project.
868
+
869
+ A project-specific namespace is created for all flows that
870
+ use the same `@project(name)`.
871
+
872
+
873
+ Parameters
874
+ ----------
875
+ name : str
876
+ Project name. Make sure that the name is unique amongst all
877
+ projects that use the same production scheduler. The name may
878
+ contain only lowercase alphanumeric characters and underscores.
879
+
880
+ branch : Optional[str], default None
881
+ The branch to use. If not specified, the branch is set to
882
+ `user.<username>` unless `production` is set to `True`. This can
883
+ also be set on the command line using `--branch` as a top-level option.
884
+ It is an error to specify `branch` in the decorator and on the command line.
885
+
886
+ production : bool, default False
887
+ Whether or not the branch is the production branch. This can also be set on the
888
+ command line using `--production` as a top-level option. It is an error to specify
889
+ `production` in the decorator and on the command line.
890
+ The project branch name will be:
891
+ - if `branch` is specified:
892
+ - if `production` is True: `prod.<branch>`
893
+ - if `production` is False: `test.<branch>`
894
+ - if `branch` is not specified:
895
+ - if `production` is True: `prod`
896
+ - if `production` is False: `user.<username>`
897
+ """
898
+ ...
899
+
864
900
  @typing.overload
865
901
  def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
866
902
  """
@@ -912,49 +948,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
912
948
  """
913
949
  ...
914
950
 
915
- 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]]:
916
- """
917
- 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.
918
- 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.
919
-
920
-
921
- Parameters
922
- ----------
923
- timeout : int
924
- Time, in seconds before the task times out and fails. (Default: 3600)
925
- poke_interval : int
926
- Time in seconds that the job should wait in between each try. (Default: 60)
927
- mode : str
928
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
929
- exponential_backoff : bool
930
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
931
- pool : str
932
- the slot pool this task should run in,
933
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
934
- soft_fail : bool
935
- Set to true to mark the task as SKIPPED on failure. (Default: False)
936
- name : str
937
- Name of the sensor on Airflow
938
- description : str
939
- Description of sensor in the Airflow UI
940
- external_dag_id : str
941
- The dag_id that contains the task you want to wait for.
942
- external_task_ids : List[str]
943
- The list of task_ids that you want to wait for.
944
- If None (default value) the sensor waits for the DAG. (Default: None)
945
- allowed_states : List[str]
946
- Iterable of allowed states, (Default: ['success'])
947
- failed_states : List[str]
948
- Iterable of failed or dis-allowed states. (Default: None)
949
- execution_delta : datetime.timedelta
950
- time difference with the previous execution to look at,
951
- the default is the same logical date as the current task or DAG. (Default: None)
952
- check_existence: bool
953
- Set to True to check if the external task exists or check if
954
- the DAG to wait for exists. (Default: True)
955
- """
956
- ...
957
-
958
951
  @typing.overload
959
952
  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]]:
960
953
  """
@@ -1048,47 +1041,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1048
1041
  """
1049
1042
  ...
1050
1043
 
1051
- @typing.overload
1052
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1053
- """
1054
- Specifies the PyPI packages for all steps of the flow.
1055
-
1056
- Use `@pypi_base` to set common packages required by all
1057
- steps and use `@pypi` to specify step-specific overrides.
1058
-
1059
- Parameters
1060
- ----------
1061
- packages : Dict[str, str], default: {}
1062
- Packages to use for this flow. The key is the name of the package
1063
- and the value is the version to use.
1064
- python : str, optional, default: None
1065
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1066
- that the version used will correspond to the version of the Python interpreter used to start the run.
1067
- """
1068
- ...
1069
-
1070
- @typing.overload
1071
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1072
- ...
1073
-
1074
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1075
- """
1076
- Specifies the PyPI packages for all steps of the flow.
1077
-
1078
- Use `@pypi_base` to set common packages required by all
1079
- steps and use `@pypi` to specify step-specific overrides.
1080
-
1081
- Parameters
1082
- ----------
1083
- packages : Dict[str, str], default: {}
1084
- Packages to use for this flow. The key is the name of the package
1085
- and the value is the version to use.
1086
- python : str, optional, default: None
1087
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1088
- that the version used will correspond to the version of the Python interpreter used to start the run.
1089
- """
1090
- ...
1091
-
1092
1044
  @typing.overload
1093
1045
  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]]:
1094
1046
  """
@@ -1140,6 +1092,49 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1140
1092
  """
1141
1093
  ...
1142
1094
 
1095
+ 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]]:
1096
+ """
1097
+ 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)
1098
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1099
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1100
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1101
+ starts only after all sensors finish.
1102
+
1103
+
1104
+ Parameters
1105
+ ----------
1106
+ timeout : int
1107
+ Time, in seconds before the task times out and fails. (Default: 3600)
1108
+ poke_interval : int
1109
+ Time in seconds that the job should wait in between each try. (Default: 60)
1110
+ mode : str
1111
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1112
+ exponential_backoff : bool
1113
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1114
+ pool : str
1115
+ the slot pool this task should run in,
1116
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1117
+ soft_fail : bool
1118
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1119
+ name : str
1120
+ Name of the sensor on Airflow
1121
+ description : str
1122
+ Description of sensor in the Airflow UI
1123
+ bucket_key : Union[str, List[str]]
1124
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1125
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1126
+ bucket_name : str
1127
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1128
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1129
+ wildcard_match : bool
1130
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1131
+ aws_conn_id : str
1132
+ a reference to the s3 connection on Airflow. (Default: None)
1133
+ verify : bool
1134
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1135
+ """
1136
+ ...
1137
+
1143
1138
  @typing.overload
1144
1139
  def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1145
1140
  """
@@ -1241,13 +1236,10 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1241
1236
  """
1242
1237
  ...
1243
1238
 
1244
- 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]]:
1239
+ 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]]:
1245
1240
  """
1246
- 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)
1247
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1248
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1249
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1250
- starts only after all sensors finish.
1241
+ 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.
1242
+ 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.
1251
1243
 
1252
1244
 
1253
1245
  Parameters
@@ -1269,53 +1261,62 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1269
1261
  Name of the sensor on Airflow
1270
1262
  description : str
1271
1263
  Description of sensor in the Airflow UI
1272
- bucket_key : Union[str, List[str]]
1273
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1274
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1275
- bucket_name : str
1276
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1277
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1278
- wildcard_match : bool
1279
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1280
- aws_conn_id : str
1281
- a reference to the s3 connection on Airflow. (Default: None)
1282
- verify : bool
1283
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1264
+ external_dag_id : str
1265
+ The dag_id that contains the task you want to wait for.
1266
+ external_task_ids : List[str]
1267
+ The list of task_ids that you want to wait for.
1268
+ If None (default value) the sensor waits for the DAG. (Default: None)
1269
+ allowed_states : List[str]
1270
+ Iterable of allowed states, (Default: ['success'])
1271
+ failed_states : List[str]
1272
+ Iterable of failed or dis-allowed states. (Default: None)
1273
+ execution_delta : datetime.timedelta
1274
+ time difference with the previous execution to look at,
1275
+ the default is the same logical date as the current task or DAG. (Default: None)
1276
+ check_existence: bool
1277
+ Set to True to check if the external task exists or check if
1278
+ the DAG to wait for exists. (Default: True)
1284
1279
  """
1285
1280
  ...
1286
1281
 
1287
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1282
+ @typing.overload
1283
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1288
1284
  """
1289
- Specifies what flows belong to the same project.
1290
-
1291
- A project-specific namespace is created for all flows that
1292
- use the same `@project(name)`.
1285
+ Specifies the PyPI packages for all steps of the flow.
1293
1286
 
1287
+ Use `@pypi_base` to set common packages required by all
1288
+ steps and use `@pypi` to specify step-specific overrides.
1294
1289
 
1295
1290
  Parameters
1296
1291
  ----------
1297
- name : str
1298
- Project name. Make sure that the name is unique amongst all
1299
- projects that use the same production scheduler. The name may
1300
- contain only lowercase alphanumeric characters and underscores.
1292
+ packages : Dict[str, str], default: {}
1293
+ Packages to use for this flow. The key is the name of the package
1294
+ and the value is the version to use.
1295
+ python : str, optional, default: None
1296
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1297
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1298
+ """
1299
+ ...
1300
+
1301
+ @typing.overload
1302
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1303
+ ...
1304
+
1305
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1306
+ """
1307
+ Specifies the PyPI packages for all steps of the flow.
1301
1308
 
1302
- branch : Optional[str], default None
1303
- The branch to use. If not specified, the branch is set to
1304
- `user.<username>` unless `production` is set to `True`. This can
1305
- also be set on the command line using `--branch` as a top-level option.
1306
- It is an error to specify `branch` in the decorator and on the command line.
1309
+ Use `@pypi_base` to set common packages required by all
1310
+ steps and use `@pypi` to specify step-specific overrides.
1307
1311
 
1308
- production : bool, default False
1309
- Whether or not the branch is the production branch. This can also be set on the
1310
- command line using `--production` as a top-level option. It is an error to specify
1311
- `production` in the decorator and on the command line.
1312
- The project branch name will be:
1313
- - if `branch` is specified:
1314
- - if `production` is True: `prod.<branch>`
1315
- - if `production` is False: `test.<branch>`
1316
- - if `branch` is not specified:
1317
- - if `production` is True: `prod`
1318
- - if `production` is False: `user.<username>`
1312
+ Parameters
1313
+ ----------
1314
+ packages : Dict[str, str], default: {}
1315
+ Packages to use for this flow. The key is the name of the package
1316
+ and the value is the version to use.
1317
+ python : str, optional, default: None
1318
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1319
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1319
1320
  """
1320
1321
  ...
1321
1322