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

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 +3 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +6 -6
  8. metaflow-stubs/client/filecache.pyi +2 -2
  9. metaflow-stubs/events.pyi +2 -2
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +5 -5
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +3 -3
  14. metaflow-stubs/meta_files.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +2 -2
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +4 -4
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/multicore_utils.pyi +2 -2
  23. metaflow-stubs/packaging_sys/__init__.pyi +6 -6
  24. metaflow-stubs/packaging_sys/backend.pyi +4 -4
  25. metaflow-stubs/packaging_sys/distribution_support.pyi +5 -5
  26. metaflow-stubs/packaging_sys/tar_backend.pyi +5 -5
  27. metaflow-stubs/packaging_sys/utils.pyi +2 -2
  28. metaflow-stubs/packaging_sys/v1.pyi +2 -2
  29. metaflow-stubs/parameters.pyi +3 -3
  30. metaflow-stubs/plugins/__init__.pyi +11 -11
  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 +3 -3
  43. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
  44. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  45. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
  46. metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
  47. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  50. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  51. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  52. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  53. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  54. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  55. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  56. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  58. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  59. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  60. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
  64. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +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 +3 -3
  69. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  70. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  71. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  72. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  74. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/components.pyi +84 -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 +2 -2
  88. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  89. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  90. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  91. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  92. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  93. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  94. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  95. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  96. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  97. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  98. metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
  100. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  103. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  104. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  105. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  106. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  107. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  108. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  110. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  112. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  114. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  115. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  116. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/__init__.pyi +3 -3
  119. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  121. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  122. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  124. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  125. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  126. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  127. metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
  128. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  129. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  130. metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
  131. metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
  132. metaflow-stubs/plugins/secrets/utils.pyi +2 -2
  133. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  134. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  135. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  136. metaflow-stubs/plugins/uv/__init__.pyi +2 -2
  137. metaflow-stubs/plugins/uv/uv_environment.pyi +3 -3
  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 +2 -2
  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 +5 -5
  159. metaflow-stubs/user_decorators/user_flow_decorator.pyi +4 -4
  160. metaflow-stubs/user_decorators/user_step_decorator.pyi +6 -6
  161. metaflow-stubs/version.pyi +2 -2
  162. {metaflow_stubs-2.18.6.dist-info → metaflow_stubs-2.18.8.dist-info}/METADATA +2 -2
  163. metaflow_stubs-2.18.8.dist-info/RECORD +166 -0
  164. metaflow_stubs-2.18.6.dist-info/RECORD +0 -166
  165. {metaflow_stubs-2.18.6.dist-info → metaflow_stubs-2.18.8.dist-info}/WHEEL +0 -0
  166. {metaflow_stubs-2.18.6.dist-info → metaflow_stubs-2.18.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.18.6 #
4
- # Generated on 2025-09-17T19:37:30.074072 #
3
+ # MF version: 2.18.8 #
4
+ # Generated on 2025-09-22T21:43:14.168437 #
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
 
@@ -39,16 +39,16 @@ from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDe
39
39
  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
- from . import events as events
43
42
  from . import tuple_util as tuple_util
44
43
  from . import metaflow_git as metaflow_git
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
- from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
51
50
  from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
51
+ from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
52
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
@@ -207,6 +207,64 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
207
207
  """
208
208
  ...
209
209
 
210
+ @typing.overload
211
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
212
+ """
213
+ Specifies secrets to be retrieved and injected as environment variables prior to
214
+ the execution of a step.
215
+
216
+
217
+ Parameters
218
+ ----------
219
+ sources : List[Union[str, Dict[str, Any]]], default: []
220
+ List of secret specs, defining how the secrets are to be retrieved
221
+ role : str, optional, default: None
222
+ Role to use for fetching secrets
223
+ """
224
+ ...
225
+
226
+ @typing.overload
227
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
228
+ ...
229
+
230
+ @typing.overload
231
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
232
+ ...
233
+
234
+ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
235
+ """
236
+ Specifies secrets to be retrieved and injected as environment variables prior to
237
+ the execution of a step.
238
+
239
+
240
+ Parameters
241
+ ----------
242
+ sources : List[Union[str, Dict[str, Any]]], default: []
243
+ List of secret specs, defining how the secrets are to be retrieved
244
+ role : str, optional, default: None
245
+ Role to use for fetching secrets
246
+ """
247
+ ...
248
+
249
+ @typing.overload
250
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
251
+ """
252
+ Decorator prototype for all step decorators. This function gets specialized
253
+ and imported for all decorators types by _import_plugin_decorators().
254
+ """
255
+ ...
256
+
257
+ @typing.overload
258
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
259
+ ...
260
+
261
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
262
+ """
263
+ Decorator prototype for all step decorators. This function gets specialized
264
+ and imported for all decorators types by _import_plugin_decorators().
265
+ """
266
+ ...
267
+
210
268
  @typing.overload
211
269
  def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, aws_batch_tags: typing.Optional[typing.Dict[str, str]] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
212
270
  """
@@ -363,72 +421,153 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
363
421
  ...
364
422
 
365
423
  @typing.overload
366
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
424
+ 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]]]:
367
425
  """
368
- Decorator prototype for all step decorators. This function gets specialized
369
- and imported for all decorators types by _import_plugin_decorators().
426
+ Specifies the Conda environment for the step.
427
+
428
+ Information in this decorator will augment any
429
+ attributes set in the `@conda_base` flow-level decorator. Hence,
430
+ you can use `@conda_base` to set packages required by all
431
+ steps and use `@conda` to specify step-specific overrides.
432
+
433
+
434
+ Parameters
435
+ ----------
436
+ packages : Dict[str, str], default {}
437
+ Packages to use for this step. The key is the name of the package
438
+ and the value is the version to use.
439
+ libraries : Dict[str, str], default {}
440
+ Supported for backward compatibility. When used with packages, packages will take precedence.
441
+ python : str, optional, default None
442
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
443
+ that the version used will correspond to the version of the Python interpreter used to start the run.
444
+ disabled : bool, default False
445
+ If set to True, disables @conda.
370
446
  """
