metaflow-stubs 2.17.0__py2.py3-none-any.whl → 2.17.1__py2.py3-none-any.whl

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

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 +569 -569
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/cli_components/__init__.pyi +2 -2
  5. metaflow-stubs/cli_components/utils.pyi +2 -2
  6. metaflow-stubs/client/__init__.pyi +2 -2
  7. metaflow-stubs/client/core.pyi +6 -6
  8. metaflow-stubs/client/filecache.pyi +2 -2
  9. metaflow-stubs/events.pyi +3 -3
  10. metaflow-stubs/exception.pyi +2 -2
  11. metaflow-stubs/flowspec.pyi +6 -6
  12. metaflow-stubs/generated_for.txt +1 -1
  13. metaflow-stubs/includefile.pyi +4 -4
  14. metaflow-stubs/meta_files.pyi +2 -2
  15. metaflow-stubs/metadata_provider/__init__.pyi +2 -2
  16. metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
  17. metaflow-stubs/metadata_provider/metadata.pyi +3 -3
  18. metaflow-stubs/metadata_provider/util.pyi +2 -2
  19. metaflow-stubs/metaflow_config.pyi +2 -2
  20. metaflow-stubs/metaflow_current.pyi +18 -18
  21. metaflow-stubs/metaflow_git.pyi +2 -2
  22. metaflow-stubs/multicore_utils.pyi +2 -2
  23. metaflow-stubs/packaging_sys/__init__.pyi +5 -5
  24. metaflow-stubs/packaging_sys/backend.pyi +3 -3
  25. metaflow-stubs/packaging_sys/distribution_support.pyi +4 -4
  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 +3 -3
  29. metaflow-stubs/parameters.pyi +5 -5
  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 +3 -3
  44. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
  45. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +4 -4
  46. metaflow-stubs/plugins/argo/exit_hooks.pyi +3 -3
  47. metaflow-stubs/plugins/aws/__init__.pyi +3 -3
  48. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  50. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  51. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  52. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  53. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  54. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  55. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  56. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  58. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  59. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  60. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
  64. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
  65. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  67. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  68. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  69. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  70. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  71. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  72. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_client.pyi +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 +3 -3
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  81. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  82. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  83. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  84. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  85. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  86. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  87. metaflow-stubs/plugins/catch_decorator.pyi +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 +4 -4
  104. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  105. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  106. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  107. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  108. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
  110. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  112. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  114. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  115. metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
  116. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  119. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  121. metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
  122. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  124. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  125. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  126. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  127. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  128. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  129. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  130. metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
  131. metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
  132. metaflow-stubs/plugins/secrets/utils.pyi +2 -2
  133. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  134. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  135. metaflow-stubs/plugins/timeout_decorator.pyi +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 +34 -34
  141. metaflow-stubs/runner/deployer_impl.pyi +10 -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 +2 -2
  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 +4 -4
  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 +4 -4
  159. metaflow-stubs/user_decorators/user_flow_decorator.pyi +5 -5
  160. metaflow-stubs/user_decorators/user_step_decorator.pyi +6 -6
  161. metaflow-stubs/version.pyi +2 -2
  162. {metaflow_stubs-2.17.0.dist-info → metaflow_stubs-2.17.1.dist-info}/METADATA +2 -2
  163. metaflow_stubs-2.17.1.dist-info/RECORD +166 -0
  164. metaflow_stubs-2.17.0.dist-info/RECORD +0 -166
  165. {metaflow_stubs-2.17.0.dist-info → metaflow_stubs-2.17.1.dist-info}/WHEEL +0 -0
  166. {metaflow_stubs-2.17.0.dist-info → metaflow_stubs-2.17.1.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
1
1
  ######################################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.17.0 #
4
- # Generated on 2025-08-06T11:05:04.016056 #
3
+ # MF version: 2.17.1 #
4
+ # Generated on 2025-08-11T22:07:35.926648 #
5
5
  ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
@@ -39,17 +39,17 @@ 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 tuple_util as tuple_util
43
42
  from . import metaflow_git as metaflow_git
44
43
  from . import events as events
44
+ from . import tuple_util as tuple_util
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 pyproject_toml_parser as pyproject_toml_parser
51
- from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
52
50
  from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
51
+ from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
52
+ from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
53
53
  from . import cards as cards
54
54
  from . import client as client
55
55
  from .client.core import namespace as namespace
@@ -153,81 +153,188 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
153
153
  ...
154
154
 
155
155
  @typing.overload
156
- 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]]]:
156
+ 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]]]:
157
157
  """
158
- Specifies the resources needed when executing this step.
158
+ Specifies secrets to be retrieved and injected as environment variables prior to
159
+ the execution of a step.
159
160
 
160
- Use `@resources` to specify the resource requirements
161
- independently of the specific compute layer (`@batch`, `@kubernetes`).
162
161
 
163
- You can choose the compute layer on the command line by executing e.g.
164
- ```
165
- python myflow.py run --with batch
166
- ```
167
- or
168
- ```
169
- python myflow.py run --with kubernetes
170
- ```
171
- which executes the flow on the desired system using the
172
- requirements specified in `@resources`.
162
+ Parameters
163
+ ----------
164
+ sources : List[Union[str, Dict[str, Any]]], default: []
165
+ List of secret specs, defining how the secrets are to be retrieved
166
+ role : str, optional, default: None
167
+ Role to use for fetching secrets
168
+ """
169
+ ...
170
+
171
+ @typing.overload
172
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
173
+ ...
174
+
175
+ @typing.overload
176
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
177
+ ...
178
+
179
+ 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):
180
+ """
181
+ Specifies secrets to be retrieved and injected as environment variables prior to
182
+ the execution of a step.
173
183
 
174
184
 
175
185
  Parameters
176
186
  ----------
177
- cpu : int, default 1
178
- Number of CPUs required for this step.
179
- gpu : int, optional, default None
180
- Number of GPUs required for this step.
181
- disk : int, optional, default None
182
- Disk size (in MB) required for this step. Only applies on Kubernetes.
183
- memory : int, default 4096
184
- Memory size (in MB) required for this step.
185
- shared_memory : int, optional, default None
186
- The value for the size (in MiB) of the /dev/shm volume for this step.
187
- This parameter maps to the `--shm-size` option in Docker.
187
+ sources : List[Union[str, Dict[str, Any]]], default: []
188
+ List of secret specs, defining how the secrets are to be retrieved
189
+ role : str, optional, default: None
190
+ Role to use for fetching secrets
188
191
  """
