metaflow-stubs 2.13.8__py2.py3-none-any.whl → 2.13.10__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.
- metaflow-stubs/__init__.pyi +746 -152
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +5 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +5 -5
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +17 -17
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +5 -5
- metaflow-stubs/plugins/__init__.pyi +11 -11
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +5 -5
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
- metaflow-stubs/plugins/aws/__init__.pyi +4 -4
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +5 -5
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_client.pyi +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +20 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +5 -5
- metaflow-stubs/runner/deployer_impl.pyi +3 -3
- metaflow-stubs/runner/metaflow_runner.pyi +5 -5
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +4 -4
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_decorators.pyi +5 -7
- metaflow-stubs/user_configs/config_options.pyi +4 -4
- metaflow-stubs/user_configs/config_parameters.pyi +6 -6
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.13.8.dist-info → metaflow_stubs-2.13.10.dist-info}/METADATA +2 -2
- metaflow_stubs-2.13.10.dist-info/RECORD +145 -0
- metaflow_stubs-2.13.8.dist-info/RECORD +0 -145
- {metaflow_stubs-2.13.8.dist-info → metaflow_stubs-2.13.10.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.13.8.dist-info → metaflow_stubs-2.13.10.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.13.
|
4
|
-
# Generated on 2025-
|
3
|
+
# MF version: 2.13.10 #
|
4
|
+
# Generated on 2025-02-11T14:38:33.693974 #
|
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
|
|
@@ -160,6 +160,21 @@ def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Op
|
|
160
160
|
```
|
161
161
|
which executes the flow on the desired system using the
|
162
162
|
requirements specified in `@resources`.
|
163
|
+
|
164
|
+
|
165
|
+
Parameters
|
166
|
+
----------
|
167
|
+
cpu : int, default 1
|
168
|
+
Number of CPUs required for this step.
|
169
|
+
gpu : int, optional, default None
|
170
|
+
Number of GPUs required for this step.
|
171
|
+
disk : int, optional, default None
|
172
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
173
|
+
memory : int, default 4096
|
174
|
+
Memory size (in MB) required for this step.
|
175
|
+
shared_memory : int, optional, default None
|
176
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
177
|
+
This parameter maps to the `--shm-size` option in Docker.
|
163
178
|
"""
|
164
179
|
...
|
165
180
|
|
@@ -188,14 +203,29 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
188
203
|
```
|
189
204
|
which executes the flow on the desired system using the
|
190
205
|
requirements specified in `@resources`.
|
206
|
+
|
207
|
+
|
208
|
+
Parameters
|
209
|
+
----------
|
210
|
+
cpu : int, default 1
|
211
|
+
Number of CPUs required for this step.
|
212
|
+
gpu : int, optional, default None
|
213
|
+
Number of GPUs required for this step.
|
214
|
+
disk : int, optional, default None
|
215
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
216
|
+
memory : int, default 4096
|
217
|
+
Memory size (in MB) required for this step.
|
218
|
+
shared_memory : int, optional, default None
|
219
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
220
|
+
This parameter maps to the `--shm-size` option in Docker.
|
191
221
|
"""
|
192
222
|
...
|
193
223
|
|
194
224
|
@typing.overload
|
195
225
|
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
196
226
|
"""
|
197
|
-
|
198
|
-
|
227
|
+
Parameters
|
228
|
+
----------
|
199
229
|
"""
|
200
230
|
...
|
201
231
|
|
@@ -205,29 +235,8 @@ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None])
|
|
205
235
|
|
206
236
|
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
207
237
|
"""
|
208
|
-
|
209
|
-
|
210
|
-
"""
|
211
|
-
...
|
212
|
-
|
213
|
-
@typing.overload
|
214
|
-
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]]]:
|
215
|
-
"""
|
216
|
-
Specifies environment variables to be set prior to the execution of a step.
|
217
|
-
"""
|
218
|
-
...
|
219
|
-
|
220
|
-
@typing.overload
|
221
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
222
|
-
...
|
223
|
-
|
224
|
-
@typing.overload
|
225
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
226
|
-
...
|
227
|
-
|
228
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
229
|
-
"""
|
230
|
-
Specifies environment variables to be set prior to the execution of a step.
|
238
|
+
Parameters
|
239
|
+
----------
|
231
240
|
"""
|
232
241
|
...
|
233
242
|
|
@@ -236,6 +245,12 @@ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.An
|
|
236
245
|
"""
|
237
246
|
Specifies secrets to be retrieved and injected as environment variables prior to
|
238
247
|
the execution of a step.
|
248
|
+
|
249
|
+
|
250
|
+
Parameters
|
251
|
+
----------
|
252
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
253
|
+
List of secret specs, defining how the secrets are to be retrieved
|
239
254
|
"""
|
240
255
|
...
|
241
256
|
|
@@ -251,58 +266,122 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
251
266
|
"""
|
252
267
|
Specifies secrets to be retrieved and injected as environment variables prior to
|
253
268
|
the execution of a step.
|
269
|
+
|
270
|
+
|
271
|
+
Parameters
|
272
|
+
----------
|
273
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
274
|
+
List of secret specs, defining how the secrets are to be retrieved
|
254
275
|
"""
|
255
276
|
...
|
256
277
|
|
257
278
|
@typing.overload
|
258
|
-
def
|
279
|
+
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]]]:
|
259
280
|
"""
|
260
|
-
|
281
|
+
Specifies a timeout for your step.
|
261
282
|
|
262
|
-
|
283
|
+
This decorator is useful if this step may hang indefinitely.
|
284
|
+
|
285
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
286
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
287
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
288
|
+
|
289
|
+
Note that all the values specified in parameters are added together so if you specify
|
290
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
291
|
+
|
292
|
+
|
293
|
+
Parameters
|
294
|
+
----------
|
295
|
+
seconds : int, default 0
|
296
|
+
Number of seconds to wait prior to timing out.
|
297
|
+
minutes : int, default 0
|
298
|
+
Number of minutes to wait prior to timing out.
|
299
|
+
hours : int, default 0
|
300
|
+
Number of hours to wait prior to timing out.
|
263
301
|
"""
|
264
302
|
...
|
265
303
|
|
266
304
|
@typing.overload
|
267
|
-
def
|
305
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
268
306
|
...
|
269
307
|
|
270
308
|
@typing.overload
|
271
|
-
def
|
309
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
272
310
|
...
|
273
311
|
|
274
|
-
def
|
312
|
+
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):
|
275
313
|
"""
|
276
|
-
|
314
|
+
Specifies a timeout for your step.
|
277
315
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
316
|
+
This decorator is useful if this step may hang indefinitely.
|
317
|
+
|
318
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
319
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
320
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
321
|
+
|
322
|
+
Note that all the values specified in parameters are added together so if you specify
|
323
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
324
|
+
|
325
|
+
|
326
|
+
Parameters
|
327
|
+
----------
|
328
|
+
seconds : int, default 0
|
329
|
+
Number of seconds to wait prior to timing out.
|
330
|
+
minutes : int, default 0
|
331
|
+
Number of minutes to wait prior to timing out.
|
332
|
+
hours : int, default 0
|
333
|
+
Number of hours to wait prior to timing out.
|
285
334
|
"""
|
286
335
|
...
|
287
336
|
|
288
337
|
@typing.overload
|
289
|
-
def
|
338
|
+
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]]]:
|
290
339
|
"""
|
291
|
-
Specifies
|
340
|
+
Specifies the PyPI packages for the step.
|
341
|
+
|
342
|
+
Information in this decorator will augment any
|
343
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
344
|
+
you can use `@pypi_base` to set packages required by all
|
345
|
+
steps and use `@pypi` to specify step-specific overrides.
|
346
|
+
|
347
|
+
|
348
|
+
Parameters
|
349
|
+
----------
|
350
|
+
packages : Dict[str, str], default: {}
|
351
|
+
Packages to use for this step. The key is the name of the package
|
352
|
+
and the value is the version to use.
|
353
|
+
python : str, optional, default: None
|
354
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
355
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
292
356
|
"""
|
293
357
|
...
|
294
358
|
|
295
359
|
@typing.overload
|
296
|
-
def
|
360
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
297
361
|
...
|
298
362
|
|
299
363
|
@typing.overload
|
300
|
-
def
|
364
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
301
365
|
...
|
302
366
|
|
303
|
-
def
|
367
|
+
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):
|
304
368
|
"""
|
305
|
-
Specifies
|
369
|
+
Specifies the PyPI packages for the step.
|
370
|
+
|
371
|
+
Information in this decorator will augment any
|
372
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
373
|
+
you can use `@pypi_base` to set packages required by all
|
374
|
+
steps and use `@pypi` to specify step-specific overrides.
|
375
|
+
|
376
|
+
|
377
|
+
Parameters
|
378
|
+
----------
|
379
|
+
packages : Dict[str, str], default: {}
|
380
|
+
Packages to use for this step. The key is the name of the package
|
381
|
+
and the value is the version to use.
|
382
|
+
python : str, optional, default: None
|
383
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
384
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
306
385
|
"""
|
307
386
|
...
|
308
387
|
|
@@ -315,6 +394,16 @@ def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) ->
|
|
315
394
|
contains the exception raised. You can use it to detect the presence
|
316
395
|
of errors, indicating that all happy-path artifacts produced by the step
|
317
396
|
are missing.
|
397
|
+
|
398
|
+
|
399
|
+
Parameters
|
400
|
+
----------
|
401
|
+
var : str, optional, default None
|
402
|
+
Name of the artifact in which to store the caught exception.
|
403
|
+
If not specified, the exception is not stored.
|
404
|
+
print_exception : bool, default True
|
405
|
+
Determines whether or not the exception is printed to
|
406
|
+
stdout when caught.
|
318
407
|
"""
|
319
408
|
...
|
320
409
|
|
@@ -334,37 +423,247 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
334
423
|
contains the exception raised. You can use it to detect the presence
|
335
424
|
of errors, indicating that all happy-path artifacts produced by the step
|
336
425
|
are missing.
|
426
|
+
|
427
|
+
|
428
|
+
Parameters
|
429
|
+
----------
|
430
|
+
var : str, optional, default None
|
431
|
+
Name of the artifact in which to store the caught exception.
|
432
|
+
If not specified, the exception is not stored.
|
433
|
+
print_exception : bool, default True
|
434
|
+
Determines whether or not the exception is printed to
|
435
|
+
stdout when caught.
|
337
436
|
"""
|
338
437
|
...
|
339
438
|
|
340
439
|
@typing.overload
|
341
|
-
def
|
440
|
+
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]]]:
|
342
441
|
"""
|
343
|
-
|
442
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
344
443
|
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
444
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
445
|
+
|
446
|
+
|
447
|
+
Parameters
|
448
|
+
----------
|
449
|
+
type : str, default 'default'
|
450
|
+
Card type.
|
451
|
+
id : str, optional, default None
|
452
|
+
If multiple cards are present, use this id to identify this card.
|
453
|
+
options : Dict[str, Any], default {}
|
454
|
+
Options passed to the card. The contents depend on the card type.
|
455
|
+
timeout : int, default 45
|
456
|
+
Interrupt reporting if it takes more than this many seconds.
|
349
457
|
"""
|
350
458
|
...
|
351
459
|
|
352
460
|
@typing.overload
|
353
|
-
def
|
461
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
354
462
|
...
|
355
463
|
|
356
464
|
@typing.overload
|
357
|
-
def
|
465
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
358
466
|
...
|
359
467
|
|
360
|
-
def
|
468
|
+
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):
|
361
469
|
"""
|
362
|
-
|
470
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
363
471
|
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
472
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
473
|
+
|
474
|
+
|
475
|
+
Parameters
|
476
|
+
----------
|
477
|
+
type : str, default 'default'
|
478
|
+
Card type.
|
479
|
+
id : str, optional, default None
|
480
|
+
If multiple cards are present, use this id to identify this card.
|
481
|
+
options : Dict[str, Any], default {}
|
482
|
+
Options passed to the card. The contents depend on the card type.
|
483
|
+
timeout : int, default 45
|
484
|
+
Interrupt reporting if it takes more than this many seconds.
|
485
|
+
"""
|
486
|
+
...
|
487
|
+
|
488
|
+
@typing.overload
|
489
|
+
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]]]:
|
490
|
+
"""
|
491
|
+
Specifies environment variables to be set prior to the execution of a step.
|
492
|
+
|
493
|
+
|
494
|
+
Parameters
|
495
|
+
----------
|
496
|
+
vars : Dict[str, str], default {}
|
497
|
+
Dictionary of environment variables to set.
|
498
|
+
"""
|
499
|
+
...
|
500
|
+
|
501
|
+
@typing.overload
|
502
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
503
|
+
...
|
504
|
+
|
505
|
+
@typing.overload
|
506
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
507
|
+
...
|
508
|
+
|
509
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
510
|
+
"""
|
511
|
+
Specifies environment variables to be set prior to the execution of a step.
|
512
|
+
|
513
|
+
|
514
|
+
Parameters
|
515
|
+
----------
|
516
|
+
vars : Dict[str, str], default {}
|
517
|
+
Dictionary of environment variables to set.
|
518
|
+
"""
|
519
|
+
...
|
520
|
+
|
521
|
+
@typing.overload
|
522
|
+
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]]]:
|
523
|
+
"""
|
524
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
525
|
+
|
526
|
+
|
527
|
+
Parameters
|
528
|
+
----------
|
529
|
+
cpu : int, default 1
|
530
|
+
Number of CPUs required for this step. If `@resources` is
|
531
|
+
also present, the maximum value from all decorators is used.
|
532
|
+
gpu : int, default 0
|
533
|
+
Number of GPUs required for this step. If `@resources` is
|
534
|
+
also present, the maximum value from all decorators is used.
|
535
|
+
memory : int, default 4096
|
536
|
+
Memory size (in MB) required for this step. If
|
537
|
+
`@resources` is also present, the maximum value from all decorators is
|
538
|
+
used.
|
539
|
+
image : str, optional, default None
|
540
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
541
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
542
|
+
not, a default Docker image mapping to the current version of Python is used.
|
543
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
544
|
+
AWS Batch Job Queue to submit the job to.
|
545
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
546
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
547
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
548
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
549
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
550
|
+
shared_memory : int, optional, default None
|
551
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
552
|
+
This parameter maps to the `--shm-size` option in Docker.
|
553
|
+
max_swap : int, optional, default None
|
554
|
+
The total amount of swap memory (in MiB) a container can use for this
|
555
|
+
step. This parameter is translated to the `--memory-swap` option in
|
556
|
+
Docker where the value is the sum of the container memory plus the
|
557
|
+
`max_swap` value.
|
558
|
+
swappiness : int, optional, default None
|
559
|
+
This allows you to tune memory swappiness behavior for this step.
|
560
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
561
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
562
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
563
|
+
use_tmpfs : bool, default False
|
564
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
565
|
+
not available on Fargate compute environments
|
566
|
+
tmpfs_tempdir : bool, default True
|
567
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
568
|
+
tmpfs_size : int, optional, default None
|
569
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
570
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
571
|
+
memory allocated for this step.
|
572
|
+
tmpfs_path : str, optional, default None
|
573
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
574
|
+
inferentia : int, default 0
|
575
|
+
Number of Inferentia chips required for this step.
|
576
|
+
trainium : int, default None
|
577
|
+
Alias for inferentia. Use only one of the two.
|
578
|
+
efa : int, default 0
|
579
|
+
Number of elastic fabric adapter network devices to attach to container
|
580
|
+
ephemeral_storage : int, default None
|
581
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
582
|
+
This is only relevant for Fargate compute environments
|
583
|
+
log_driver: str, optional, default None
|
584
|
+
The log driver to use for the Amazon ECS container.
|
585
|
+
log_options: List[str], optional, default None
|
586
|
+
List of strings containing options for the chosen log driver. The configurable values
|
587
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
588
|
+
Example: [`awslogs-group:aws/batch/job`]
|
589
|
+
"""
|
590
|
+
...
|
591
|
+
|
592
|
+
@typing.overload
|
593
|
+
def batch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
594
|
+
...
|
595
|
+
|
596
|
+
@typing.overload
|
597
|
+
def batch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
598
|
+
...
|
599
|
+
|
600
|
+
def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = 'METAFLOW_BATCH_JOB_QUEUE', iam_role: str = 'METAFLOW_ECS_S3_ACCESS_IAM_ROLE', execution_role: str = 'METAFLOW_ECS_FARGATE_EXECUTION_ROLE', shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None):
|
601
|
+
"""
|
602
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
603
|
+
|
604
|
+
|
605
|
+
Parameters
|
606
|
+
----------
|
607
|
+
cpu : int, default 1
|
608
|
+
Number of CPUs required for this step. If `@resources` is
|
609
|
+
also present, the maximum value from all decorators is used.
|
610
|
+
gpu : int, default 0
|
611
|
+
Number of GPUs required for this step. If `@resources` is
|
612
|
+
also present, the maximum value from all decorators is used.
|
613
|
+
memory : int, default 4096
|
614
|
+
Memory size (in MB) required for this step. If
|
615
|
+
`@resources` is also present, the maximum value from all decorators is
|
616
|
+
used.
|
617
|
+
image : str, optional, default None
|
618
|
+
Docker image to use when launching on AWS Batch. If not specified, and
|
619
|
+
METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
|
620
|
+
not, a default Docker image mapping to the current version of Python is used.
|
621
|
+
queue : str, default METAFLOW_BATCH_JOB_QUEUE
|
622
|
+
AWS Batch Job Queue to submit the job to.
|
623
|
+
iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
|
624
|
+
AWS IAM role that AWS Batch container uses to access AWS cloud resources.
|
625
|
+
execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
|
626
|
+
AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
|
627
|
+
(https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
|
628
|
+
shared_memory : int, optional, default None
|
629
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
630
|
+
This parameter maps to the `--shm-size` option in Docker.
|
631
|
+
max_swap : int, optional, default None
|
632
|
+
The total amount of swap memory (in MiB) a container can use for this
|
633
|
+
step. This parameter is translated to the `--memory-swap` option in
|
634
|
+
Docker where the value is the sum of the container memory plus the
|
635
|
+
`max_swap` value.
|
636
|
+
swappiness : int, optional, default None
|
637
|
+
This allows you to tune memory swappiness behavior for this step.
|
638
|
+
A swappiness value of 0 causes swapping not to happen unless absolutely
|
639
|
+
necessary. A swappiness value of 100 causes pages to be swapped very
|
640
|
+
aggressively. Accepted values are whole numbers between 0 and 100.
|
641
|
+
use_tmpfs : bool, default False
|
642
|
+
This enables an explicit tmpfs mount for this step. Note that tmpfs is
|
643
|
+
not available on Fargate compute environments
|
644
|
+
tmpfs_tempdir : bool, default True
|
645
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
646
|
+
tmpfs_size : int, optional, default None
|
647
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
648
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
649
|
+
memory allocated for this step.
|
650
|
+
tmpfs_path : str, optional, default None
|
651
|
+
Path to tmpfs mount for this step. Defaults to /metaflow_temp.
|
652
|
+
inferentia : int, default 0
|
653
|
+
Number of Inferentia chips required for this step.
|
654
|
+
trainium : int, default None
|
655
|
+
Alias for inferentia. Use only one of the two.
|
656
|
+
efa : int, default 0
|
657
|
+
Number of elastic fabric adapter network devices to attach to container
|
658
|
+
ephemeral_storage : int, default None
|
659
|
+
The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
|
660
|
+
This is only relevant for Fargate compute environments
|
661
|
+
log_driver: str, optional, default None
|
662
|
+
The log driver to use for the Amazon ECS container.
|
663
|
+
log_options: List[str], optional, default None
|
664
|
+
List of strings containing options for the chosen log driver. The configurable values
|
665
|
+
depend on the `log driver` chosen. Validation of these options is not supported yet.
|
666
|
+
Example: [`awslogs-group:aws/batch/job`]
|
368
667
|
"""
|
369
668
|
...
|
370
669
|
|
@@ -381,6 +680,14 @@ def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callabl
|
|
381
680
|
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
382
681
|
decorator will execute a no-op task after all retries have been exhausted,
|
383
682
|
ensuring that the flow execution can continue.
|
683
|
+
|
684
|
+
|
685
|
+
Parameters
|
686
|
+
----------
|
687
|
+
times : int, default 3
|
688
|
+
Number of times to retry this task.
|
689
|
+
minutes_between_retries : int, default 2
|
690
|
+
Number of minutes between retries.
|
384
691
|
"""
|
385
692
|
...
|
386
693
|
|
@@ -404,76 +711,279 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
404
711
|
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
405
712
|
decorator will execute a no-op task after all retries have been exhausted,
|
406
713
|
ensuring that the flow execution can continue.
|
714
|
+
|
715
|
+
|
716
|
+
Parameters
|
717
|
+
----------
|
718
|
+
times : int, default 3
|
719
|
+
Number of times to retry this task.
|
720
|
+
minutes_between_retries : int, default 2
|
721
|
+
Number of minutes between retries.
|
407
722
|
"""
|
408
723
|
...
|
409
724
|
|
410
725
|
@typing.overload
|
411
|
-
def
|
726
|
+
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]]]:
|
412
727
|
"""
|
413
|
-
Specifies
|
728
|
+
Specifies the Conda environment for the step.
|
414
729
|
|
415
|
-
|
730
|
+
Information in this decorator will augment any
|
731
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
732
|
+
you can use `@conda_base` to set packages required by all
|
733
|
+
steps and use `@conda` to specify step-specific overrides.
|
416
734
|
|
417
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
418
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
419
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
420
735
|
|
421
|
-
|
422
|
-
|
736
|
+
Parameters
|
737
|
+
----------
|
738
|
+
packages : Dict[str, str], default {}
|
739
|
+
Packages to use for this step. The key is the name of the package
|
740
|
+
and the value is the version to use.
|
741
|
+
libraries : Dict[str, str], default {}
|
742
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
743
|
+
python : str, optional, default None
|
744
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
745
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
746
|
+
disabled : bool, default False
|
747
|
+
If set to True, disables @conda.
|
423
748
|
"""
|
424
749
|
...
|
425
750
|
|
426
751
|
@typing.overload
|
427
|
-
def
|
752
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
428
753
|
...
|
429
754
|
|
430
755
|
@typing.overload
|
431
|
-
def
|
756
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
432
757
|
...
|
433
758
|
|
434
|
-
def
|
759
|
+
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):
|
435
760
|
"""
|
436
|
-
Specifies
|
761
|
+
Specifies the Conda environment for the step.
|
437
762
|
|
438
|
-
|
763
|
+
Information in this decorator will augment any
|
764
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
765
|
+
you can use `@conda_base` to set packages required by all
|
766
|
+
steps and use `@conda` to specify step-specific overrides.
|
439
767
|
|
440
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
441
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
442
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
443
768
|
|
444
|
-
|
445
|
-
|
769
|
+
Parameters
|
770
|
+
----------
|
771
|
+
packages : Dict[str, str], default {}
|
772
|
+
Packages to use for this step. The key is the name of the package
|
773
|
+
and the value is the version to use.
|
774
|
+
libraries : Dict[str, str], default {}
|
775
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
776
|
+
python : str, optional, default None
|
777
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
778
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
779
|
+
disabled : bool, default False
|
780
|
+
If set to True, disables @conda.
|
446
781
|
"""
|
447
782
|
...
|
448
783
|
|
449
|
-
|
450
|
-
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]]]:
|
784
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable') -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
451
785
|
"""
|
452
|
-
Specifies
|
786
|
+
Specifies that this step should execute on Kubernetes.
|
453
787
|
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
788
|
+
|
789
|
+
Parameters
|
790
|
+
----------
|
791
|
+
cpu : int, default 1
|
792
|
+
Number of CPUs required for this step. If `@resources` is
|
793
|
+
also present, the maximum value from all decorators is used.
|
794
|
+
memory : int, default 4096
|
795
|
+
Memory size (in MB) required for this step. If
|
796
|
+
`@resources` is also present, the maximum value from all decorators is
|
797
|
+
used.
|
798
|
+
disk : int, default 10240
|
799
|
+
Disk size (in MB) required for this step. If
|
800
|
+
`@resources` is also present, the maximum value from all decorators is
|
801
|
+
used.
|
802
|
+
image : str, optional, default None
|
803
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
804
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
805
|
+
not, a default Docker image mapping to the current version of Python is used.
|
806
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
807
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
808
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
809
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
810
|
+
secrets : List[str], optional, default None
|
811
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
812
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
813
|
+
in Metaflow configuration.
|
814
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
815
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
816
|
+
Can be passed in as a comma separated string of values e.g.
|
817
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
818
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
819
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
820
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
821
|
+
gpu : int, optional, default None
|
822
|
+
Number of GPUs required for this step. A value of zero implies that
|
823
|
+
the scheduled node should not have GPUs.
|
824
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
825
|
+
The vendor of the GPUs to be used for this step.
|
826
|
+
tolerations : List[str], default []
|
827
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
828
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
829
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
830
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
831
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
832
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
833
|
+
use_tmpfs : bool, default False
|
834
|
+
This enables an explicit tmpfs mount for this step.
|
835
|
+
tmpfs_tempdir : bool, default True
|
836
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
837
|
+
tmpfs_size : int, optional, default: None
|
838
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
839
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
840
|
+
memory allocated for this step.
|
841
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
842
|
+
Path to tmpfs mount for this step.
|
843
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
844
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
845
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
846
|
+
shared_memory: int, optional
|
847
|
+
Shared memory size (in MiB) required for this step
|
848
|
+
port: int, optional
|
849
|
+
Port number to specify in the Kubernetes job object
|
850
|
+
compute_pool : str, optional, default None
|
851
|
+
Compute pool to be used for for this step.
|
852
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
853
|
+
hostname_resolution_timeout: int, default 10 * 60
|
854
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
855
|
+
Only applicable when @parallel is used.
|
856
|
+
qos: str, default: Burstable
|
857
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
858
|
+
"""
|
859
|
+
...
|
860
|
+
|
861
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
862
|
+
"""
|
863
|
+
Specifies what flows belong to the same project.
|
864
|
+
|
865
|
+
A project-specific namespace is created for all flows that
|
866
|
+
use the same `@project(name)`.
|
867
|
+
|
868
|
+
|
869
|
+
Parameters
|
870
|
+
----------
|
871
|
+
name : str
|
872
|
+
Project name. Make sure that the name is unique amongst all
|
873
|
+
projects that use the same production scheduler. The name may
|
874
|
+
contain only lowercase alphanumeric characters and underscores.
|
875
|
+
|
876
|
+
branch : Optional[str], default None
|
877
|
+
The branch to use. If not specified, the branch is set to
|
878
|
+
`user.<username>` unless `production` is set to `True`. This can
|
879
|
+
also be set on the command line using `--branch` as a top-level option.
|
880
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
881
|
+
|
882
|
+
production : bool, default False
|
883
|
+
Whether or not the branch is the production branch. This can also be set on the
|
884
|
+
command line using `--production` as a top-level option. It is an error to specify
|
885
|
+
`production` in the decorator and on the command line.
|
886
|
+
The project branch name will be:
|
887
|
+
- if `branch` is specified:
|
888
|
+
- if `production` is True: `prod.<branch>`
|
889
|
+
- if `production` is False: `test.<branch>`
|
890
|
+
- if `branch` is not specified:
|
891
|
+
- if `production` is True: `prod`
|
892
|
+
- if `production` is False: `user.<username>`
|
893
|
+
"""
|
894
|
+
...
|
895
|
+
|
896
|
+
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]]:
|
897
|
+
"""
|
898
|
+
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.
|
899
|
+
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.
|
900
|
+
|
901
|
+
|
902
|
+
Parameters
|
903
|
+
----------
|
904
|
+
timeout : int
|
905
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
906
|
+
poke_interval : int
|
907
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
908
|
+
mode : str
|
909
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
910
|
+
exponential_backoff : bool
|
911
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
912
|
+
pool : str
|
913
|
+
the slot pool this task should run in,
|
914
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
915
|
+
soft_fail : bool
|
916
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
917
|
+
name : str
|
918
|
+
Name of the sensor on Airflow
|
919
|
+
description : str
|
920
|
+
Description of sensor in the Airflow UI
|
921
|
+
external_dag_id : str
|
922
|
+
The dag_id that contains the task you want to wait for.
|
923
|
+
external_task_ids : List[str]
|
924
|
+
The list of task_ids that you want to wait for.
|
925
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
926
|
+
allowed_states : List[str]
|
927
|
+
Iterable of allowed states, (Default: ['success'])
|
928
|
+
failed_states : List[str]
|
929
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
930
|
+
execution_delta : datetime.timedelta
|
931
|
+
time difference with the previous execution to look at,
|
932
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
933
|
+
check_existence: bool
|
934
|
+
Set to True to check if the external task exists or check if
|
935
|
+
the DAG to wait for exists. (Default: True)
|
458
936
|
"""
|
459
937
|
...
|
460
938
|
|
461
939
|
@typing.overload
|
462
|
-
def
|
940
|
+
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]]:
|
941
|
+
"""
|
942
|
+
Specifies the Conda environment for all steps of the flow.
|
943
|
+
|
944
|
+
Use `@conda_base` to set common libraries required by all
|
945
|
+
steps and use `@conda` to specify step-specific additions.
|
946
|
+
|
947
|
+
|
948
|
+
Parameters
|
949
|
+
----------
|
950
|
+
packages : Dict[str, str], default {}
|
951
|
+
Packages to use for this flow. The key is the name of the package
|
952
|
+
and the value is the version to use.
|
953
|
+
libraries : Dict[str, str], default {}
|
954
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
955
|
+
python : str, optional, default None
|
956
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
957
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
958
|
+
disabled : bool, default False
|
959
|
+
If set to True, disables Conda.
|
960
|
+
"""
|
463
961
|
...
|
464
962
|
|
465
963
|
@typing.overload
|
466
|
-
def
|
964
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
467
965
|
...
|
468
966
|
|
469
|
-
def
|
967
|
+
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):
|
470
968
|
"""
|
471
|
-
Specifies the Conda environment for the
|
969
|
+
Specifies the Conda environment for all steps of the flow.
|
472
970
|
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
971
|
+
Use `@conda_base` to set common libraries required by all
|
972
|
+
steps and use `@conda` to specify step-specific additions.
|
973
|
+
|
974
|
+
|
975
|
+
Parameters
|
976
|
+
----------
|
977
|
+
packages : Dict[str, str], default {}
|
978
|
+
Packages to use for this flow. The key is the name of the package
|
979
|
+
and the value is the version to use.
|
980
|
+
libraries : Dict[str, str], default {}
|
981
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
982
|
+
python : str, optional, default None
|
983
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
984
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
985
|
+
disabled : bool, default False
|
986
|
+
If set to True, disables Conda.
|
477
987
|
"""
|
478
988
|
...
|
479
989
|
|
@@ -513,6 +1023,16 @@ def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] =
|
|
513
1023
|
- `user.bob`
|
514
1024
|
- `test.my_experiment`
|
515
1025
|
- `prod.staging`
|
1026
|
+
|
1027
|
+
|
1028
|
+
Parameters
|
1029
|
+
----------
|
1030
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1031
|
+
Upstream flow dependency for this flow.
|
1032
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1033
|
+
Upstream flow dependencies for this flow.
|
1034
|
+
options : Dict[str, Any], default {}
|
1035
|
+
Backend-specific configuration for tuning eventing behavior.
|
516
1036
|
"""
|
517
1037
|
...
|
518
1038
|
|
@@ -555,6 +1075,67 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
555
1075
|
- `user.bob`
|
556
1076
|
- `test.my_experiment`
|
557
1077
|
- `prod.staging`
|
1078
|
+
|
1079
|
+
|
1080
|
+
Parameters
|
1081
|
+
----------
|
1082
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1083
|
+
Upstream flow dependency for this flow.
|
1084
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1085
|
+
Upstream flow dependencies for this flow.
|
1086
|
+
options : Dict[str, Any], default {}
|
1087
|
+
Backend-specific configuration for tuning eventing behavior.
|
1088
|
+
"""
|
1089
|
+
...
|
1090
|
+
|
1091
|
+
@typing.overload
|
1092
|
+
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]]:
|
1093
|
+
"""
|
1094
|
+
Specifies the times when the flow should be run when running on a
|
1095
|
+
production scheduler.
|
1096
|
+
|
1097
|
+
|
1098
|
+
Parameters
|
1099
|
+
----------
|
1100
|
+
hourly : bool, default False
|
1101
|
+
Run the workflow hourly.
|
1102
|
+
daily : bool, default True
|
1103
|
+
Run the workflow daily.
|
1104
|
+
weekly : bool, default False
|
1105
|
+
Run the workflow weekly.
|
1106
|
+
cron : str, optional, default None
|
1107
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1108
|
+
specified by this expression.
|
1109
|
+
timezone : str, optional, default None
|
1110
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1111
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1112
|
+
"""
|
1113
|
+
...
|
1114
|
+
|
1115
|
+
@typing.overload
|
1116
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1117
|
+
...
|
1118
|
+
|
1119
|
+
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):
|
1120
|
+
"""
|
1121
|
+
Specifies the times when the flow should be run when running on a
|
1122
|
+
production scheduler.
|
1123
|
+
|
1124
|
+
|
1125
|
+
Parameters
|
1126
|
+
----------
|
1127
|
+
hourly : bool, default False
|
1128
|
+
Run the workflow hourly.
|
1129
|
+
daily : bool, default True
|
1130
|
+
Run the workflow daily.
|
1131
|
+
weekly : bool, default False
|
1132
|
+
Run the workflow weekly.
|
1133
|
+
cron : str, optional, default None
|
1134
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1135
|
+
specified by this expression.
|
1136
|
+
timezone : str, optional, default None
|
1137
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1138
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
558
1139
|
"""
|
559
1140
|
...
|
560
1141
|
|
@@ -590,6 +1171,16 @@ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = No
|
|
590
1171
|
```
|
591
1172
|
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
592
1173
|
```
|
1174
|
+
|
1175
|
+
|
1176
|
+
Parameters
|
1177
|
+
----------
|
1178
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1179
|
+
Event dependency for this flow.
|
1180
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1181
|
+
Events dependency for this flow.
|
1182
|
+
options : Dict[str, Any], default {}
|
1183
|
+
Backend-specific configuration for tuning eventing behavior.
|
593
1184
|
"""
|
594
1185
|
...
|
595
1186
|
|
@@ -628,25 +1219,16 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
628
1219
|
```
|
629
1220
|
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
630
1221
|
```
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
@typing.overload
|
643
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
644
|
-
...
|
645
|
-
|
646
|
-
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):
|
647
|
-
"""
|
648
|
-
Specifies the times when the flow should be run when running on a
|
649
|
-
production scheduler.
|
1222
|
+
|
1223
|
+
|
1224
|
+
Parameters
|
1225
|
+
----------
|
1226
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1227
|
+
Event dependency for this flow.
|
1228
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1229
|
+
Events dependency for this flow.
|
1230
|
+
options : Dict[str, Any], default {}
|
1231
|
+
Backend-specific configuration for tuning eventing behavior.
|
650
1232
|
"""
|
651
1233
|
...
|
652
1234
|
|
@@ -657,6 +1239,39 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
657
1239
|
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
658
1240
|
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
659
1241
|
starts only after all sensors finish.
|
1242
|
+
|
1243
|
+
|
1244
|
+
Parameters
|
1245
|
+
----------
|
1246
|
+
timeout : int
|
1247
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1248
|
+
poke_interval : int
|
1249
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1250
|
+
mode : str
|
1251
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1252
|
+
exponential_backoff : bool
|
1253
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1254
|
+
pool : str
|
1255
|
+
the slot pool this task should run in,
|
1256
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1257
|
+
soft_fail : bool
|
1258
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1259
|
+
name : str
|
1260
|
+
Name of the sensor on Airflow
|
1261
|
+
description : str
|
1262
|
+
Description of sensor in the Airflow UI
|
1263
|
+
bucket_key : Union[str, List[str]]
|
1264
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1265
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1266
|
+
bucket_name : str
|
1267
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1268
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1269
|
+
wildcard_match : bool
|
1270
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1271
|
+
aws_conn_id : str
|
1272
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1273
|
+
verify : bool
|
1274
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
660
1275
|
"""
|
661
1276
|
...
|
662
1277
|
|
@@ -667,6 +1282,15 @@ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[s
|
|
667
1282
|
|
668
1283
|
Use `@pypi_base` to set common packages required by all
|
669
1284
|
steps and use `@pypi` to specify step-specific overrides.
|
1285
|
+
|
1286
|
+
Parameters
|
1287
|
+
----------
|
1288
|
+
packages : Dict[str, str], default: {}
|
1289
|
+
Packages to use for this flow. The key is the name of the package
|
1290
|
+
and the value is the version to use.
|
1291
|
+
python : str, optional, default: None
|
1292
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1293
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
670
1294
|
"""
|
671
1295
|
...
|
672
1296
|
|
@@ -680,45 +1304,15 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
|
|
680
1304
|
|
681
1305
|
Use `@pypi_base` to set common packages required by all
|
682
1306
|
steps and use `@pypi` to specify step-specific overrides.
|
683
|
-
"""
|
684
|
-
...
|
685
|
-
|
686
|
-
@typing.overload
|
687
|
-
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]]:
|
688
|
-
"""
|
689
|
-
Specifies the Conda environment for all steps of the flow.
|
690
1307
|
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
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):
|
701
|
-
"""
|
702
|
-
Specifies the Conda environment for all steps of the flow.
|
703
|
-
|
704
|
-
Use `@conda_base` to set common libraries required by all
|
705
|
-
steps and use `@conda` to specify step-specific additions.
|
706
|
-
"""
|
707
|
-
...
|
708
|
-
|
709
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
710
|
-
"""
|
711
|
-
Specifies what flows belong to the same project.
|
712
|
-
|
713
|
-
A project-specific namespace is created for all flows that
|
714
|
-
use the same `@project(name)`.
|
715
|
-
"""
|
716
|
-
...
|
717
|
-
|
718
|
-
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]]:
|
719
|
-
"""
|
720
|
-
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.
|
721
|
-
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.
|
1308
|
+
Parameters
|
1309
|
+
----------
|
1310
|
+
packages : Dict[str, str], default: {}
|
1311
|
+
Packages to use for this flow. The key is the name of the package
|
1312
|
+
and the value is the version to use.
|
1313
|
+
python : str, optional, default: None
|
1314
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1315
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
722
1316
|
"""
|
723
1317
|
...
|
724
1318
|
|