371
447
  ...
372
448
 
373
449
  @typing.overload
374
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
450
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
375
451
  ...
376
452
 
377
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
378
- """
379
- Decorator prototype for all step decorators. This function gets specialized
380
- and imported for all decorators types by _import_plugin_decorators().
381
- """
453
+ @typing.overload
454
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
382
455
  ...
383
456
 
384
- @typing.overload
385
- 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]]]:
457
+ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
386
458
  """
387
- Specifies the PyPI packages for the step.
459
+ Specifies the Conda environment for the step.
388
460
 
389
461
  Information in this decorator will augment any
390
- attributes set in the `@pyi_base` flow-level decorator. Hence,
391
- you can use `@pypi_base` to set packages required by all
392
- steps and use `@pypi` to specify step-specific overrides.
462
+ attributes set in the `@conda_base` flow-level decorator. Hence,
463
+ you can use `@conda_base` to set packages required by all
464
+ steps and use `@conda` to specify step-specific overrides.
393
465
 
394
466
 
395
467
  Parameters
396
468
  ----------
397
- packages : Dict[str, str], default: {}
469
+ packages : Dict[str, str], default {}
398
470
  Packages to use for this step. The key is the name of the package
399
471
  and the value is the version to use.
400
- python : str, optional, default: None
472
+ libraries : Dict[str, str], default {}
473
+ Supported for backward compatibility. When used with packages, packages will take precedence.
474
+ python : str, optional, default None
401
475
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
402
476
  that the version used will correspond to the version of the Python interpreter used to start the run.
477
+ disabled : bool, default False
478
+ If set to True, disables @conda.
403
479
  """
404
480
  ...
405
481
 
406
482
  @typing.overload
407
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
483
+ 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]]]:
484
+ """
485
+ Specifies environment variables to be set prior to the execution of a step.
486
+
487
+
488
+ Parameters
489
+ ----------
490
+ vars : Dict[str, str], default {}
491
+ Dictionary of environment variables to set.
492
+ """
408
493
  ...
409
494
 
410
495
  @typing.overload
411
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
496
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
412
497
  ...
413
498
 