189
192
  ...
190
193
 
191
194
  @typing.overload
192
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
195
+ 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]]]:
196
+ """
197
+ Specifies the Conda environment for the step.
198
+
199
+ Information in this decorator will augment any
200
+ attributes set in the `@conda_base` flow-level decorator. Hence,
201
+ you can use `@conda_base` to set packages required by all
202
+ steps and use `@conda` to specify step-specific overrides.
203
+
204
+
205
+ Parameters
206
+ ----------
207
+ packages : Dict[str, str], default {}
208
+ Packages to use for this step. The key is the name of the package
209
+ and the value is the version to use.
210
+ libraries : Dict[str, str], default {}
211
+ Supported for backward compatibility. When used with packages, packages will take precedence.
212
+ python : str, optional, default None
213
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
214
+ that the version used will correspond to the version of the Python interpreter used to start the run.
215
+ disabled : bool, default False
216
+ If set to True, disables @conda.
217
+ """
193
218
  ...
194
219
 
195
220
  @typing.overload
196
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
221
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
197
222
  ...
198
223
 
199
- 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):
224
+ @typing.overload
225
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
226
+ ...
227
+
228
+ 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):
200
229
  """
201
- Specifies the resources needed when executing this step.
230
+ Specifies the Conda environment for the step.
202
231
 
203
- Use `@resources` to specify the resource requirements
204
- independently of the specific compute layer (`@batch`, `@kubernetes`).
232
+ Information in this decorator will augment any
233
+ attributes set in the `@conda_base` flow-level decorator. Hence,
234
+ you can use `@conda_base` to set packages required by all
235
+ steps and use `@conda` to specify step-specific overrides.
205
236
 
206
- You can choose the compute layer on the command line by executing e.g.
207
- ```
208
- python myflow.py run --with batch
209
- ```
210
- or
211
- ```
212
- python myflow.py run --with kubernetes
213
- ```
214
- which executes the flow on the desired system using the
215
- requirements specified in `@resources`.
237
+
238
+ Parameters
239
+ ----------
240
+ packages : Dict[str, str], default {}
241
+ Packages to use for this step. The key is the name of the package
242
+ and the value is the version to use.
243
+ libraries : Dict[str, str], default {}
244
+ Supported for backward compatibility. When used with packages, packages will take precedence.
245
+ python : str, optional, default None
246
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
247
+ that the version used will correspond to the version of the Python interpreter used to start the run.
248
+ disabled : bool, default False
249
+ If set to True, disables @conda.
250
+ """
251
+ ...
252
+
253
+ @typing.overload
254
+ def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
255
+ """
256
+ Specifies environment variables to be set prior to the execution of a step.
216
257
 
217
258
 
218
259
  Parameters
219
260
  ----------
220
- cpu : int, default 1
221
- Number of CPUs required for this step.
222
- gpu : int, optional, default None
223
- Number of GPUs required for this step.
224
- disk : int, optional, default None
225
- Disk size (in MB) required for this step. Only applies on Kubernetes.
226
- memory : int, default 4096
227
- Memory size (in MB) required for this step.
228
- shared_memory : int, optional, default None
229
- The value for the size (in MiB) of the /dev/shm volume for this step.
230
- This parameter maps to the `--shm-size` option in Docker.
261
+ vars : Dict[str, str], default {}
262
+ Dictionary of environment variables to set.
263
+ """
264
+ ...
265
+
266
+ @typing.overload
267
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
268
+ ...
269
+
270
+ @typing.overload
271
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
272
+ ...
273
+
274
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
275
+ """
276
+ Specifies environment variables to be set prior to the execution of a step.
277
+
278
+
279
+ Parameters
280
+ ----------
281
+ vars : Dict[str, str], default {}
282
+ Dictionary of environment variables to set.
283
+ """
284
+ ...
285
+
286
+ @typing.overload
287
+ 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]]]:
288
+ """
289
+ Specifies the number of times the task corresponding
290
+ to a step needs to be retried.
291
+
292
+ This decorator is useful for handling transient errors, such as networking issues.
293
+ If your task contains operations that can't be retried safely, e.g. database updates,
294
+ it is advisable to annotate it with `@retry(times=0)`.
295
+
296
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
297
+ decorator will execute a no-op task after all retries have been exhausted,
298
+ ensuring that the flow execution can continue.
299
+
300
+
301
+ Parameters
302
+ ----------
303
+ times : int, default 3
304
+ Number of times to retry this task.
305
+ minutes_between_retries : int, default 2
306
+ Number of minutes between retries.
307
+ """
308
+ ...
309
+
310
+ @typing.overload
311
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
312
+ ...
313
+
314
+ @typing.overload
315
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
316
+ ...
317
+
318
+ 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):
319
+ """
320
+ Specifies the number of times the task corresponding
321
+ to a step needs to be retried.
322
+
323
+ This decorator is useful for handling transient errors, such as networking issues.
324
+ If your task contains operations that can't be retried safely, e.g. database updates,
325
+ it is advisable to annotate it with `@retry(times=0)`.
326
+
327
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
328
+ decorator will execute a no-op task after all retries have been exhausted,
329
+ ensuring that the flow execution can continue.
330
+
331
+
332
+ Parameters
333
+ ----------
334
+ times : int, default 3
335
+ Number of times to retry this task.
336
+ minutes_between_retries : int, default 2
337
+ Number of minutes between retries.
231
338
  """
