metaflow-stubs 2.15.3__py2.py3-none-any.whl → 2.15.5__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 +341 -341
- 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 +3 -3
- 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 +4 -4
- 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 +3 -3
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +3 -3
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +8 -8
- 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 +3 -3
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +7 -5
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- 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 +5 -5
- 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 +3 -3
- 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 +5 -5
- 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 +2 -2
- 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 +3 -3
- 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 +3 -3
- 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 +5 -5
- 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 +2 -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 +5 -5
- metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
- 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 +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +8 -6
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- 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 +6 -6
- metaflow-stubs/user_configs/config_options.pyi +3 -3
- metaflow-stubs/user_configs/config_parameters.pyi +6 -6
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.15.3.dist-info → metaflow_stubs-2.15.5.dist-info}/METADATA +2 -2
- metaflow_stubs-2.15.5.dist-info/RECORD +146 -0
- {metaflow_stubs-2.15.3.dist-info → metaflow_stubs-2.15.5.dist-info}/WHEEL +1 -1
- metaflow_stubs-2.15.3.dist-info/RECORD +0 -146
- {metaflow_stubs-2.15.3.dist-info → metaflow_stubs-2.15.5.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.15.
|
4
|
-
# Generated on 2025-03-
|
3
|
+
# MF version: 2.15.5 #
|
4
|
+
# Generated on 2025-03-13T17:07:28.496640 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -42,8 +42,8 @@ from . import plugins as plugins
|
|
42
42
|
from .plugins.datatools.s3.s3 import S3 as S3
|
43
43
|
from . import includefile as includefile
|
44
44
|
from .includefile import IncludeFile as IncludeFile
|
45
|
-
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
46
45
|
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
46
|
+
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
47
47
|
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
48
48
|
from . import cards as cards
|
49
49
|
from . import client as client
|
@@ -204,120 +204,6 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
204
204
|
"""
|
205
205
|
...
|
206
206
|
|
207
|
-
@typing.overload
|
208
|
-
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
209
|
-
"""
|
210
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
211
|
-
the execution of a step.
|
212
|
-
|
213
|
-
|
214
|
-
Parameters
|
215
|
-
----------
|
216
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
217
|
-
List of secret specs, defining how the secrets are to be retrieved
|
218
|
-
"""
|
219
|
-
...
|
220
|
-
|
221
|
-
@typing.overload
|
222
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
223
|
-
...
|
224
|
-
|
225
|
-
@typing.overload
|
226
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
227
|
-
...
|
228
|
-
|
229
|
-
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]]] = []):
|
230
|
-
"""
|
231
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
232
|
-
the execution of a step.
|
233
|
-
|
234
|
-
|
235
|
-
Parameters
|
236
|
-
----------
|
237
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
238
|
-
List of secret specs, defining how the secrets are to be retrieved
|
239
|
-
"""
|
240
|
-
...
|
241
|
-
|
242
|
-
@typing.overload
|
243
|
-
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]]]:
|
244
|
-
"""
|
245
|
-
Specifies the resources needed when executing this step.
|
246
|
-
|
247
|
-
Use `@resources` to specify the resource requirements
|
248
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
249
|
-
|
250
|
-
You can choose the compute layer on the command line by executing e.g.
|
251
|
-
```
|
252
|
-
python myflow.py run --with batch
|
253
|
-
```
|
254
|
-
or
|
255
|
-
```
|
256
|
-
python myflow.py run --with kubernetes
|
257
|
-
```
|
258
|
-
which executes the flow on the desired system using the
|
259
|
-
requirements specified in `@resources`.
|
260
|
-
|
261
|
-
|
262
|
-
Parameters
|
263
|
-
----------
|
264
|
-
cpu : int, default 1
|
265
|
-
Number of CPUs required for this step.
|
266
|
-
gpu : int, optional, default None
|
267
|
-
Number of GPUs required for this step.
|
268
|
-
disk : int, optional, default None
|
269
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
270
|
-
memory : int, default 4096
|
271
|
-
Memory size (in MB) required for this step.
|
272
|
-
shared_memory : int, optional, default None
|
273
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
274
|
-
This parameter maps to the `--shm-size` option in Docker.
|
275
|
-
"""
|
276
|
-
...
|
277
|
-
|
278
|
-
@typing.overload
|
279
|
-
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
280
|
-
...
|
281
|
-
|
282
|
-
@typing.overload
|
283
|
-
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
284
|
-
...
|
285
|
-
|
286
|
-
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):
|
287
|
-
"""
|
288
|
-
Specifies the resources needed when executing this step.
|
289
|
-
|
290
|
-
Use `@resources` to specify the resource requirements
|
291
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
292
|
-
|
293
|
-
You can choose the compute layer on the command line by executing e.g.
|
294
|
-
```
|
295
|
-
python myflow.py run --with batch
|
296
|
-
```
|
297
|
-
or
|
298
|
-
```
|
299
|
-
python myflow.py run --with kubernetes
|
300
|
-
```
|
301
|
-
which executes the flow on the desired system using the
|
302
|
-
requirements specified in `@resources`.
|
303
|
-
|
304
|
-
|
305
|
-
Parameters
|
306
|
-
----------
|
307
|
-
cpu : int, default 1
|
308
|
-
Number of CPUs required for this step.
|
309
|
-
gpu : int, optional, default None
|
310
|
-
Number of GPUs required for this step.
|
311
|
-
disk : int, optional, default None
|
312
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
313
|
-
memory : int, default 4096
|
314
|
-
Memory size (in MB) required for this step.
|
315
|
-
shared_memory : int, optional, default None
|
316
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
317
|
-
This parameter maps to the `--shm-size` option in Docker.
|
318
|
-
"""
|
319
|
-
...
|
320
|
-
|
321
207
|
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]]]:
|
322
208
|
"""
|
323
209
|
Specifies that this step should execute on Kubernetes.
|
@@ -396,153 +282,130 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
396
282
|
...
|
397
283
|
|
398
284
|
@typing.overload
|
399
|
-
def
|
285
|
+
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]]]:
|
400
286
|
"""
|
401
|
-
|
287
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
402
288
|
|
403
|
-
|
404
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
405
|
-
you can use `@pypi_base` to set packages required by all
|
406
|
-
steps and use `@pypi` to specify step-specific overrides.
|
289
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
407
290
|
|
408
291
|
|
409
292
|
Parameters
|
410
293
|
----------
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
294
|
+
type : str, default 'default'
|
295
|
+
Card type.
|
296
|
+
id : str, optional, default None
|
297
|
+
If multiple cards are present, use this id to identify this card.
|
298
|
+
options : Dict[str, Any], default {}
|
299
|
+
Options passed to the card. The contents depend on the card type.
|
300
|
+
timeout : int, default 45
|
301
|
+
Interrupt reporting if it takes more than this many seconds.
|
417
302
|
"""
|
418
303
|
...
|
419
304
|
|
420
305
|
@typing.overload
|
421
|
-
def
|
306
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
422
307
|
...
|
423
308
|
|
424
309
|
@typing.overload
|
425
|
-
def
|
426
|
-
...
|
427
|
-
|
428
|
-
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):
|
429
|
-
"""
|
430
|
-
Specifies the PyPI packages for the step.
|
431
|
-
|
432
|
-
Information in this decorator will augment any
|
433
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
434
|
-
you can use `@pypi_base` to set packages required by all
|
435
|
-
steps and use `@pypi` to specify step-specific overrides.
|
436
|
-
|
437
|
-
|
438
|
-
Parameters
|
439
|
-
----------
|
440
|
-
packages : Dict[str, str], default: {}
|
441
|
-
Packages to use for this step. The key is the name of the package
|
442
|
-
and the value is the version to use.
|
443
|
-
python : str, optional, default: None
|
444
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
445
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
446
|
-
"""
|
310
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
447
311
|
...
|
448
312
|
|
449
|
-
|
450
|
-
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]]]:
|
313
|
+
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):
|
451
314
|
"""
|
452
|
-
|
315
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
453
316
|
|
454
|
-
|
455
|
-
contains the exception raised. You can use it to detect the presence
|
456
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
457
|
-
are missing.
|
317
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
458
318
|
|
459
319
|
|
460
320
|
Parameters
|
461
321
|
----------
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
322
|
+
type : str, default 'default'
|
323
|
+
Card type.
|
324
|
+
id : str, optional, default None
|
325
|
+
If multiple cards are present, use this id to identify this card.
|
326
|
+
options : Dict[str, Any], default {}
|
327
|
+
Options passed to the card. The contents depend on the card type.
|
328
|
+
timeout : int, default 45
|
329
|
+
Interrupt reporting if it takes more than this many seconds.
|
468
330
|
"""
|
469
331
|
...
|
470
332
|
|
471
333
|
@typing.overload
|
472
|
-
def
|
473
|
-
...
|
474
|
-
|
475
|
-
@typing.overload
|
476
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
477
|
-
...
|
478
|
-
|
479
|
-
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):
|
334
|
+
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]]]:
|
480
335
|
"""
|
481
|
-
Specifies
|
482
|
-
|
483
|
-
The decorator will create an optional artifact, specified by `var`, which
|
484
|
-
contains the exception raised. You can use it to detect the presence
|
485
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
486
|
-
are missing.
|
487
|
-
|
336
|
+
Specifies the resources needed when executing this step.
|
488
337
|
|
489
|
-
|
490
|
-
|
491
|
-
var : str, optional, default None
|
492
|
-
Name of the artifact in which to store the caught exception.
|
493
|
-
If not specified, the exception is not stored.
|
494
|
-
print_exception : bool, default True
|
495
|
-
Determines whether or not the exception is printed to
|
496
|
-
stdout when caught.
|
497
|
-
"""
|
498
|
-
...
|
499
|
-
|
500
|
-
@typing.overload
|
501
|
-
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]]]:
|
502
|
-
"""
|
503
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
338
|
+
Use `@resources` to specify the resource requirements
|
339
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
504
340
|
|
505
|
-
|
341
|
+
You can choose the compute layer on the command line by executing e.g.
|
342
|
+
```
|
343
|
+
python myflow.py run --with batch
|
344
|
+
```
|
345
|
+
or
|
346
|
+
```
|
347
|
+
python myflow.py run --with kubernetes
|
348
|
+
```
|
349
|
+
which executes the flow on the desired system using the
|
350
|
+
requirements specified in `@resources`.
|
506
351
|
|
507
352
|
|
508
353
|
Parameters
|
509
354
|
----------
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
355
|
+
cpu : int, default 1
|
356
|
+
Number of CPUs required for this step.
|
357
|
+
gpu : int, optional, default None
|
358
|
+
Number of GPUs required for this step.
|
359
|
+
disk : int, optional, default None
|
360
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
361
|
+
memory : int, default 4096
|
362
|
+
Memory size (in MB) required for this step.
|
363
|
+
shared_memory : int, optional, default None
|
364
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
365
|
+
This parameter maps to the `--shm-size` option in Docker.
|
518
366
|
"""
|
519
367
|
...
|
520
368
|
|
521
369
|
@typing.overload
|
522
|
-
def
|
370
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
523
371
|
...
|
524
372
|
|
525
373
|
@typing.overload
|
526
|
-
def
|
374
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
527
375
|
...
|
528
376
|
|
529
|
-
def
|
377
|
+
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):
|
530
378
|
"""
|
531
|
-
|
379
|
+
Specifies the resources needed when executing this step.
|
532
380
|
|
533
|
-
|
381
|
+
Use `@resources` to specify the resource requirements
|
382
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
383
|
+
|
384
|
+
You can choose the compute layer on the command line by executing e.g.
|
385
|
+
```
|
386
|
+
python myflow.py run --with batch
|
387
|
+
```
|
388
|
+
or
|
389
|
+
```
|
390
|
+
python myflow.py run --with kubernetes
|
391
|
+
```
|
392
|
+
which executes the flow on the desired system using the
|
393
|
+
requirements specified in `@resources`.
|
534
394
|
|
535
395
|
|
536
396
|
Parameters
|
537
397
|
----------
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
398
|
+
cpu : int, default 1
|
399
|
+
Number of CPUs required for this step.
|
400
|
+
gpu : int, optional, default None
|
401
|
+
Number of GPUs required for this step.
|
402
|
+
disk : int, optional, default None
|
403
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
404
|
+
memory : int, default 4096
|
405
|
+
Memory size (in MB) required for this step.
|
406
|
+
shared_memory : int, optional, default None
|
407
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
408
|
+
This parameter maps to the `--shm-size` option in Docker.
|
546
409
|
"""
|
547
410
|
...
|
548
411
|
|
@@ -695,25 +558,6 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
695
558
|
"""
|
696
559
|
...
|
697
560
|
|
698
|
-
@typing.overload
|
699
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
700
|
-
"""
|
701
|
-
Decorator prototype for all step decorators. This function gets specialized
|
702
|
-
and imported for all decorators types by _import_plugin_decorators().
|
703
|
-
"""
|
704
|
-
...
|
705
|
-
|
706
|
-
@typing.overload
|
707
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
708
|
-
...
|
709
|
-
|
710
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
711
|
-
"""
|
712
|
-
Decorator prototype for all step decorators. This function gets specialized
|
713
|
-
and imported for all decorators types by _import_plugin_decorators().
|
714
|
-
"""
|
715
|
-
...
|
716
|
-
|
717
561
|
@typing.overload
|
718
562
|
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]]]:
|
719
563
|
"""
|
@@ -773,6 +617,57 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
773
617
|
"""
|
774
618
|
...
|
775
619
|
|
620
|
+
@typing.overload
|
621
|
+
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]]]:
|
622
|
+
"""
|
623
|
+
Specifies that the step will success under all circumstances.
|
624
|
+
|
625
|
+
The decorator will create an optional artifact, specified by `var`, which
|
626
|
+
contains the exception raised. You can use it to detect the presence
|
627
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
628
|
+
are missing.
|
629
|
+
|
630
|
+
|
631
|
+
Parameters
|
632
|
+
----------
|
633
|
+
var : str, optional, default None
|
634
|
+
Name of the artifact in which to store the caught exception.
|
635
|
+
If not specified, the exception is not stored.
|
636
|
+
print_exception : bool, default True
|
637
|
+
Determines whether or not the exception is printed to
|
638
|
+
stdout when caught.
|
639
|
+
"""
|
640
|
+
...
|
641
|
+
|
642
|
+
@typing.overload
|
643
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
644
|
+
...
|
645
|
+
|
646
|
+
@typing.overload
|
647
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
648
|
+
...
|
649
|
+
|
650
|
+
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):
|
651
|
+
"""
|
652
|
+
Specifies that the step will success under all circumstances.
|
653
|
+
|
654
|
+
The decorator will create an optional artifact, specified by `var`, which
|
655
|
+
contains the exception raised. You can use it to detect the presence
|
656
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
657
|
+
are missing.
|
658
|
+
|
659
|
+
|
660
|
+
Parameters
|
661
|
+
----------
|
662
|
+
var : str, optional, default None
|
663
|
+
Name of the artifact in which to store the caught exception.
|
664
|
+
If not specified, the exception is not stored.
|
665
|
+
print_exception : bool, default True
|
666
|
+
Determines whether or not the exception is printed to
|
667
|
+
stdout when caught.
|
668
|
+
"""
|
669
|
+
...
|
670
|
+
|
776
671
|
@typing.overload
|
777
672
|
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]]]:
|
778
673
|
"""
|
@@ -862,17 +757,20 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
|
|
862
757
|
...
|
863
758
|
|
864
759
|
@typing.overload
|
865
|
-
def
|
760
|
+
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]]]:
|
866
761
|
"""
|
867
|
-
Specifies the PyPI packages for
|
762
|
+
Specifies the PyPI packages for the step.
|
868
763
|
|
869
|
-
|
764
|
+
Information in this decorator will augment any
|
765
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
766
|
+
you can use `@pypi_base` to set packages required by all
|
870
767
|
steps and use `@pypi` to specify step-specific overrides.
|
871
768
|
|
769
|
+
|
872
770
|
Parameters
|
873
771
|
----------
|
874
772
|
packages : Dict[str, str], default: {}
|
875
|
-
Packages to use for this
|
773
|
+
Packages to use for this step. The key is the name of the package
|
876
774
|
and the value is the version to use.
|
877
775
|
python : str, optional, default: None
|
878
776
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
@@ -881,67 +779,85 @@ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[s
|
|
881
779
|
...
|
882
780
|
|
883
781
|
@typing.overload
|
884
|
-
def
|
782
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
783
|
+
...
|
784
|
+
|
785
|
+
@typing.overload
|
786
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
787
|
+
...
|
788
|
+
|
789
|
+
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):
|
790
|
+
"""
|
791
|
+
Specifies the PyPI packages for the step.
|
792
|
+
|
793
|
+
Information in this decorator will augment any
|
794
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
795
|
+
you can use `@pypi_base` to set packages required by all
|
796
|
+
steps and use `@pypi` to specify step-specific overrides.
|
797
|
+
|
798
|
+
|
799
|
+
Parameters
|
800
|
+
----------
|
801
|
+
packages : Dict[str, str], default: {}
|
802
|
+
Packages to use for this step. The key is the name of the package
|
803
|
+
and the value is the version to use.
|
804
|
+
python : str, optional, default: None
|
805
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
806
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
807
|
+
"""
|
808
|
+
...
|
809
|
+
|
810
|
+
@typing.overload
|
811
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
812
|
+
"""
|
813
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
814
|
+
the execution of a step.
|
815
|
+
|
816
|
+
|
817
|
+
Parameters
|
818
|
+
----------
|
819
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
820
|
+
List of secret specs, defining how the secrets are to be retrieved
|
821
|
+
"""
|
822
|
+
...
|
823
|
+
|
824
|
+
@typing.overload
|
825
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
826
|
+
...
|
827
|
+
|
828
|
+
@typing.overload
|
829
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
885
830
|
...
|
886
831
|
|
887
|
-
def
|
832
|
+
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]]] = []):
|
888
833
|
"""
|
889
|
-
Specifies
|
834
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
835
|
+
the execution of a step.
|
890
836
|
|
891
|
-
Use `@pypi_base` to set common packages required by all
|
892
|
-
steps and use `@pypi` to specify step-specific overrides.
|
893
837
|
|
894
838
|
Parameters
|
895
839
|
----------
|
896
|
-
|
897
|
-
|
898
|
-
and the value is the version to use.
|
899
|
-
python : str, optional, default: None
|
900
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
901
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
840
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
841
|
+
List of secret specs, defining how the secrets are to be retrieved
|
902
842
|
"""
|
903
843
|
...
|
904
844
|
|
905
|
-
|
845
|
+
@typing.overload
|
846
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
906
847
|
"""
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
921
|
-
pool : str
|
922
|
-
the slot pool this task should run in,
|
923
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
924
|
-
soft_fail : bool
|
925
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
926
|
-
name : str
|
927
|
-
Name of the sensor on Airflow
|
928
|
-
description : str
|
929
|
-
Description of sensor in the Airflow UI
|
930
|
-
external_dag_id : str
|
931
|
-
The dag_id that contains the task you want to wait for.
|
932
|
-
external_task_ids : List[str]
|
933
|
-
The list of task_ids that you want to wait for.
|
934
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
935
|
-
allowed_states : List[str]
|
936
|
-
Iterable of allowed states, (Default: ['success'])
|
937
|
-
failed_states : List[str]
|
938
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
939
|
-
execution_delta : datetime.timedelta
|
940
|
-
time difference with the previous execution to look at,
|
941
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
942
|
-
check_existence: bool
|
943
|
-
Set to True to check if the external task exists or check if
|
944
|
-
the DAG to wait for exists. (Default: True)
|
848
|
+
Decorator prototype for all step decorators. This function gets specialized
|
849
|
+
and imported for all decorators types by _import_plugin_decorators().
|
850
|
+
"""
|
851
|
+
...
|
852
|
+
|
853
|
+
@typing.overload
|
854
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
855
|
+
...
|
856
|
+
|
857
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
858
|
+
"""
|
859
|
+
Decorator prototype for all step decorators. This function gets specialized
|
860
|
+
and imported for all decorators types by _import_plugin_decorators().
|
945
861
|
"""
|
946
862
|
...
|
947
863
|
|
@@ -1038,6 +954,100 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1038
954
|
"""
|
1039
955
|
...
|
1040
956
|
|
957
|
+
@typing.overload
|
958
|
+
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]]:
|
959
|
+
"""
|
960
|
+
Specifies the times when the flow should be run when running on a
|
961
|
+
production scheduler.
|
962
|
+
|
963
|
+
|
964
|
+
Parameters
|
965
|
+
----------
|
966
|
+
hourly : bool, default False
|
967
|
+
Run the workflow hourly.
|
968
|
+
daily : bool, default True
|
969
|
+
Run the workflow daily.
|
970
|
+
weekly : bool, default False
|
971
|
+
Run the workflow weekly.
|
972
|
+
cron : str, optional, default None
|
973
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
974
|
+
specified by this expression.
|
975
|
+
timezone : str, optional, default None
|
976
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
977
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
978
|
+
"""
|
979
|
+
...
|
980
|
+
|
981
|
+
@typing.overload
|
982
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
983
|
+
...
|
984
|
+
|
985
|
+
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):
|
986
|
+
"""
|
987
|
+
Specifies the times when the flow should be run when running on a
|
988
|
+
production scheduler.
|
989
|
+
|
990
|
+
|
991
|
+
Parameters
|
992
|
+
----------
|
993
|
+
hourly : bool, default False
|
994
|
+
Run the workflow hourly.
|
995
|
+
daily : bool, default True
|
996
|
+
Run the workflow daily.
|
997
|
+
weekly : bool, default False
|
998
|
+
Run the workflow weekly.
|
999
|
+
cron : str, optional, default None
|
1000
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1001
|
+
specified by this expression.
|
1002
|
+
timezone : str, optional, default None
|
1003
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1004
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1005
|
+
"""
|
1006
|
+
...
|
1007
|
+
|
1008
|
+
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]]:
|
1009
|
+
"""
|
1010
|
+
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.
|
1011
|
+
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.
|
1012
|
+
|
1013
|
+
|
1014
|
+
Parameters
|
1015
|
+
----------
|
1016
|
+
timeout : int
|
1017
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1018
|
+
poke_interval : int
|
1019
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1020
|
+
mode : str
|
1021
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1022
|
+
exponential_backoff : bool
|
1023
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1024
|
+
pool : str
|
1025
|
+
the slot pool this task should run in,
|
1026
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1027
|
+
soft_fail : bool
|
1028
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1029
|
+
name : str
|
1030
|
+
Name of the sensor on Airflow
|
1031
|
+
description : str
|
1032
|
+
Description of sensor in the Airflow UI
|
1033
|
+
external_dag_id : str
|
1034
|
+
The dag_id that contains the task you want to wait for.
|
1035
|
+
external_task_ids : List[str]
|
1036
|
+
The list of task_ids that you want to wait for.
|
1037
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1038
|
+
allowed_states : List[str]
|
1039
|
+
Iterable of allowed states, (Default: ['success'])
|
1040
|
+
failed_states : List[str]
|
1041
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1042
|
+
execution_delta : datetime.timedelta
|
1043
|
+
time difference with the previous execution to look at,
|
1044
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1045
|
+
check_existence: bool
|
1046
|
+
Set to True to check if the external task exists or check if
|
1047
|
+
the DAG to wait for exists. (Default: True)
|
1048
|
+
"""
|
1049
|
+
...
|
1050
|
+
|
1041
1051
|
@typing.overload
|
1042
1052
|
def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1043
1053
|
"""
|
@@ -1174,6 +1184,47 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
|
|
1174
1184
|
"""
|
1175
1185
|
...
|
1176
1186
|
|
1187
|
+
@typing.overload
|
1188
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1189
|
+
"""
|
1190
|
+
Specifies the PyPI packages for all steps of the flow.
|
1191
|
+
|
1192
|
+
Use `@pypi_base` to set common packages required by all
|
1193
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1194
|
+
|
1195
|
+
Parameters
|
1196
|
+
----------
|
1197
|
+
packages : Dict[str, str], default: {}
|
1198
|
+
Packages to use for this flow. The key is the name of the package
|
1199
|
+
and the value is the version to use.
|
1200
|
+
python : str, optional, default: None
|
1201
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1202
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1203
|
+
"""
|
1204
|
+
...
|
1205
|
+
|
1206
|
+
@typing.overload
|
1207
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1208
|
+
...
|
1209
|
+
|
1210
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1211
|
+
"""
|
1212
|
+
Specifies the PyPI packages for all steps of the flow.
|
1213
|
+
|
1214
|
+
Use `@pypi_base` to set common packages required by all
|
1215
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1216
|
+
|
1217
|
+
Parameters
|
1218
|
+
----------
|
1219
|
+
packages : Dict[str, str], default: {}
|
1220
|
+
Packages to use for this flow. The key is the name of the package
|
1221
|
+
and the value is the version to use.
|
1222
|
+
python : str, optional, default: None
|
1223
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1224
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1225
|
+
"""
|
1226
|
+
...
|
1227
|
+
|
1177
1228
|
@typing.overload
|
1178
1229
|
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]]:
|
1179
1230
|
"""
|
@@ -1268,54 +1319,3 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
1268
1319
|
"""
|
1269
1320
|
...
|
1270
1321
|
|
1271
|
-
@typing.overload
|
1272
|
-
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]]:
|
1273
|
-
"""
|
1274
|
-
Specifies the times when the flow should be run when running on a
|
1275
|
-
production scheduler.
|
1276
|
-
|
1277
|
-
|
1278
|
-
Parameters
|
1279
|
-
----------
|
1280
|
-
hourly : bool, default False
|
1281
|
-
Run the workflow hourly.
|
1282
|
-
daily : bool, default True
|
1283
|
-
Run the workflow daily.
|
1284
|
-
weekly : bool, default False
|
1285
|
-
Run the workflow weekly.
|
1286
|
-
cron : str, optional, default None
|
1287
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1288
|
-
specified by this expression.
|
1289
|
-
timezone : str, optional, default None
|
1290
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1291
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1292
|
-
"""
|
1293
|
-
...
|
1294
|
-
|
1295
|
-
@typing.overload
|
1296
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1297
|
-
...
|
1298
|
-
|
1299
|
-
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):
|
1300
|
-
"""
|
1301
|
-
Specifies the times when the flow should be run when running on a
|
1302
|
-
production scheduler.
|
1303
|
-
|
1304
|
-
|
1305
|
-
Parameters
|
1306
|
-
----------
|
1307
|
-
hourly : bool, default False
|
1308
|
-
Run the workflow hourly.
|
1309
|
-
daily : bool, default True
|
1310
|
-
Run the workflow daily.
|
1311
|
-
weekly : bool, default False
|
1312
|
-
Run the workflow weekly.
|
1313
|
-
cron : str, optional, default None
|
1314
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1315
|
-
specified by this expression.
|
1316
|
-
timezone : str, optional, default None
|
1317
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1318
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1319
|
-
"""
|
1320
|
-
...
|
1321
|
-
|