414
- 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):
499
+ @typing.overload
500
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
501
+ ...
502
+
503
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
415
504
  """
416
- Specifies the PyPI packages for the step.
505
+ Specifies environment variables to be set prior to the execution of a step.
417
506
 
418
- Information in this decorator will augment any
419
- attributes set in the `@pyi_base` flow-level decorator. Hence,
420
- you can use `@pypi_base` to set packages required by all
421
- steps and use `@pypi` to specify step-specific overrides.
507
+
508
+ Parameters
509
+ ----------
510
+ vars : Dict[str, str], default {}
511
+ Dictionary of environment variables to set.
512
+ """
513
+ ...
514
+
515
+ @typing.overload
516
+ 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]]]:
517
+ """
518
+ Specifies a timeout for your step.
519
+
520
+ This decorator is useful if this step may hang indefinitely.
521
+
522
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
523
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
524
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
525
+
526
+ Note that all the values specified in parameters are added together so if you specify
527
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
422
528
 
423
529
 
424
530
  Parameters
425
531
  ----------
426
- packages : Dict[str, str], default: {}
427
- Packages to use for this step. The key is the name of the package
428
- and the value is the version to use.
429
- python : str, optional, default: None
430
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
431
- that the version used will correspond to the version of the Python interpreter used to start the run.
532
+ seconds : int, default 0
533
+ Number of seconds to wait prior to timing out.
534
+ minutes : int, default 0
535
+ Number of minutes to wait prior to timing out.
536
+ hours : int, default 0
537
+ Number of hours to wait prior to timing out.
538
+ """
539
+ ...
540
+
541
+ @typing.overload
542
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
543
+ ...
544
+
545
+ @typing.overload
546
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
547
+ ...
548
+
549
+ 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):
550
+ """
551
+ Specifies a timeout for your step.
552
+
553
+ This decorator is useful if this step may hang indefinitely.
554
+
555
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
556
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
557
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
558
+
559
+ Note that all the values specified in parameters are added together so if you specify
560
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
561
+
562
+
563
+ Parameters
564
+ ----------
565
+ seconds : int, default 0
566
+ Number of seconds to wait prior to timing out.
567
+ minutes : int, default 0
568
+ Number of minutes to wait prior to timing out.
569
+ hours : int, default 0
570
+ Number of hours to wait prior to timing out.
432
571
  """
433
572
  ...
434
573
 
@@ -532,206 +671,9 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
532
671
  """
533
672
  ...
534
673
 
535
- @typing.overload
536
- def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
537
- """
538
- Specifies a timeout for your step.
539
-
540
- This decorator is useful if this step may hang indefinitely.
541
-
542
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
543
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
544
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
545
-
546
- Note that all the values specified in parameters are added together so if you specify
547
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
548
-
549
-
550
- Parameters
551
- ----------
552
- seconds : int, default 0
553
- Number of seconds to wait prior to timing out.
554
- minutes : int, default 0
555
- Number of minutes to wait prior to timing out.
556
- hours : int, default 0
557
- Number of hours to wait prior to timing out.
558
- """
559
- ...
560
-
561
- @typing.overload
562
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
563
- ...
564
-
565
- @typing.overload
566
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
567
- ...
568
-
569
- def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
674
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
570
675
  """
571
- Specifies a timeout for your step.
572
-
573
- This decorator is useful if this step may hang indefinitely.
574
-
575
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
576
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
577
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
578
-
579
- Note that all the values specified in parameters are added together so if you specify
580
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
581
-
582
-
583
- Parameters
584
- ----------
585
- seconds : int, default 0
586
- Number of seconds to wait prior to timing out.
587
- minutes : int, default 0
588
- Number of minutes to wait prior to timing out.
589
- hours : int, default 0
590
- Number of hours to wait prior to timing out.
591
- """
592
- ...
593
-
594
- @typing.overload
595
- 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]]]:
596
- """
597
- Specifies the resources needed when executing this step.
598
-
599
- Use `@resources` to specify the resource requirements
600
- independently of the specific compute layer (`@batch`, `@kubernetes`).
601
-
602
- You can choose the compute layer on the command line by executing e.g.
603
- ```
604
- python myflow.py run --with batch
605
- ```
606
- or
607
- ```
608
- python myflow.py run --with kubernetes
609
- ```
610
- which executes the flow on the desired system using the
611
- requirements specified in `@resources`.
612
-
613
-
614
- Parameters
615
- ----------
616
- cpu : int, default 1
617
- Number of CPUs required for this step.
618
- gpu : int, optional, default None
619
- Number of GPUs required for this step.
620
- disk : int, optional, default None
621
- Disk size (in MB) required for this step. Only applies on Kubernetes.
622
- memory : int, default 4096
623
- Memory size (in MB) required for this step.
624
- shared_memory : int, optional, default None
625
- The value for the size (in MiB) of the /dev/shm volume for this step.
626
- This parameter maps to the `--shm-size` option in Docker.
627
- """
628
- ...
629
-
630
- @typing.overload
631
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
632
- ...
633
-
634
- @typing.overload
635
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
636
- ...
637
-
638
- 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):
639
- """
640
- Specifies the resources needed when executing this step.
641
-
642
- Use `@resources` to specify the resource requirements
643
- independently of the specific compute layer (`@batch`, `@kubernetes`).
644
-
645
- You can choose the compute layer on the command line by executing e.g.
646
- ```
647
- python myflow.py run --with batch
648
- ```
649
- or
650
- ```
651
- python myflow.py run --with kubernetes
652
- ```
653
- which executes the flow on the desired system using the
654
- requirements specified in `@resources`.
655
-
656
-
657
- Parameters
658
- ----------
659
- cpu : int, default 1
660
- Number of CPUs required for this step.
661
- gpu : int, optional, default None
662
- Number of GPUs required for this step.
663
- disk : int, optional, default None
664
- Disk size (in MB) required for this step. Only applies on Kubernetes.
665
- memory : int, default 4096
666
- Memory size (in MB) required for this step.
667
- shared_memory : int, optional, default None
668
- The value for the size (in MiB) of the /dev/shm volume for this step.
669
- This parameter maps to the `--shm-size` option in Docker.
670
- """
671
- ...
672
-
673
- @typing.overload
674
- def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
675
- """
676
- Specifies the Conda environment for the step.
677
-
678
- Information in this decorator will augment any
679
- attributes set in the `@conda_base` flow-level decorator. Hence,
680
- you can use `@conda_base` to set packages required by all
681
- steps and use `@conda` to specify step-specific overrides.
682
-
683
-
684
- Parameters
685
- ----------
686
- packages : Dict[str, str], default {}
687
- Packages to use for this step. The key is the name of the package
688
- and the value is the version to use.
689
- libraries : Dict[str, str], default {}
690
- Supported for backward compatibility. When used with packages, packages will take precedence.
691
- python : str, optional, default None
692
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
693
- that the version used will correspond to the version of the Python interpreter used to start the run.
694
- disabled : bool, default False
695
- If set to True, disables @conda.
696
- """
697
- ...
698
-
699
- @typing.overload
700
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
701
- ...
702
-
703
- @typing.overload
704
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
705
- ...
706
-
707
- def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
708
- """
709
- Specifies the Conda environment for the step.
710
-
711
- Information in this decorator will augment any
712
- attributes set in the `@conda_base` flow-level decorator. Hence,
713
- you can use `@conda_base` to set packages required by all
714
- steps and use `@conda` to specify step-specific overrides.
715
-
716
-
717
- Parameters
718
- ----------
719
- packages : Dict[str, str], default {}
720
- Packages to use for this step. The key is the name of the package
721
- and the value is the version to use.
722
- libraries : Dict[str, str], default {}
723
- Supported for backward compatibility. When used with packages, packages will take precedence.
724
- python : str, optional, default None
725
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
726
- that the version used will correspond to the version of the Python interpreter used to start the run.
727
- disabled : bool, default False
728
- If set to True, disables @conda.
729
- """
730
- ...
731
-
732
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
733
- """
734
- Specifies that this step should execute on Kubernetes.
676
+ Specifies that this step should execute on Kubernetes.
735
677
 