232
339
  ...
233
340
 
@@ -321,46 +428,165 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
321
428
  ...
322
429
 
323
430
  @typing.overload
324
- 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]]]:
431
+ 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]]]:
325
432
  """
326
- Specifies a timeout for your step.
327
-
328
- This decorator is useful if this step may hang indefinitely.
329
-
330
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
331
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
332
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
433
+ Specifies the PyPI packages for the step.
333
434
 
334
- Note that all the values specified in parameters are added together so if you specify
335
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
435
+ Information in this decorator will augment any
436
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
437
+ you can use `@pypi_base` to set packages required by all
438
+ steps and use `@pypi` to specify step-specific overrides.
336
439
 
337
440
 
338
441
  Parameters
339
442
  ----------
340
- seconds : int, default 0
341
- Number of seconds to wait prior to timing out.
342
- minutes : int, default 0
343
- Number of minutes to wait prior to timing out.
344
- hours : int, default 0
345
- Number of hours to wait prior to timing out.
443
+ packages : Dict[str, str], default: {}
444
+ Packages to use for this step. The key is the name of the package
445
+ and the value is the version to use.
446
+ python : str, optional, default: None
447
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
448
+ that the version used will correspond to the version of the Python interpreter used to start the run.
346
449
  """
347
450
  ...
348
451
 
349
452
  @typing.overload
350
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
453
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
351
454
  ...
352
455
 
353
456
  @typing.overload
354
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
457
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
355
458
  ...
356
459
 
357
- 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):
460
+ 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):
358
461
  """
359
- Specifies a timeout for your step.
360
-
361
- This decorator is useful if this step may hang indefinitely.
462
+ Specifies the PyPI packages for the step.
362
463
 
363
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
464
+ Information in this decorator will augment any
465
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
466
+ you can use `@pypi_base` to set packages required by all
467
+ steps and use `@pypi` to specify step-specific overrides.
468
+
469
+
470
+ Parameters
471
+ ----------
472
+ packages : Dict[str, str], default: {}
473
+ Packages to use for this step. The key is the name of the package
474
+ and the value is the version to use.
475
+ python : str, optional, default: None
476
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
477
+ that the version used will correspond to the version of the Python interpreter used to start the run.
478
+ """
479
+ ...
480
+
481
+ @typing.overload
482
+ def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
483
+ """
484
+ Creates a human-readable report, a Metaflow Card, after this step completes.
485
+
486
+ Note that you may add multiple `@card` decorators in a step with different parameters.
487
+
488
+
489
+ Parameters
490
+ ----------
491
+ type : str, default 'default'
492
+ Card type.
493
+ id : str, optional, default None
494
+ If multiple cards are present, use this id to identify this card.
495
+ options : Dict[str, Any], default {}
496
+ Options passed to the card. The contents depend on the card type.
497
+ timeout : int, default 45
498
+ Interrupt reporting if it takes more than this many seconds.
499
+ """
500
+ ...
501
+
502
+ @typing.overload
503
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
504
+ ...
505
+
506
+ @typing.overload
507
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
508
+ ...
509
+
510
+ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
511
+ """
512
+ Creates a human-readable report, a Metaflow Card, after this step completes.
513
+
514
+ Note that you may add multiple `@card` decorators in a step with different parameters.
515
+
516
+
517
+ Parameters
518
+ ----------
519
+ type : str, default 'default'
520
+ Card type.
521
+ id : str, optional, default None
522
+ If multiple cards are present, use this id to identify this card.
523
+ options : Dict[str, Any], default {}
524
+ Options passed to the card. The contents depend on the card type.
525
+ timeout : int, default 45
526
+ Interrupt reporting if it takes more than this many seconds.
527
+ """
528
+ ...
529
+
530
+ @typing.overload
531
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
532
+ """
533
+ Decorator prototype for all step decorators. This function gets specialized
534
+ and imported for all decorators types by _import_plugin_decorators().
535
+ """
536
+ ...
537
+
538
+ @typing.overload
539
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
540
+ ...
541
+
542
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
543
+ """
544
+ Decorator prototype for all step decorators. This function gets specialized
545
+ and imported for all decorators types by _import_plugin_decorators().
546
+ """
547
+ ...
548
+
549
+ @typing.overload
550
+ 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]]]:
551
+ """
552
+ Specifies a timeout for your step.
553
+
554
+ This decorator is useful if this step may hang indefinitely.
555
+
556
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
557
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
558
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
559
+
560
+ Note that all the values specified in parameters are added together so if you specify
561
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
562
+
563
+
564
+ Parameters
565
+ ----------
566
+ seconds : int, default 0
567
+ Number of seconds to wait prior to timing out.
568
+ minutes : int, default 0
569
+ Number of minutes to wait prior to timing out.
570
+ hours : int, default 0
571
+ Number of hours to wait prior to timing out.
572
+ """
573
+ ...
574
+
575
+ @typing.overload
576
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
577
+ ...
578
+
579
+ @typing.overload
580
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
581
+ ...
582
+
583
+ 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):
584
+ """
585
+ Specifies a timeout for your step.
586
+
587
+ This decorator is useful if this step may hang indefinitely.
588
+
589
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
364
590
  A timeout is considered to be an exception thrown by the step. It will cause the step to be
365
591
  retried if needed and the exception will be caught by the `@catch` decorator, if present.
366
592
 
@@ -379,6 +605,136 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
379
605
  """
380
606
  ...
381
607
 
608
+ @typing.overload
609
+ 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]]]:
610
+ """
611
+ Specifies the resources needed when executing this step.
612
+
613
+ Use `@resources` to specify the resource requirements
614
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
615
+
616
+ You can choose the compute layer on the command line by executing e.g.
617
+ ```
618
+ python myflow.py run --with batch
619
+ ```
620
+ or
621
+ ```
622
+ python myflow.py run --with kubernetes
623
+ ```
624
+ which executes the flow on the desired system using the
625
+ requirements specified in `@resources`.
626
+
627
+
628
+ Parameters
629
+ ----------
630
+ cpu : int, default 1
631
+ Number of CPUs required for this step.
632
+ gpu : int, optional, default None
633
+ Number of GPUs required for this step.
634
+ disk : int, optional, default None
635
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
636
+ memory : int, default 4096
637
+ Memory size (in MB) required for this step.
638
+ shared_memory : int, optional, default None
639
+ The value for the size (in MiB) of the /dev/shm volume for this step.
640
+ This parameter maps to the `--shm-size` option in Docker.
641
+ """
642
+ ...
643
+
644
+ @typing.overload
645
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
646
+ ...
647
+
648
+ @typing.overload
649
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
650
+ ...
651
+
652
+ 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):
653
+ """
654
+ Specifies the resources needed when executing this step.
655
+
656
+ Use `@resources` to specify the resource requirements
657
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
658
+
659
+ You can choose the compute layer on the command line by executing e.g.
660
+ ```
661
+ python myflow.py run --with batch
662
+ ```
663
+ or
664
+ ```
665
+ python myflow.py run --with kubernetes
666
+ ```
667
+ which executes the flow on the desired system using the
668
+ requirements specified in `@resources`.
669
+
670
+
671
+ Parameters
672
+ ----------
673
+ cpu : int, default 1
674
+ Number of CPUs required for this step.
675
+ gpu : int, optional, default None
676
+ Number of GPUs required for this step.
677
+ disk : int, optional, default None
678
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
679
+ memory : int, default 4096
680
+ Memory size (in MB) required for this step.
681
+ shared_memory : int, optional, default None
682
+ The value for the size (in MiB) of the /dev/shm volume for this step.
683
+ This parameter maps to the `--shm-size` option in Docker.
684
+ """
685
+ ...
686
+
687
+ @typing.overload
688
+ 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]]]:
689
+ """
690
+ Specifies that the step will success under all circumstances.
691
+
692
+ The decorator will create an optional artifact, specified by `var`, which
693
+ contains the exception raised. You can use it to detect the presence
694
+ of errors, indicating that all happy-path artifacts produced by the step
695
+ are missing.
696
+
697
+
698
+ Parameters
699
+ ----------
700
+ var : str, optional, default None
701
+ Name of the artifact in which to store the caught exception.
702
+ If not specified, the exception is not stored.
703
+ print_exception : bool, default True
704
+ Determines whether or not the exception is printed to
705
+ stdout when caught.
706
+ """
707
+ ...
708
+
709
+ @typing.overload
710
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
711
+ ...
712
+
713
+ @typing.overload
714
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
715
+ ...
716
+
717
+ 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):
718
+ """
719
+ Specifies that the step will success under all circumstances.
720
+
721
+ The decorator will create an optional artifact, specified by `var`, which
722
+ contains the exception raised. You can use it to detect the presence
723
+ of errors, indicating that all happy-path artifacts produced by the step
724
+ are missing.
725
+
726
+
727
+ Parameters
728
+ ----------
729
+ var : str, optional, default None
730
+ Name of the artifact in which to store the caught exception.
731
+ If not specified, the exception is not stored.
732
+ print_exception : bool, default True
733
+ Determines whether or not the exception is printed to
734
+ stdout when caught.
735
+ """
736
+ ...
737
+
382
738
  @typing.overload