736
678
 
737
679
  Parameters
@@ -819,74 +761,183 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
819
761
  ...
820
762
 
821
763
  @typing.overload
822
- def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
764
+ 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]]]:
823
765
  """
824
- Specifies secrets to be retrieved and injected as environment variables prior to
825
- the execution of a step.
766
+ Specifies the PyPI packages for the step.
767
+
768
+ Information in this decorator will augment any
769
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
770
+ you can use `@pypi_base` to set packages required by all
771
+ steps and use `@pypi` to specify step-specific overrides.
826
772
 
827
773
 
828
774
  Parameters
829
775
  ----------
830
- sources : List[Union[str, Dict[str, Any]]], default: []
831
- List of secret specs, defining how the secrets are to be retrieved
832
- role : str, optional, default: None
833
- Role to use for fetching secrets
776
+ packages : Dict[str, str], default: {}
777
+ Packages to use for this step. The key is the name of the package
778
+ and the value is the version to use.
779
+ python : str, optional, default: None
780
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
781
+ that the version used will correspond to the version of the Python interpreter used to start the run.
834
782
  """
835
783
  ...
836
784
 
837
785
  @typing.overload
838
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
786
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
839
787
  ...
840
788
 
841
789
  @typing.overload
842
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
790
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
843
791
  ...
844
792
 
845
- def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: typing.Optional[str] = None):
793
+ 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):
846
794
  """
847
- Specifies secrets to be retrieved and injected as environment variables prior to
848
- the execution of a step.
795
+ Specifies the PyPI packages for the step.
796
+
797
+ Information in this decorator will augment any
798
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
799
+ you can use `@pypi_base` to set packages required by all
800
+ steps and use `@pypi` to specify step-specific overrides.
849
801
 
850
802
 
851
803
  Parameters
852
804
  ----------
853
- sources : List[Union[str, Dict[str, Any]]], default: []
854
- List of secret specs, defining how the secrets are to be retrieved
855
- role : str, optional, default: None
856
- Role to use for fetching secrets
805
+ packages : Dict[str, str], default: {}
806
+ Packages to use for this step. The key is the name of the package
807
+ and the value is the version to use.
808
+ python : str, optional, default: None
809
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
810
+ that the version used will correspond to the version of the Python interpreter used to start the run.
857
811
  """