383
739
  def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
384
740
  """
@@ -529,69 +885,18 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
529
885
  ...
530
886
 
531
887
  @typing.overload
532
- def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
533
- """
534
- Creates a human-readable report, a Metaflow Card, after this step completes.
535
-
536
- Note that you may add multiple `@card` decorators in a step with different parameters.
537
-
538
-
539
- Parameters
540
- ----------
541
- type : str, default 'default'
542
- Card type.
543
- id : str, optional, default None
544
- If multiple cards are present, use this id to identify this card.
545
- options : Dict[str, Any], default {}
546
- Options passed to the card. The contents depend on the card type.
547
- timeout : int, default 45
548
- Interrupt reporting if it takes more than this many seconds.
549
- """
550
- ...
551
-
552
- @typing.overload
553
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
554
- ...
555
-
556
- @typing.overload
557
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
558
- ...
559
-
560
- def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
561
- """
562
- Creates a human-readable report, a Metaflow Card, after this step completes.
563
-
564
- Note that you may add multiple `@card` decorators in a step with different parameters.
565
-
566
-
567
- Parameters
568
- ----------
569
- type : str, default 'default'
570
- Card type.
571
- id : str, optional, default None
572
- If multiple cards are present, use this id to identify this card.
573
- options : Dict[str, Any], default {}
574
- Options passed to the card. The contents depend on the card type.
575
- timeout : int, default 45
576
- Interrupt reporting if it takes more than this many seconds.
577
- """
578
- ...
579
-
580
- @typing.overload
581
- 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]]]:
888
+ 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]]:
582
889
  """
583
- Specifies the Conda environment for the step.
890
+ Specifies the Conda environment for all steps of the flow.
584
891
 
585
- Information in this decorator will augment any
586
- attributes set in the `@conda_base` flow-level decorator. Hence,
587
- you can use `@conda_base` to set packages required by all
588
- steps and use `@conda` to specify step-specific overrides.
892
+ Use `@conda_base` to set common libraries required by all
893
+ steps and use `@conda` to specify step-specific additions.
589
894
 
590
895
 
591
896
  Parameters
592
897
  ----------
593
898
  packages : Dict[str, str], default {}
594
- Packages to use for this step. The key is the name of the package
899
+ Packages to use for this flow. The key is the name of the package
595
900
  and the value is the version to use.
596
901
  libraries : Dict[str, str], default {}
597
902
  Supported for backward compatibility. When used with packages, packages will take precedence.
@@ -599,323 +904,34 @@ def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, s
599
904
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
600
905
  that the version used will correspond to the version of the Python interpreter used to start the run.
601
906
  disabled : bool, default False
602
- If set to True, disables @conda.
907
+ If set to True, disables Conda.
603
908
  """
604
909
  ...
605
910
 
606
911
  @typing.overload
607
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
608
- ...
609
-
610
- @typing.overload
611
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
912
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
612
913
  ...
613
914
 
614
- 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):
915
+ 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):
615
916
  """
616
- Specifies the Conda environment for the step.
917
+ Specifies the Conda environment for all steps of the flow.
617
918
 
618
- Information in this decorator will augment any
619
- attributes set in the `@conda_base` flow-level decorator. Hence,
620
- you can use `@conda_base` to set packages required by all
621
- steps and use `@conda` to specify step-specific overrides.
919
+ Use `@conda_base` to set common libraries required by all
920
+ steps and use `@conda` to specify step-specific additions.
622
921
 
623
922
 
624
923
  Parameters
625
924
  ----------
626
925
  packages : Dict[str, str], default {}
627
- Packages to use for this step. The key is the name of the package
926
+ Packages to use for this flow. The key is the name of the package
628
927
  and the value is the version to use.
629
928
  libraries : Dict[str, str], default {}
630
929
  Supported for backward compatibility. When used with packages, packages will take precedence.
631
930
  python : str, optional, default None
632
931
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
633
932
  that the version used will correspond to the version of the Python interpreter used to start the run.
634
- disabled : bool, default False
635
- If set to True, disables @conda.
636
- """
637
- ...
638
-
639
- @typing.overload
640
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
641
- """
642
- Decorator prototype for all step decorators. This function gets specialized
643
- and imported for all decorators types by _import_plugin_decorators().
644
- """
645
- ...
646
-
647
- @typing.overload
648
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
649
- ...
650
-
651
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
652
- """
653
- Decorator prototype for all step decorators. This function gets specialized
654
- and imported for all decorators types by _import_plugin_decorators().
655
- """
656
- ...
657
-
658
- @typing.overload
659
- 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]]]:
660
- """
661
- Specifies environment variables to be set prior to the execution of a step.
662
-
663
-
664
- Parameters
665
- ----------
666
- vars : Dict[str, str], default {}
667
- Dictionary of environment variables to set.
668
- """
669
- ...
670
-
671
- @typing.overload
672
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
673
- ...
674
-
675
- @typing.overload
676
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
677
- ...
678
-
679
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
680
- """
681
- Specifies environment variables to be set prior to the execution of a step.
682
-
683
-
684
- Parameters
685
- ----------
686
- vars : Dict[str, str], default {}
687
- Dictionary of environment variables to set.
688
- """
689
- ...
690
-
691
- @typing.overload
692
- 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]]]:
693
- """
694
- Specifies secrets to be retrieved and injected as environment variables prior to
695
- the execution of a step.
696
-
697
-
698
- Parameters
699
- ----------
700
- sources : List[Union[str, Dict[str, Any]]], default: []
701
- List of secret specs, defining how the secrets are to be retrieved
702
- role : str, optional, default: None
703
- Role to use for fetching secrets
704
- """
705
- ...
706
-
707
- @typing.overload
708
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
709
- ...
710
-
711
- @typing.overload
712
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
713
- ...
714
-
715
- 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):
716
- """
717
- Specifies secrets to be retrieved and injected as environment variables prior to
718
- the execution of a step.
719
-
720
-
721
- Parameters
722
- ----------
723
- sources : List[Union[str, Dict[str, Any]]], default: []
724
- List of secret specs, defining how the secrets are to be retrieved
725
- role : str, optional, default: None
726
- Role to use for fetching secrets
727
- """
728
- ...
729
-
730
- @typing.overload
731
- 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]]]:
732
- """
733
- Specifies the number of times the task corresponding
734
- to a step needs to be retried.
735
-
736
- This decorator is useful for handling transient errors, such as networking issues.
737
- If your task contains operations that can't be retried safely, e.g. database updates,
738
- it is advisable to annotate it with `@retry(times=0)`.
739
-
740
- This can be used in conjunction with the `@catch` decorator. The `@catch`
741
- decorator will execute a no-op task after all retries have been exhausted,
742
- ensuring that the flow execution can continue.
743
-
744
-
745
- Parameters
746
- ----------
747
- times : int, default 3
748
- Number of times to retry this task.
749
- minutes_between_retries : int, default 2
750
- Number of minutes between retries.
751
- """
752
- ...
753
-
754
- @typing.overload
755
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
756
- ...
757
-
758
- @typing.overload
759
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
760
- ...
761
-
762
- 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):
763
- """
764
- Specifies the number of times the task corresponding
765
- to a step needs to be retried.
766
-
767
- This decorator is useful for handling transient errors, such as networking issues.
768
- If your task contains operations that can't be retried safely, e.g. database updates,
769
- it is advisable to annotate it with `@retry(times=0)`.
770
-
771
- This can be used in conjunction with the `@catch` decorator. The `@catch`
772
- decorator will execute a no-op task after all retries have been exhausted,
773
- ensuring that the flow execution can continue.
774
-
775
-
776
- Parameters
777
- ----------
778
- times : int, default 3
779
- Number of times to retry this task.
780
- minutes_between_retries : int, default 2
781
- Number of minutes between retries.
782
- """
783
- ...
784
-
785
- @typing.overload
786
- 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]]]:
787
- """
788
- Specifies the PyPI packages for the step.
789
-
790
- Information in this decorator will augment any
791
- attributes set in the `@pyi_base` flow-level decorator. Hence,
792
- you can use `@pypi_base` to set packages required by all
793
- steps and use `@pypi` to specify step-specific overrides.
794
-
795
-
796
- Parameters
797
- ----------
798
- packages : Dict[str, str], default: {}
799
- Packages to use for this step. The key is the name of the package
800
- and the value is the version to use.
801
- python : str, optional, default: None
802
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
803
- that the version used will correspond to the version of the Python interpreter used to start the run.
804
- """
805
- ...
806
-
807
- @typing.overload
808
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
809
- ...
810
-
811
- @typing.overload
812
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
813
- ...
814
-
815
- 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):
816
- """
817
- Specifies the PyPI packages for the step.
818
-
819
- Information in this decorator will augment any
820
- attributes set in the `@pyi_base` flow-level decorator. Hence,
821
- you can use `@pypi_base` to set packages required by all
822
- steps and use `@pypi` to specify step-specific overrides.
823
-
824
-
825
- Parameters
826
- ----------
827
- packages : Dict[str, str], default: {}
828
- Packages to use for this step. The key is the name of the package
829
- and the value is the version to use.
830
- python : str, optional, default: None
831
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
832
- that the version used will correspond to the version of the Python interpreter used to start the run.
833
- """
834
- ...
835
-
836
- @typing.overload
837
- 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]]]:
838
- """
839
- Specifies that the step will success under all circumstances.
840
-
841
- The decorator will create an optional artifact, specified by `var`, which
842
- contains the exception raised. You can use it to detect the presence
843
- of errors, indicating that all happy-path artifacts produced by the step
844
- are missing.
845
-
846
-
847
- Parameters
848
- ----------
849
- var : str, optional, default None
850
- Name of the artifact in which to store the caught exception.
851
- If not specified, the exception is not stored.
852
- print_exception : bool, default True
853
- Determines whether or not the exception is printed to
854
- stdout when caught.
855
- """
856
- ...
857
-
858
- @typing.overload
859
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
860
- ...
861
-
862
- @typing.overload
863
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
864
- ...
865
-
866
- 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):
867
- """
868
- Specifies that the step will success under all circumstances.
869
-
870
- The decorator will create an optional artifact, specified by `var`, which
871
- contains the exception raised. You can use it to detect the presence
872
- of errors, indicating that all happy-path artifacts produced by the step
873
- are missing.
874
-
875
-
876
- Parameters
877
- ----------
878
- var : str, optional, default None
879
- Name of the artifact in which to store the caught exception.
880
- If not specified, the exception is not stored.
881
- print_exception : bool, default True
882
- Determines whether or not the exception is printed to
883
- stdout when caught.
884
- """
885
- ...
886
-
887
- def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
888
- """
889
- Specifies what flows belong to the same project.
890
-
891
- A project-specific namespace is created for all flows that
892
- use the same `@project(name)`.
893
-
894
-
895
- Parameters
896
- ----------
897
- name : str
898
- Project name. Make sure that the name is unique amongst all
899
- projects that use the same production scheduler. The name may
900
- contain only lowercase alphanumeric characters and underscores.
901
-
902
- branch : Optional[str], default None
903
- The branch to use. If not specified, the branch is set to
904
- `user.<username>` unless `production` is set to `True`. This can
905
- also be set on the command line using `--branch` as a top-level option.
906
- It is an error to specify `branch` in the decorator and on the command line.
907
-
908
- production : bool, default False
909
- Whether or not the branch is the production branch. This can also be set on the
910
- command line using `--production` as a top-level option. It is an error to specify
911
- `production` in the decorator and on the command line.
912
- The project branch name will be:
913
- - if `branch` is specified:
914
- - if `production` is True: `prod.<branch>`
915
- - if `production` is False: `test.<branch>`
916
- - if `branch` is not specified:
917
- - if `production` is True: `prod`
918
- - if `production` is False: `user.<username>`
933
+ disabled : bool, default False
934
+ If set to True, disables Conda.
919
935
  """
920
936
  ...
921
937
 
@@ -1020,6 +1036,84 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1020
1036
  """