858
812
  ...
859
813
 
860
814
  @typing.overload
861
- def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
815
+ 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]]]:
862
816
  """
863
- Specifies environment variables to be set prior to the execution of a step.
817
+ Specifies the resources needed when executing this step.
818
+
819
+ Use `@resources` to specify the resource requirements
820
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
821
+
822
+ You can choose the compute layer on the command line by executing e.g.
823
+ ```
824
+ python myflow.py run --with batch
825
+ ```
826
+ or
827
+ ```
828
+ python myflow.py run --with kubernetes
829
+ ```
830
+ which executes the flow on the desired system using the
831
+ requirements specified in `@resources`.
864
832
 
865
833
 
866
834
  Parameters
867
835
  ----------
868
- vars : Dict[str, str], default {}
869
- Dictionary of environment variables to set.
836
+ cpu : int, default 1
837
+ Number of CPUs required for this step.
838
+ gpu : int, optional, default None
839
+ Number of GPUs required for this step.
840
+ disk : int, optional, default None
841
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
842
+ memory : int, default 4096
843
+ Memory size (in MB) required for this step.
844
+ shared_memory : int, optional, default None
845
+ The value for the size (in MiB) of the /dev/shm volume for this step.
846
+ This parameter maps to the `--shm-size` option in Docker.
870
847
  """
871
848
  ...
872
849
 
873
850
  @typing.overload
874
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
851
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
875
852
  ...
876
853
 
877
854
  @typing.overload
878
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
855
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
879
856
  ...
880
857
 
881
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
858
+ 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):
882
859
  """
883
- Specifies environment variables to be set prior to the execution of a step.
860
+ Specifies the resources needed when executing this step.
861
+
862
+ Use `@resources` to specify the resource requirements
863
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
864
+
865
+ You can choose the compute layer on the command line by executing e.g.
866
+ ```
867
+ python myflow.py run --with batch
868
+ ```
869
+ or
870
+ ```
871
+ python myflow.py run --with kubernetes
872
+ ```
873
+ which executes the flow on the desired system using the
874
+ requirements specified in `@resources`.
884
875
 
885
876
 
886
877
  Parameters
887
878
  ----------
888
- vars : Dict[str, str], default {}
889
- Dictionary of environment variables to set.
879
+ cpu : int, default 1
880
+ Number of CPUs required for this step.
881
+ gpu : int, optional, default None
882
+ Number of GPUs required for this step.
883
+ disk : int, optional, default None
884
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
885
+ memory : int, default 4096
886
+ Memory size (in MB) required for this step.
887
+ shared_memory : int, optional, default None
888
+ The value for the size (in MiB) of the /dev/shm volume for this step.
889
+ This parameter maps to the `--shm-size` option in Docker.
890
+ """
891
+ ...
892
+
893
+ @typing.overload
894
+ 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]]:
895
+ """
896
+ Specifies the times when the flow should be run when running on a
897
+ production scheduler.
898
+
899
+
900
+ Parameters
901
+ ----------
902
+ hourly : bool, default False
903
+ Run the workflow hourly.
904
+ daily : bool, default True
905
+ Run the workflow daily.
906
+ weekly : bool, default False
907
+ Run the workflow weekly.
908
+ cron : str, optional, default None
909
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
910
+ specified by this expression.
911
+ timezone : str, optional, default None
912
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
913
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
914
+ """
915
+ ...
916
+
917
+ @typing.overload
918
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
919
+ ...
920
+
921
+ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
922
+ """
923
+ Specifies the times when the flow should be run when running on a
924
+ production scheduler.
925
+
926
+
927
+ Parameters
928
+ ----------
929
+ hourly : bool, default False
930
+ Run the workflow hourly.
931
+ daily : bool, default True
932
+ Run the workflow daily.
933
+ weekly : bool, default False
934
+ Run the workflow weekly.
935
+ cron : str, optional, default None
936
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
937
+ specified by this expression.
938
+ timezone : str, optional, default None
939
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
940
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
890
941
  """
891
942
  ...
892
943
 
@@ -961,167 +1012,43 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
961
1012
  by specifying the fully qualified project_flow_name.
962
1013
  ```
963
1014
  @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
964
- ```
965
- or
966
- ```
967
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
968
- ```
969
-
970
- You can also specify just the project or project branch (other values will be
971
- inferred from the current project or project branch):
972
- ```
973
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
974
- ```
975
-
976
- Note that `branch` is typically one of:
977
- - `prod`
978
- - `user.bob`
979
- - `test.my_experiment`
980
- - `prod.staging`
981
-
982
-
983
- Parameters
984
- ----------
985
- flow : Union[str, Dict[str, str]], optional, default None
986
- Upstream flow dependency for this flow.
987
- flows : List[Union[str, Dict[str, str]]], default []
988
- Upstream flow dependencies for this flow.
989
- options : Dict[str, Any], default {}
990
- Backend-specific configuration for tuning eventing behavior.
991
- """
992
- ...
993
-
994
- @typing.overload
995
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
996
- """
997
- Specifies the PyPI packages for all steps of the flow.
998
-
999
- Use `@pypi_base` to set common packages required by all
1000
- steps and use `@pypi` to specify step-specific overrides.
1001
-
1002
- Parameters
1003
- ----------
1004
- packages : Dict[str, str], default: {}
1005
- Packages to use for this flow. The key is the name of the package
1006
- and the value is the version to use.
1007
- python : str, optional, default: None
1008
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1009
- that the version used will correspond to the version of the Python interpreter used to start the run.
1010
- """
1011
- ...
1012
-
1013
- @typing.overload
1014
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1015
- ...
1016
-
1017
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1018
- """
1019
- Specifies the PyPI packages for all steps of the flow.
1020
-
1021
- Use `@pypi_base` to set common packages required by all
1022
- steps and use `@pypi` to specify step-specific overrides.
1023
-
1024
- Parameters
1025
- ----------
1026
- packages : Dict[str, str], default: {}
1027
- Packages to use for this flow. The key is the name of the package
1028
- and the value is the version to use.
1029
- python : str, optional, default: None
1030
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1031
- that the version used will correspond to the version of the Python interpreter used to start the run.
1032
- """
1033
- ...
1034
-
1035
- @typing.overload
1036
- def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1037
- """
1038
- Specifies the Conda environment for all steps of the flow.
1039
-
1040
- Use `@conda_base` to set common libraries required by all
1041
- steps and use `@conda` to specify step-specific additions.
1042
-
1043
-
1044
- Parameters
1045
- ----------
1046
- packages : Dict[str, str], default {}
1047
- Packages to use for this flow. The key is the name of the package
1048
- and the value is the version to use.
1049
- libraries : Dict[str, str], default {}
1050
- Supported for backward compatibility. When used with packages, packages will take precedence.
1051
- python : str, optional, default None
1052
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1053
- that the version used will correspond to the version of the Python interpreter used to start the run.
1054
- disabled : bool, default False
1055
- If set to True, disables Conda.
1056
- """
1057
- ...
1058
-
1059
- @typing.overload
1060
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1061
- ...
1062
-
1063
- 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):
1064
- """
1065
- Specifies the Conda environment for all steps of the flow.
1066
-
1067
- Use `@conda_base` to set common libraries required by all
1068
- steps and use `@conda` to specify step-specific additions.
1069
-
1070
-
1071
- Parameters
1072
- ----------
1073
- packages : Dict[str, str], default {}
1074
- Packages to use for this flow. The key is the name of the package
1075
- and the value is the version to use.
1076
- libraries : Dict[str, str], default {}
1077
- Supported for backward compatibility. When used with packages, packages will take precedence.
1078
- python : str, optional, default None
1079
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1080
- that the version used will correspond to the version of the Python interpreter used to start the run.
1081
- disabled : bool, default False
1082
- If set to True, disables Conda.
1083
- """
1084
- ...
1085
-
1086
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1087
- """
1088
- Specifies what flows belong to the same project.
1015
+ ```
1016
+ or
1017
+ ```
1018
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1019
+ ```
1089
1020
 
1090
- A project-specific namespace is created for all flows that
1091
- use the same `@project(name)`.
1021
+ You can also specify just the project or project branch (other values will be
1022
+ inferred from the current project or project branch):
1023
+ ```
1024
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1025
+ ```
1026
+
1027
+ Note that `branch` is typically one of:
1028
+ - `prod`
1029
+ - `user.bob`
1030
+ - `test.my_experiment`
1031
+ - `prod.staging`
1092
1032
 
1093
1033
 
1094
1034
  Parameters
1095
1035
  ----------
1096
- name : str
1097
- Project name. Make sure that the name is unique amongst all
1098
- projects that use the same production scheduler. The name may
1099
- contain only lowercase alphanumeric characters and underscores.
1100
-
1101
- branch : Optional[str], default None
1102
- The branch to use. If not specified, the branch is set to
1103
- `user.<username>` unless `production` is set to `True`. This can
1104
- also be set on the command line using `--branch` as a top-level option.
1105
- It is an error to specify `branch` in the decorator and on the command line.
1106
-
1107
- production : bool, default False
1108
- Whether or not the branch is the production branch. This can also be set on the
1109
- command line using `--production` as a top-level option. It is an error to specify
1110
- `production` in the decorator and on the command line.
1111
- The project branch name will be:
1112
- - if `branch` is specified:
1113
- - if `production` is True: `prod.<branch>`
1114
- - if `production` is False: `test.<branch>`
1115
- - if `branch` is not specified:
1116
- - if `production` is True: `prod`
1117
- - if `production` is False: `user.<username>`
1036
+ flow : Union[str, Dict[str, str]], optional, default None
1037
+ Upstream flow dependency for this flow.
1038
+ flows : List[Union[str, Dict[str, str]]], default []
1039
+ Upstream flow dependencies for this flow.
1040
+ options : Dict[str, Any], default {}
1041
+ Backend-specific configuration for tuning eventing behavior.
1118
1042
  """
1119
1043
  ...
1120
1044
 
1121
- def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1045
+ 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]]:
1122
1046
  """
1123
- The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
1124
- This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1047
+ 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)
1048
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1049
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1050
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1051
+ starts only after all sensors finish.
1125
1052
 
1126
1053
 
1127
1054
  Parameters
@@ -1143,21 +1070,18 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1143
1070
  Name of the sensor on Airflow
1144
1071
  description : str
1145
1072
  Description of sensor in the Airflow UI
1146
- external_dag_id : str
1147
- The dag_id that contains the task you want to wait for.
1148
- external_task_ids : List[str]
1149
- The list of task_ids that you want to wait for.
1150
- If None (default value) the sensor waits for the DAG. (Default: None)
1151
- allowed_states : List[str]
1152
- Iterable of allowed states, (Default: ['success'])
1153
- failed_states : List[str]
1154
- Iterable of failed or dis-allowed states. (Default: None)
1155
- execution_delta : datetime.timedelta
1156
- time difference with the previous execution to look at,
1157
- the default is the same logical date as the current task or DAG. (Default: None)
1158
- check_existence: bool
1159
- Set to True to check if the external task exists or check if
1160
- the DAG to wait for exists. (Default: True)
1073
+ bucket_key : Union[str, List[str]]
1074
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1075
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1076
+ bucket_name : str
1077
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1078
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1079
+ wildcard_match : bool
1080
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1081
+ aws_conn_id : str
1082
+ a reference to the s3 connection on Airflow. (Default: None)
1083
+ verify : bool
1084
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1161
1085
  """
1162
1086
  ...
1163
1087
 
@@ -1254,64 +1178,86 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1254
1178
  """
1255
1179
  ...
1256
1180
 
1181
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1182
+ """
1183
+ Specifies what flows belong to the same project.
1184
+
1185
+ A project-specific namespace is created for all flows that
1186
+ use the same `@project(name)`.
1187
+
1188
+
1189
+ Parameters
1190
+ ----------
1191
+ name : str
1192
+ Project name. Make sure that the name is unique amongst all
1193
+ projects that use the same production scheduler. The name may
1194
+ contain only lowercase alphanumeric characters and underscores.
1195
+
1196
+ branch : Optional[str], default None
1197
+ The branch to use. If not specified, the branch is set to
1198
+ `user.<username>` unless `production` is set to `True`. This can
1199
+ also be set on the command line using `--branch` as a top-level option.
1200
+ It is an error to specify `branch` in the decorator and on the command line.
1201
+
1202
+ production : bool, default False
1203
+ Whether or not the branch is the production branch. This can also be set on the
1204
+ command line using `--production` as a top-level option. It is an error to specify
1205
+ `production` in the decorator and on the command line.
1206
+ The project branch name will be:
1207
+ - if `branch` is specified:
1208
+ - if `production` is True: `prod.<branch>`
1209
+ - if `production` is False: `test.<branch>`
1210
+ - if `branch` is not specified:
1211
+ - if `production` is True: `prod`
1212
+ - if `production` is False: `user.<username>`
1213
+ """
1214
+ ...
1215
+
1257
1216
  @typing.overload
1258
- def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1217
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1259
1218
  """
1260
- Specifies the times when the flow should be run when running on a
1261
- production scheduler.
1219
+ Specifies the PyPI packages for all steps of the flow.
1262
1220
 
1221
+ Use `@pypi_base` to set common packages required by all
1222
+ steps and use `@pypi` to specify step-specific overrides.
1263
1223
 
1264
1224
  Parameters
1265
1225
  ----------
1266
- hourly : bool, default False
1267
- Run the workflow hourly.
1268
- daily : bool, default True
1269
- Run the workflow daily.
1270
- weekly : bool, default False
1271
- Run the workflow weekly.
1272
- cron : str, optional, default None
1273
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1274
- specified by this expression.
1275
- timezone : str, optional, default None
1276
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1277
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1226
+ packages : Dict[str, str], default: {}
1227
+ Packages to use for this flow. The key is the name of the package
1228
+ and the value is the version to use.
1229
+ python : str, optional, default: None
1230
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1231
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1278
1232
  """
1279
1233
  ...
1280
1234
 
1281
1235
  @typing.overload
1282
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1236
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1283
1237
  ...
1284
1238
 
1285
- def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1239
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1286
1240
  """
1287
- Specifies the times when the flow should be run when running on a
1288
- production scheduler.
1241
+ Specifies the PyPI packages for all steps of the flow.
1289
1242
 
1243
+ Use `@pypi_base` to set common packages required by all
1244
+ steps and use `@pypi` to specify step-specific overrides.
1290
1245
 
1291
1246
  Parameters
1292
1247
  ----------
1293
- hourly : bool, default False
1294
- Run the workflow hourly.
1295
- daily : bool, default True
1296
- Run the workflow daily.
1297
- weekly : bool, default False
1298
- Run the workflow weekly.
1299
- cron : str, optional, default None
1300
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1301
- specified by this expression.
1302
- timezone : str, optional, default None
1303
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1304
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1248
+ packages : Dict[str, str], default: {}
1249
+ Packages to use for this flow. The key is the name of the package
1250
+ and the value is the version to use.
1251
+ python : str, optional, default: None
1252
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1253
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1305
1254
  """
1306
1255
  ...
1307
1256
 
1308
- def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1257
+ 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]]:
1309
1258
  """
1310
- The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
1311
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1312
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1313
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1314
- starts only after all sensors finish.
1259
+ 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.
1260
+ 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.
1315
1261
 
1316
1262
 
1317
1263
  Parameters
@@ -1333,18 +1279,72 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1333
1279
  Name of the sensor on Airflow
1334
1280
  description : str
1335
1281
  Description of sensor in the Airflow UI
1336
- bucket_key : Union[str, List[str]]
1337
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1338
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1339
- bucket_name : str
1340
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1341
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1342
- wildcard_match : bool
1343
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1344
- aws_conn_id : str
1345
- a reference to the s3 connection on Airflow. (Default: None)
1346
- verify : bool
1347
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1282
+ external_dag_id : str
1283
+ The dag_id that contains the task you want to wait for.
1284
+ external_task_ids : List[str]
1285
+ The list of task_ids that you want to wait for.
1286
+ If None (default value) the sensor waits for the DAG. (Default: None)
1287
+ allowed_states : List[str]
1288
+ Iterable of allowed states, (Default: ['success'])
1289
+ failed_states : List[str]
1290
+ Iterable of failed or dis-allowed states. (Default: None)
1291
+ execution_delta : datetime.timedelta
1292
+ time difference with the previous execution to look at,
1293
+ the default is the same logical date as the current task or DAG. (Default: None)
1294
+ check_existence: bool
1295
+ Set to True to check if the external task exists or check if
1296
+ the DAG to wait for exists. (Default: True)
1297
+ """
1298
+ ...
1299
+
1300
+ @typing.overload
1301
+ 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]]:
1302
+ """
1303
+ Specifies the Conda environment for all steps of the flow.
1304
+
1305
+ Use `@conda_base` to set common libraries required by all
1306
+ steps and use `@conda` to specify step-specific additions.
1307
+
1308
+
1309
+ Parameters
1310
+ ----------
1311
+ packages : Dict[str, str], default {}
1312
+ Packages to use for this flow. The key is the name of the package
1313
+ and the value is the version to use.
1314
+ libraries : Dict[str, str], default {}
1315
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1316
+ python : str, optional, default None
1317
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1318
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1319
+ disabled : bool, default False
1320
+ If set to True, disables Conda.
1321
+ """
1322
+ ...
1323
+
1324
+ @typing.overload
1325
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1326
+ ...
1327
+
1328
+ 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):
1329
+ """
1330
+ Specifies the Conda environment for all steps of the flow.
1331
+
1332
+ Use `@conda_base` to set common libraries required by all
1333
+ steps and use `@conda` to specify step-specific additions.
1334
+
1335
+
1336
+ Parameters
1337
+ ----------
1338
+ packages : Dict[str, str], default {}
1339
+ Packages to use for this flow. The key is the name of the package
1340
+ and the value is the version to use.
1341
+ libraries : Dict[str, str], default {}
1342
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1343
+ python : str, optional, default None
1344
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1345
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1346
+ disabled : bool, default False
1347
+ If set to True, disables Conda.
1348
1348
  """
1349
1349
  ...
1350
1350