1021
1037
  ...
1022
1038
 
1039
+ 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]]:
1040
+ """
1041
+ 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.
1042
+ 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.
1043
+
1044
+
1045
+ Parameters
1046
+ ----------
1047
+ timeout : int
1048
+ Time, in seconds before the task times out and fails. (Default: 3600)
1049
+ poke_interval : int
1050
+ Time in seconds that the job should wait in between each try. (Default: 60)
1051
+ mode : str
1052
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1053
+ exponential_backoff : bool
1054
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1055
+ pool : str
1056
+ the slot pool this task should run in,
1057
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1058
+ soft_fail : bool
1059
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1060
+ name : str
1061
+ Name of the sensor on Airflow
1062
+ description : str
1063
+ Description of sensor in the Airflow UI
1064
+ external_dag_id : str
1065
+ The dag_id that contains the task you want to wait for.
1066
+ external_task_ids : List[str]
1067
+ The list of task_ids that you want to wait for.
1068
+ If None (default value) the sensor waits for the DAG. (Default: None)
1069
+ allowed_states : List[str]
1070
+ Iterable of allowed states, (Default: ['success'])
1071
+ failed_states : List[str]
1072
+ Iterable of failed or dis-allowed states. (Default: None)
1073
+ execution_delta : datetime.timedelta
1074
+ time difference with the previous execution to look at,
1075
+ the default is the same logical date as the current task or DAG. (Default: None)
1076
+ check_existence: bool
1077
+ Set to True to check if the external task exists or check if
1078
+ the DAG to wait for exists. (Default: True)
1079
+ """
1080
+ ...
1081
+
1082
+ def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1083
+ """
1084
+ Specifies what flows belong to the same project.
1085
+
1086
+ A project-specific namespace is created for all flows that
1087
+ use the same `@project(name)`.
1088
+
1089
+
1090
+ Parameters
1091
+ ----------
1092
+ name : str
1093
+ Project name. Make sure that the name is unique amongst all
1094
+ projects that use the same production scheduler. The name may
1095
+ contain only lowercase alphanumeric characters and underscores.
1096
+
1097
+ branch : Optional[str], default None
1098
+ The branch to use. If not specified, the branch is set to
1099
+ `user.<username>` unless `production` is set to `True`. This can
1100
+ also be set on the command line using `--branch` as a top-level option.
1101
+ It is an error to specify `branch` in the decorator and on the command line.
1102
+
1103
+ production : bool, default False
1104
+ Whether or not the branch is the production branch. This can also be set on the
1105
+ command line using `--production` as a top-level option. It is an error to specify
1106
+ `production` in the decorator and on the command line.
1107
+ The project branch name will be:
1108
+ - if `branch` is specified:
1109
+ - if `production` is True: `prod.<branch>`
1110
+ - if `production` is False: `test.<branch>`
1111
+ - if `branch` is not specified:
1112
+ - if `production` is True: `prod`
1113
+ - if `production` is False: `user.<username>`
1114
+ """
1115
+ ...
1116
+
1023
1117
  @typing.overload
1024
1118
  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]]:
1025
1119
  """
@@ -1071,57 +1165,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1071
1165
  """
1072
1166
  ...
1073
1167
 
1074
- @typing.overload
1075
- 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]]:
1076
- """
1077
- Specifies the Conda environment for all steps of the flow.
1078
-
1079
- Use `@conda_base` to set common libraries required by all
1080
- steps and use `@conda` to specify step-specific additions.
1081
-
1082
-
1083
- Parameters
1084
- ----------
1085
- packages : Dict[str, str], default {}
1086
- Packages to use for this flow. The key is the name of the package
1087
- and the value is the version to use.
1088
- libraries : Dict[str, str], default {}
1089
- Supported for backward compatibility. When used with packages, packages will take precedence.
1090
- python : str, optional, default None
1091
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1092
- that the version used will correspond to the version of the Python interpreter used to start the run.
1093
- disabled : bool, default False
1094
- If set to True, disables Conda.
1095
- """
1096
- ...
1097
-
1098
- @typing.overload
1099
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1100
- ...
1101
-
1102
- 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):
1103
- """
1104
- Specifies the Conda environment for all steps of the flow.
1105
-
1106
- Use `@conda_base` to set common libraries required by all
1107
- steps and use `@conda` to specify step-specific additions.
1108
-
1109
-
1110
- Parameters
1111
- ----------
1112
- packages : Dict[str, str], default {}
1113
- Packages to use for this flow. The key is the name of the package
1114
- and the value is the version to use.
1115
- libraries : Dict[str, str], default {}
1116
- Supported for backward compatibility. When used with packages, packages will take precedence.
1117
- python : str, optional, default None
1118
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1119
- that the version used will correspond to the version of the Python interpreter used to start the run.
1120
- disabled : bool, default False
1121
- If set to True, disables Conda.
1122
- """
1123
- ...
1124
-
1125
1168
  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]]:
1126
1169
  """
1127
1170
  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)
@@ -1165,90 +1208,6 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1165
1208
  """
1166
1209
  ...
1167
1210
 
1168
- @typing.overload
1169
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1170
- """
1171
- Specifies the PyPI packages for all steps of the flow.
1172
-
1173
- Use `@pypi_base` to set common packages required by all
1174
- steps and use `@pypi` to specify step-specific overrides.
1175
-
1176
- Parameters
1177
- ----------
1178
- packages : Dict[str, str], default: {}
1179
- Packages to use for this flow. The key is the name of the package
1180
- and the value is the version to use.
1181
- python : str, optional, default: None
1182
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1183
- that the version used will correspond to the version of the Python interpreter used to start the run.
1184
- """
1185
- ...
1186
-
1187
- @typing.overload
1188
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1189
- ...
1190
-
1191
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1192
- """
1193
- Specifies the PyPI packages for all steps of the flow.
1194
-
1195
- Use `@pypi_base` to set common packages required by all
1196
- steps and use `@pypi` to specify step-specific overrides.
1197
-
1198
- Parameters
1199
- ----------
1200
- packages : Dict[str, str], default: {}
1201
- Packages to use for this flow. The key is the name of the package
1202
- and the value is the version to use.
1203
- python : str, optional, default: None
1204
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1205
- that the version used will correspond to the version of the Python interpreter used to start the run.
1206
- """
1207
- ...
1208
-
1209
- 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]]:
1210
- """
1211
- 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.
1212
- 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.
1213
-
1214
-
1215
- Parameters
1216
- ----------
1217
- timeout : int
1218
- Time, in seconds before the task times out and fails. (Default: 3600)
1219
- poke_interval : int
1220
- Time in seconds that the job should wait in between each try. (Default: 60)
1221
- mode : str
1222
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1223
- exponential_backoff : bool
1224
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1225
- pool : str
1226
- the slot pool this task should run in,
1227
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1228
- soft_fail : bool
1229
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1230
- name : str
1231
- Name of the sensor on Airflow
1232
- description : str
1233
- Description of sensor in the Airflow UI
1234
- external_dag_id : str
1235
- The dag_id that contains the task you want to wait for.
1236
- external_task_ids : List[str]
1237
- The list of task_ids that you want to wait for.
1238
- If None (default value) the sensor waits for the DAG. (Default: None)
1239
- allowed_states : List[str]
1240
- Iterable of allowed states, (Default: ['success'])
1241
- failed_states : List[str]
1242
- Iterable of failed or dis-allowed states. (Default: None)
1243
- execution_delta : datetime.timedelta
1244
- time difference with the previous execution to look at,
1245
- the default is the same logical date as the current task or DAG. (Default: None)
1246
- check_existence: bool
1247
- Set to True to check if the external task exists or check if
1248
- the DAG to wait for exists. (Default: True)
1249
- """
1250
- ...
1251
-
1252
1211
  @typing.overload
1253
1212
  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]]:
1254
1213
  """
@@ -1342,3 +1301,44 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1342
1301
  """
1343
1302
  ...
1344
1303
 
1304
+ @typing.overload
1305
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1306
+ """
1307
+ Specifies the PyPI packages for all steps of the flow.
1308
+
1309
+ Use `@pypi_base` to set common packages required by all
1310
+ steps and use `@pypi` to specify step-specific overrides.
1311
+
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.
1320
+ """
1321
+ ...
1322
+
1323
+ @typing.overload
1324
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1325
+ ...
1326
+
1327
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1328
+ """
1329
+ Specifies the PyPI packages for all steps of the flow.
1330
+
1331
+ Use `@pypi_base` to set common packages required by all
1332
+ steps and use `@pypi` to specify step-specific overrides.
1333
+
1334
+ Parameters
1335
+ ----------
1336
+ packages : Dict[str, str], default: {}
1337
+ Packages to use for this flow. The key is the name of the package
1338
+ and the value is the version to use.
1339
+ python : str, optional, default: None
1340
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1341
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1342
+ """
1343
+ ...
1344
+