ob-metaflow-stubs 6.0.3.102rc3__py2.py3-none-any.whl → 6.0.3.102rc5__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- metaflow-stubs/__init__.pyi +657 -657
- metaflow-stubs/cards.pyi +4 -4
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +3 -3
- metaflow-stubs/client/core.pyi +6 -6
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/clone_util.pyi +1 -1
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +1 -1
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/info_file.pyi +1 -1
- metaflow-stubs/metadata/metadata.pyi +1 -1
- metaflow-stubs/metadata/util.pyi +1 -1
- metaflow-stubs/metaflow_config.pyi +1 -1
- metaflow-stubs/metaflow_current.pyi +36 -36
- metaflow-stubs/mflog/mflog.pyi +1 -1
- metaflow-stubs/multicore_utils.pyi +1 -1
- metaflow-stubs/parameters.pyi +2 -2
- metaflow-stubs/plugins/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
- metaflow-stubs/plugins/airflow/exception.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
- 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 +1 -1
- metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +6 -6
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +6 -6
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
- metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
- metaflow-stubs/plugins/azure/__init__.pyi +1 -1
- metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +1 -1
- metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
- metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
- metaflow-stubs/plugins/cards/__init__.pyi +1 -1
- metaflow-stubs/plugins/cards/card_cli.pyi +3 -3
- metaflow-stubs/plugins/cards/card_client.pyi +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
- metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
- metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +1 -1
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +1 -1
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
- metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -6
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
- metaflow-stubs/plugins/debug_logger.pyi +1 -1
- metaflow-stubs/plugins/debug_monitor.pyi +1 -1
- metaflow-stubs/plugins/environment_decorator.pyi +1 -1
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
- metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
- metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +1 -1
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
- metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
- metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
- metaflow-stubs/plugins/logs_cli.pyi +2 -2
- metaflow-stubs/plugins/package_cli.pyi +1 -1
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.pyi +1 -1
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
- metaflow-stubs/plugins/pypi/conda_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
- metaflow-stubs/plugins/pypi/utils.pyi +1 -1
- metaflow-stubs/plugins/resources_decorator.pyi +1 -1
- metaflow-stubs/plugins/retry_decorator.pyi +1 -1
- metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +1 -1
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
- metaflow-stubs/plugins/storage_executor.pyi +1 -1
- metaflow-stubs/plugins/tag_cli.pyi +4 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
- metaflow-stubs/plugins/timeout_decorator.pyi +1 -1
- metaflow-stubs/procpoll.pyi +1 -1
- metaflow-stubs/profilers/__init__.pyi +1 -1
- metaflow-stubs/pylint_wrapper.pyi +1 -1
- metaflow-stubs/runner/__init__.pyi +1 -1
- metaflow-stubs/runner/deployer.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +1 -1
- metaflow-stubs/runner/nbrun.pyi +1 -1
- metaflow-stubs/runner/subprocess_manager.pyi +1 -1
- metaflow-stubs/runner/utils.pyi +1 -1
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +1 -1
- metaflow-stubs/tagging_util.pyi +1 -1
- metaflow-stubs/tuple_util.pyi +1 -1
- {ob_metaflow_stubs-6.0.3.102rc3.dist-info → ob_metaflow_stubs-6.0.3.102rc5.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.102rc5.dist-info/RECORD +140 -0
- ob_metaflow_stubs-6.0.3.102rc3.dist-info/RECORD +0 -140
- {ob_metaflow_stubs-6.0.3.102rc3.dist-info → ob_metaflow_stubs-6.0.3.102rc5.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.102rc3.dist-info → ob_metaflow_stubs-6.0.3.102rc5.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
3
|
# MF version: 2.12.22.1+obcheckpoint(0.0.10);ob(v1) #
|
4
|
-
# Generated on 2024-09-20T19:
|
4
|
+
# Generated on 2024-09-20T19:15:33.481402 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.flowspec
|
12
|
-
import datetime
|
13
|
-
import metaflow._vendor.click.types
|
14
|
-
import metaflow.parameters
|
15
|
-
import typing
|
16
|
-
import metaflow.datastore.inputs
|
17
11
|
import metaflow.metaflow_current
|
18
|
-
import metaflow.
|
12
|
+
import metaflow.parameters
|
13
|
+
import metaflow._vendor.click.types
|
19
14
|
import metaflow.runner.metaflow_runner
|
20
|
-
import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
|
21
15
|
import metaflow.client.core
|
16
|
+
import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
|
17
|
+
import metaflow.datastore.inputs
|
18
|
+
import metaflow.events
|
19
|
+
import datetime
|
20
|
+
import metaflow.flowspec
|
21
|
+
import typing
|
22
22
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
23
23
|
StepFlag = typing.NewType("StepFlag", bool)
|
24
24
|
|
@@ -434,6 +434,96 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
434
434
|
"""
|
435
435
|
...
|
436
436
|
|
437
|
+
@typing.overload
|
438
|
+
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]]]:
|
439
|
+
"""
|
440
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
441
|
+
the execution of a step.
|
442
|
+
|
443
|
+
Parameters
|
444
|
+
----------
|
445
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
446
|
+
List of secret specs, defining how the secrets are to be retrieved
|
447
|
+
"""
|
448
|
+
...
|
449
|
+
|
450
|
+
@typing.overload
|
451
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
452
|
+
...
|
453
|
+
|
454
|
+
@typing.overload
|
455
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
456
|
+
...
|
457
|
+
|
458
|
+
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]]] = []):
|
459
|
+
"""
|
460
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
461
|
+
the execution of a step.
|
462
|
+
|
463
|
+
Parameters
|
464
|
+
----------
|
465
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
466
|
+
List of secret specs, defining how the secrets are to be retrieved
|
467
|
+
"""
|
468
|
+
...
|
469
|
+
|
470
|
+
@typing.overload
|
471
|
+
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]]]:
|
472
|
+
"""
|
473
|
+
Specifies the Conda environment for the step.
|
474
|
+
|
475
|
+
Information in this decorator will augment any
|
476
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
477
|
+
you can use `@conda_base` to set packages required by all
|
478
|
+
steps and use `@conda` to specify step-specific overrides.
|
479
|
+
|
480
|
+
Parameters
|
481
|
+
----------
|
482
|
+
packages : Dict[str, str], default {}
|
483
|
+
Packages to use for this step. The key is the name of the package
|
484
|
+
and the value is the version to use.
|
485
|
+
libraries : Dict[str, str], default {}
|
486
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
487
|
+
python : str, optional, default None
|
488
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
489
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
490
|
+
disabled : bool, default False
|
491
|
+
If set to True, disables @conda.
|
492
|
+
"""
|
493
|
+
...
|
494
|
+
|
495
|
+
@typing.overload
|
496
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
497
|
+
...
|
498
|
+
|
499
|
+
@typing.overload
|
500
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
501
|
+
...
|
502
|
+
|
503
|
+
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):
|
504
|
+
"""
|
505
|
+
Specifies the Conda environment for the step.
|
506
|
+
|
507
|
+
Information in this decorator will augment any
|
508
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
509
|
+
you can use `@conda_base` to set packages required by all
|
510
|
+
steps and use `@conda` to specify step-specific overrides.
|
511
|
+
|
512
|
+
Parameters
|
513
|
+
----------
|
514
|
+
packages : Dict[str, str], default {}
|
515
|
+
Packages to use for this step. The key is the name of the package
|
516
|
+
and the value is the version to use.
|
517
|
+
libraries : Dict[str, str], default {}
|
518
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
519
|
+
python : str, optional, default None
|
520
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
521
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
522
|
+
disabled : bool, default False
|
523
|
+
If set to True, disables @conda.
|
524
|
+
"""
|
525
|
+
...
|
526
|
+
|
437
527
|
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] = [], 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) -> 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]]]:
|
438
528
|
"""
|
439
529
|
Specifies that this step should execute on Kubernetes.
|
@@ -501,145 +591,170 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
501
591
|
...
|
502
592
|
|
503
593
|
@typing.overload
|
504
|
-
def
|
594
|
+
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]]]:
|
505
595
|
"""
|
506
|
-
Specifies the
|
596
|
+
Specifies that the step will success under all circumstances.
|
507
597
|
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
598
|
+
The decorator will create an optional artifact, specified by `var`, which
|
599
|
+
contains the exception raised. You can use it to detect the presence
|
600
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
601
|
+
are missing.
|
512
602
|
|
513
603
|
Parameters
|
514
604
|
----------
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
522
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
523
|
-
disabled : bool, default False
|
524
|
-
If set to True, disables @conda.
|
605
|
+
var : str, optional, default None
|
606
|
+
Name of the artifact in which to store the caught exception.
|
607
|
+
If not specified, the exception is not stored.
|
608
|
+
print_exception : bool, default True
|
609
|
+
Determines whether or not the exception is printed to
|
610
|
+
stdout when caught.
|
525
611
|
"""
|
526
612
|
...
|
527
613
|
|
528
614
|
@typing.overload
|
529
|
-
def
|
615
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
530
616
|
...
|
531
617
|
|
532
618
|
@typing.overload
|
533
|
-
def
|
619
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
534
620
|
...
|
535
621
|
|
536
|
-
def
|
622
|
+
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):
|
537
623
|
"""
|
538
|
-
Specifies the
|
624
|
+
Specifies that the step will success under all circumstances.
|
539
625
|
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
626
|
+
The decorator will create an optional artifact, specified by `var`, which
|
627
|
+
contains the exception raised. You can use it to detect the presence
|
628
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
629
|
+
are missing.
|
544
630
|
|
545
631
|
Parameters
|
546
632
|
----------
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
554
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
555
|
-
disabled : bool, default False
|
556
|
-
If set to True, disables @conda.
|
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.
|
557
639
|
"""
|
558
640
|
...
|
559
641
|
|
560
642
|
@typing.overload
|
561
|
-
def
|
643
|
+
def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: 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]]]:
|
562
644
|
"""
|
563
|
-
|
564
|
-
|
565
|
-
Use `@resources` to specify the resource requirements
|
566
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
645
|
+
Enables loading / saving of models within a step.
|
567
646
|
|
568
|
-
You can choose the compute layer on the command line by executing e.g.
|
569
|
-
```
|
570
|
-
python myflow.py run --with batch
|
571
|
-
```
|
572
|
-
or
|
573
|
-
```
|
574
|
-
python myflow.py run --with kubernetes
|
575
|
-
```
|
576
|
-
which executes the flow on the desired system using the
|
577
|
-
requirements specified in `@resources`.
|
578
647
|
|
579
648
|
Parameters
|
580
649
|
----------
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
650
|
+
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
651
|
+
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
652
|
+
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
653
|
+
- `current.checkpoint`
|
654
|
+
- `current.model`
|
655
|
+
- `current.huggingface_hub`
|
656
|
+
|
657
|
+
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
658
|
+
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
659
|
+
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
660
|
+
|
661
|
+
temp_dir_root : str, default: None
|
662
|
+
The root directory under which `current.model.loaded` will store loaded models
|
663
|
+
|
664
|
+
|
665
|
+
|
592
666
|
"""
|
593
667
|
...
|
594
668
|
|
595
669
|
@typing.overload
|
596
|
-
def
|
670
|
+
def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
597
671
|
...
|
598
672
|
|
599
673
|
@typing.overload
|
600
|
-
def
|
674
|
+
def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
601
675
|
...
|
602
676
|
|
603
|
-
def
|
677
|
+
def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
|
604
678
|
"""
|
605
|
-
|
606
|
-
|
607
|
-
Use `@resources` to specify the resource requirements
|
608
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
679
|
+
Enables loading / saving of models within a step.
|
609
680
|
|
610
|
-
You can choose the compute layer on the command line by executing e.g.
|
611
|
-
```
|
612
|
-
python myflow.py run --with batch
|
613
|
-
```
|
614
|
-
or
|
615
|
-
```
|
616
|
-
python myflow.py run --with kubernetes
|
617
|
-
```
|
618
|
-
which executes the flow on the desired system using the
|
619
|
-
requirements specified in `@resources`.
|
620
681
|
|
621
682
|
Parameters
|
622
683
|
----------
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
memory : int, default 4096
|
630
|
-
Memory size (in MB) required for this step.
|
631
|
-
shared_memory : int, optional, default None
|
632
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
633
|
-
This parameter maps to the `--shm-size` option in Docker.
|
634
|
-
"""
|
635
|
-
...
|
636
|
-
|
637
|
-
@typing.overload
|
638
|
-
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]]]:
|
639
|
-
"""
|
640
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
684
|
+
load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
|
685
|
+
Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
|
686
|
+
These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
|
687
|
+
- `current.checkpoint`
|
688
|
+
- `current.model`
|
689
|
+
- `current.huggingface_hub`
|
641
690
|
|
642
|
-
|
691
|
+
If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
|
692
|
+
the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
|
693
|
+
If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
|
694
|
+
|
695
|
+
temp_dir_root : str, default: None
|
696
|
+
The root directory under which `current.model.loaded` will store loaded models
|
697
|
+
|
698
|
+
|
699
|
+
|
700
|
+
"""
|
701
|
+
...
|
702
|
+
|
703
|
+
@typing.overload
|
704
|
+
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]]]:
|
705
|
+
"""
|
706
|
+
Specifies the PyPI packages for the step.
|
707
|
+
|
708
|
+
Information in this decorator will augment any
|
709
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
710
|
+
you can use `@pypi_base` to set packages required by all
|
711
|
+
steps and use `@pypi` to specify step-specific overrides.
|
712
|
+
|
713
|
+
Parameters
|
714
|
+
----------
|
715
|
+
packages : Dict[str, str], default: {}
|
716
|
+
Packages to use for this step. The key is the name of the package
|
717
|
+
and the value is the version to use.
|
718
|
+
python : str, optional, default: None
|
719
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
720
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
721
|
+
"""
|
722
|
+
...
|
723
|
+
|
724
|
+
@typing.overload
|
725
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
726
|
+
...
|
727
|
+
|
728
|
+
@typing.overload
|
729
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
730
|
+
...
|
731
|
+
|
732
|
+
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):
|
733
|
+
"""
|
734
|
+
Specifies the PyPI packages for the step.
|
735
|
+
|
736
|
+
Information in this decorator will augment any
|
737
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
738
|
+
you can use `@pypi_base` to set packages required by all
|
739
|
+
steps and use `@pypi` to specify step-specific overrides.
|
740
|
+
|
741
|
+
Parameters
|
742
|
+
----------
|
743
|
+
packages : Dict[str, str], default: {}
|
744
|
+
Packages to use for this step. The key is the name of the package
|
745
|
+
and the value is the version to use.
|
746
|
+
python : str, optional, default: None
|
747
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
748
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
749
|
+
"""
|
750
|
+
...
|
751
|
+
|
752
|
+
@typing.overload
|
753
|
+
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]]]:
|
754
|
+
"""
|
755
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
756
|
+
|
757
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
643
758
|
|
644
759
|
Parameters
|
645
760
|
----------
|
@@ -686,26 +801,62 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
686
801
|
...
|
687
802
|
|
688
803
|
@typing.overload
|
689
|
-
def
|
804
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
690
805
|
"""
|
691
|
-
|
806
|
+
Internal decorator to support Fast bakery
|
807
|
+
"""
|
808
|
+
...
|
809
|
+
|
810
|
+
@typing.overload
|
811
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
812
|
+
...
|
813
|
+
|
814
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
815
|
+
"""
|
816
|
+
Internal decorator to support Fast bakery
|
817
|
+
"""
|
818
|
+
...
|
819
|
+
|
820
|
+
@typing.overload
|
821
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
822
|
+
"""
|
823
|
+
Decorator prototype for all step decorators. This function gets specialized
|
824
|
+
and imported for all decorators types by _import_plugin_decorators().
|
825
|
+
"""
|
826
|
+
...
|
827
|
+
|
828
|
+
@typing.overload
|
829
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
830
|
+
...
|
831
|
+
|
832
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
833
|
+
"""
|
834
|
+
Decorator prototype for all step decorators. This function gets specialized
|
835
|
+
and imported for all decorators types by _import_plugin_decorators().
|
836
|
+
"""
|
837
|
+
...
|
838
|
+
|
839
|
+
@typing.overload
|
840
|
+
def checkpoint(*, load_policy: str = "fresh", temp_dir_root: 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]]]:
|
841
|
+
"""
|
842
|
+
Enables checkpointing for a step.
|
692
843
|
|
693
844
|
|
694
845
|
Parameters
|
695
846
|
----------
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
847
|
+
load_policy : str, default: "fresh"
|
848
|
+
The policy for loading the checkpoint. The following policies are supported:
|
849
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
850
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
851
|
+
will be loaded at the start of the task.
|
852
|
+
- "none": Do not load any checkpoint
|
853
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
854
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
855
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
856
|
+
created within the task will be loaded when the task is retries execution on failure.
|
706
857
|
|
707
858
|
temp_dir_root : str, default: None
|
708
|
-
The root directory under which `current.
|
859
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
709
860
|
|
710
861
|
|
711
862
|
|
@@ -713,33 +864,33 @@ def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[
|
|
713
864
|
...
|
714
865
|
|
715
866
|
@typing.overload
|
716
|
-
def
|
867
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
717
868
|
...
|
718
869
|
|
719
870
|
@typing.overload
|
720
|
-
def
|
871
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
721
872
|
...
|
722
873
|
|
723
|
-
def
|
874
|
+
def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = "fresh", temp_dir_root: str = None):
|
724
875
|
"""
|
725
|
-
Enables
|
876
|
+
Enables checkpointing for a step.
|
726
877
|
|
727
878
|
|
728
879
|
Parameters
|
729
880
|
----------
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
881
|
+
load_policy : str, default: "fresh"
|
882
|
+
The policy for loading the checkpoint. The following policies are supported:
|
883
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
884
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
885
|
+
will be loaded at the start of the task.
|
886
|
+
- "none": Do not load any checkpoint
|
887
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
888
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
889
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
890
|
+
created within the task will be loaded when the task is retries execution on failure.
|
740
891
|
|
741
892
|
temp_dir_root : str, default: None
|
742
|
-
The root directory under which `current.
|
893
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
743
894
|
|
744
895
|
|
745
896
|
|
@@ -747,119 +898,86 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
747
898
|
...
|
748
899
|
|
749
900
|
@typing.overload
|
750
|
-
def
|
901
|
+
def resources(*, cpu: int = 1, gpu: int = 0, 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]]]:
|
751
902
|
"""
|
752
|
-
Specifies
|
753
|
-
|
754
|
-
This decorator is useful if this step may hang indefinitely.
|
903
|
+
Specifies the resources needed when executing this step.
|
755
904
|
|
756
|
-
|
757
|
-
|
758
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
905
|
+
Use `@resources` to specify the resource requirements
|
906
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
759
907
|
|
760
|
-
|
761
|
-
|
908
|
+
You can choose the compute layer on the command line by executing e.g.
|
909
|
+
```
|
910
|
+
python myflow.py run --with batch
|
911
|
+
```
|
912
|
+
or
|
913
|
+
```
|
914
|
+
python myflow.py run --with kubernetes
|
915
|
+
```
|
916
|
+
which executes the flow on the desired system using the
|
917
|
+
requirements specified in `@resources`.
|
762
918
|
|
763
919
|
Parameters
|
764
920
|
----------
|
765
|
-
|
766
|
-
Number of
|
767
|
-
|
768
|
-
Number of
|
769
|
-
|
770
|
-
|
921
|
+
cpu : int, default 1
|
922
|
+
Number of CPUs required for this step.
|
923
|
+
gpu : int, default 0
|
924
|
+
Number of GPUs required for this step.
|
925
|
+
disk : int, optional, default None
|
926
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
927
|
+
memory : int, default 4096
|
928
|
+
Memory size (in MB) required for this step.
|
929
|
+
shared_memory : int, optional, default None
|
930
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
931
|
+
This parameter maps to the `--shm-size` option in Docker.
|
771
932
|
"""
|
772
933
|
...
|
773
934
|
|
774
935
|
@typing.overload
|
775
|
-
def
|
936
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
776
937
|
...
|
777
938
|
|
778
939
|
@typing.overload
|
779
|
-
def
|
940
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
780
941
|
...
|
781
942
|
|
782
|
-
def
|
943
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
783
944
|
"""
|
784
|
-
Specifies
|
785
|
-
|
786
|
-
This decorator is useful if this step may hang indefinitely.
|
945
|
+
Specifies the resources needed when executing this step.
|
787
946
|
|
788
|
-
|
789
|
-
|
790
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
947
|
+
Use `@resources` to specify the resource requirements
|
948
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
791
949
|
|
792
|
-
|
793
|
-
|
950
|
+
You can choose the compute layer on the command line by executing e.g.
|
951
|
+
```
|
952
|
+
python myflow.py run --with batch
|
953
|
+
```
|
954
|
+
or
|
955
|
+
```
|
956
|
+
python myflow.py run --with kubernetes
|
957
|
+
```
|
958
|
+
which executes the flow on the desired system using the
|
959
|
+
requirements specified in `@resources`.
|
794
960
|
|
795
961
|
Parameters
|
796
962
|
----------
|
797
|
-
|
798
|
-
Number of
|
799
|
-
|
800
|
-
Number of
|
801
|
-
|
802
|
-
|
963
|
+
cpu : int, default 1
|
964
|
+
Number of CPUs required for this step.
|
965
|
+
gpu : int, default 0
|
966
|
+
Number of GPUs required for this step.
|
967
|
+
disk : int, optional, default None
|
968
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
969
|
+
memory : int, default 4096
|
970
|
+
Memory size (in MB) required for this step.
|
971
|
+
shared_memory : int, optional, default None
|
972
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
973
|
+
This parameter maps to the `--shm-size` option in Docker.
|
803
974
|
"""
|
804
975
|
...
|
805
976
|
|
806
977
|
@typing.overload
|
807
|
-
def
|
978
|
+
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]]]:
|
808
979
|
"""
|
809
|
-
Specifies
|
810
|
-
to a step needs to be retried.
|
811
|
-
|
812
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
813
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
814
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
815
|
-
|
816
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
817
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
818
|
-
ensuring that the flow execution can continue.
|
819
|
-
|
820
|
-
Parameters
|
821
|
-
----------
|
822
|
-
times : int, default 3
|
823
|
-
Number of times to retry this task.
|
824
|
-
minutes_between_retries : int, default 2
|
825
|
-
Number of minutes between retries.
|
826
|
-
"""
|
827
|
-
...
|
828
|
-
|
829
|
-
@typing.overload
|
830
|
-
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
831
|
-
...
|
832
|
-
|
833
|
-
@typing.overload
|
834
|
-
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
835
|
-
...
|
836
|
-
|
837
|
-
def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
|
838
|
-
"""
|
839
|
-
Specifies the number of times the task corresponding
|
840
|
-
to a step needs to be retried.
|
841
|
-
|
842
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
843
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
844
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
845
|
-
|
846
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
847
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
848
|
-
ensuring that the flow execution can continue.
|
849
|
-
|
850
|
-
Parameters
|
851
|
-
----------
|
852
|
-
times : int, default 3
|
853
|
-
Number of times to retry this task.
|
854
|
-
minutes_between_retries : int, default 2
|
855
|
-
Number of minutes between retries.
|
856
|
-
"""
|
857
|
-
...
|
858
|
-
|
859
|
-
@typing.overload
|
860
|
-
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]]]:
|
861
|
-
"""
|
862
|
-
Specifies environment variables to be set prior to the execution of a step.
|
980
|
+
Specifies environment variables to be set prior to the execution of a step.
|
863
981
|
|
864
982
|
Parameters
|
865
983
|
----------
|
@@ -888,198 +1006,126 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
|
|
888
1006
|
...
|
889
1007
|
|
890
1008
|
@typing.overload
|
891
|
-
def
|
892
|
-
"""
|
893
|
-
Internal decorator to support Fast bakery
|
894
|
-
"""
|
895
|
-
...
|
896
|
-
|
897
|
-
@typing.overload
|
898
|
-
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
899
|
-
...
|
900
|
-
|
901
|
-
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
902
|
-
"""
|
903
|
-
Internal decorator to support Fast bakery
|
904
|
-
"""
|
905
|
-
...
|
906
|
-
|
907
|
-
@typing.overload
|
908
|
-
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]]]:
|
1009
|
+
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]]]:
|
909
1010
|
"""
|
910
|
-
Specifies
|
1011
|
+
Specifies a timeout for your step.
|
911
1012
|
|
912
|
-
|
913
|
-
contains the exception raised. You can use it to detect the presence
|
914
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
915
|
-
are missing.
|
1013
|
+
This decorator is useful if this step may hang indefinitely.
|
916
1014
|
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
Name of the artifact in which to store the caught exception.
|
921
|
-
If not specified, the exception is not stored.
|
922
|
-
print_exception : bool, default True
|
923
|
-
Determines whether or not the exception is printed to
|
924
|
-
stdout when caught.
|
925
|
-
"""
|
926
|
-
...
|
927
|
-
|
928
|
-
@typing.overload
|
929
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
930
|
-
...
|
931
|
-
|
932
|
-
@typing.overload
|
933
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
934
|
-
...
|
935
|
-
|
936
|
-
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):
|
937
|
-
"""
|
938
|
-
Specifies that the step will success under all circumstances.
|
1015
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1016
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1017
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
939
1018
|
|
940
|
-
|
941
|
-
|
942
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
943
|
-
are missing.
|
1019
|
+
Note that all the values specified in parameters are added together so if you specify
|
1020
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
944
1021
|
|
945
1022
|
Parameters
|
946
1023
|
----------
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
1024
|
+
seconds : int, default 0
|
1025
|
+
Number of seconds to wait prior to timing out.
|
1026
|
+
minutes : int, default 0
|
1027
|
+
Number of minutes to wait prior to timing out.
|
1028
|
+
hours : int, default 0
|
1029
|
+
Number of hours to wait prior to timing out.
|
953
1030
|
"""
|
954
1031
|
...
|
955
1032
|
|
956
1033
|
@typing.overload
|
957
|
-
def
|
958
|
-
"""
|
959
|
-
Decorator prototype for all step decorators. This function gets specialized
|
960
|
-
and imported for all decorators types by _import_plugin_decorators().
|
961
|
-
"""
|
1034
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
962
1035
|
...
|
963
1036
|
|
964
1037
|
@typing.overload
|
965
|
-
def
|
966
|
-
...
|
967
|
-
|
968
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
969
|
-
"""
|
970
|
-
Decorator prototype for all step decorators. This function gets specialized
|
971
|
-
and imported for all decorators types by _import_plugin_decorators().
|
972
|
-
"""
|
1038
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
973
1039
|
...
|
974
1040
|
|
975
|
-
|
976
|
-
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]]]:
|
1041
|
+
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):
|
977
1042
|
"""
|
978
|
-
Specifies
|
979
|
-
the execution of a step.
|
1043
|
+
Specifies a timeout for your step.
|
980
1044
|
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
990
|
-
...
|
991
|
-
|
992
|
-
@typing.overload
|
993
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
994
|
-
...
|
995
|
-
|
996
|
-
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]]] = []):
|
997
|
-
"""
|
998
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
999
|
-
the execution of a step.
|
1045
|
+
This decorator is useful if this step may hang indefinitely.
|
1046
|
+
|
1047
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1048
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1049
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1050
|
+
|
1051
|
+
Note that all the values specified in parameters are added together so if you specify
|
1052
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1000
1053
|
|
1001
1054
|
Parameters
|
1002
1055
|
----------
|
1003
|
-
|
1004
|
-
|
1056
|
+
seconds : int, default 0
|
1057
|
+
Number of seconds to wait prior to timing out.
|
1058
|
+
minutes : int, default 0
|
1059
|
+
Number of minutes to wait prior to timing out.
|
1060
|
+
hours : int, default 0
|
1061
|
+
Number of hours to wait prior to timing out.
|
1005
1062
|
"""
|
1006
1063
|
...
|
1007
1064
|
|
1008
1065
|
@typing.overload
|
1009
|
-
def
|
1066
|
+
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]]]:
|
1010
1067
|
"""
|
1011
|
-
|
1068
|
+
Specifies the number of times the task corresponding
|
1069
|
+
to a step needs to be retried.
|
1070
|
+
|
1071
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1072
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1073
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1012
1074
|
|
1075
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1076
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1077
|
+
ensuring that the flow execution can continue.
|
1013
1078
|
|
1014
1079
|
Parameters
|
1015
1080
|
----------
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
will be loaded at the start of the task.
|
1021
|
-
- "none": Do not load any checkpoint
|
1022
|
-
- "fresh": Loads the lastest checkpoint created within the running Task.
|
1023
|
-
This mode helps loading checkpoints across various retry attempts of the same task.
|
1024
|
-
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
1025
|
-
created within the task will be loaded when the task is retries execution on failure.
|
1026
|
-
|
1027
|
-
temp_dir_root : str, default: None
|
1028
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1081
|
+
times : int, default 3
|
1082
|
+
Number of times to retry this task.
|
1083
|
+
minutes_between_retries : int, default 2
|
1084
|
+
Number of minutes between retries.
|
1032
1085
|
"""
|
1033
1086
|
...
|
1034
1087
|
|
1035
1088
|
@typing.overload
|
1036
|
-
def
|
1089
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1037
1090
|
...
|
1038
1091
|
|
1039
1092
|
@typing.overload
|
1040
|
-
def
|
1093
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1041
1094
|
...
|
1042
1095
|
|
1043
|
-
def
|
1096
|
+
def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
|
1044
1097
|
"""
|
1045
|
-
|
1098
|
+
Specifies the number of times the task corresponding
|
1099
|
+
to a step needs to be retried.
|
1100
|
+
|
1101
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1102
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1103
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1046
1104
|
|
1105
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1106
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1107
|
+
ensuring that the flow execution can continue.
|
1047
1108
|
|
1048
1109
|
Parameters
|
1049
1110
|
----------
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
will be loaded at the start of the task.
|
1055
|
-
- "none": Do not load any checkpoint
|
1056
|
-
- "fresh": Loads the lastest checkpoint created within the running Task.
|
1057
|
-
This mode helps loading checkpoints across various retry attempts of the same task.
|
1058
|
-
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
1059
|
-
created within the task will be loaded when the task is retries execution on failure.
|
1060
|
-
|
1061
|
-
temp_dir_root : str, default: None
|
1062
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1111
|
+
times : int, default 3
|
1112
|
+
Number of times to retry this task.
|
1113
|
+
minutes_between_retries : int, default 2
|
1114
|
+
Number of minutes between retries.
|
1066
1115
|
"""
|
1067
1116
|
...
|
1068
1117
|
|
1069
1118
|
@typing.overload
|
1070
|
-
def
|
1119
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1071
1120
|
"""
|
1072
|
-
Specifies the PyPI packages for the
|
1121
|
+
Specifies the PyPI packages for all steps of the flow.
|
1073
1122
|
|
1074
|
-
|
1075
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1076
|
-
you can use `@pypi_base` to set packages required by all
|
1123
|
+
Use `@pypi_base` to set common packages required by all
|
1077
1124
|
steps and use `@pypi` to specify step-specific overrides.
|
1078
|
-
|
1079
1125
|
Parameters
|
1080
1126
|
----------
|
1081
1127
|
packages : Dict[str, str], default: {}
|
1082
|
-
Packages to use for this
|
1128
|
+
Packages to use for this flow. The key is the name of the package
|
1083
1129
|
and the value is the version to use.
|
1084
1130
|
python : str, optional, default: None
|
1085
1131
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
@@ -1088,121 +1134,23 @@ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] =
|
|
1088
1134
|
...
|
1089
1135
|
|
1090
1136
|
@typing.overload
|
1091
|
-
def
|
1092
|
-
...
|
1093
|
-
|
1094
|
-
@typing.overload
|
1095
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1137
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1096
1138
|
...
|
1097
1139
|
|
1098
|
-
def
|
1140
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1099
1141
|
"""
|
1100
|
-
Specifies the PyPI packages for the
|
1142
|
+
Specifies the PyPI packages for all steps of the flow.
|
1101
1143
|
|
1102
|
-
|
1103
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1104
|
-
you can use `@pypi_base` to set packages required by all
|
1144
|
+
Use `@pypi_base` to set common packages required by all
|
1105
1145
|
steps and use `@pypi` to specify step-specific overrides.
|
1106
|
-
|
1107
1146
|
Parameters
|
1108
1147
|
----------
|
1109
1148
|
packages : Dict[str, str], default: {}
|
1110
|
-
Packages to use for this step. The key is the name of the package
|
1111
|
-
and the value is the version to use.
|
1112
|
-
python : str, optional, default: None
|
1113
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1114
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1115
|
-
"""
|
1116
|
-
...
|
1117
|
-
|
1118
|
-
@typing.overload
|
1119
|
-
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]]:
|
1120
|
-
"""
|
1121
|
-
Specifies the Conda environment for all steps of the flow.
|
1122
|
-
|
1123
|
-
Use `@conda_base` to set common libraries required by all
|
1124
|
-
steps and use `@conda` to specify step-specific additions.
|
1125
|
-
|
1126
|
-
Parameters
|
1127
|
-
----------
|
1128
|
-
packages : Dict[str, str], default {}
|
1129
|
-
Packages to use for this flow. The key is the name of the package
|
1130
|
-
and the value is the version to use.
|
1131
|
-
libraries : Dict[str, str], default {}
|
1132
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1133
|
-
python : str, optional, default None
|
1134
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1135
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1136
|
-
disabled : bool, default False
|
1137
|
-
If set to True, disables Conda.
|
1138
|
-
"""
|
1139
|
-
...
|
1140
|
-
|
1141
|
-
@typing.overload
|
1142
|
-
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1143
|
-
...
|
1144
|
-
|
1145
|
-
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):
|
1146
|
-
"""
|
1147
|
-
Specifies the Conda environment for all steps of the flow.
|
1148
|
-
|
1149
|
-
Use `@conda_base` to set common libraries required by all
|
1150
|
-
steps and use `@conda` to specify step-specific additions.
|
1151
|
-
|
1152
|
-
Parameters
|
1153
|
-
----------
|
1154
|
-
packages : Dict[str, str], default {}
|
1155
1149
|
Packages to use for this flow. The key is the name of the package
|
1156
1150
|
and the value is the version to use.
|
1157
|
-
|
1158
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1159
|
-
python : str, optional, default None
|
1151
|
+
python : str, optional, default: None
|
1160
1152
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1161
1153
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1162
|
-
disabled : bool, default False
|
1163
|
-
If set to True, disables Conda.
|
1164
|
-
"""
|
1165
|
-
...
|
1166
|
-
|
1167
|
-
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]]:
|
1168
|
-
"""
|
1169
|
-
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.
|
1170
|
-
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.
|
1171
|
-
|
1172
|
-
Parameters
|
1173
|
-
----------
|
1174
|
-
timeout : int
|
1175
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1176
|
-
poke_interval : int
|
1177
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1178
|
-
mode : str
|
1179
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1180
|
-
exponential_backoff : bool
|
1181
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1182
|
-
pool : str
|
1183
|
-
the slot pool this task should run in,
|
1184
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1185
|
-
soft_fail : bool
|
1186
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1187
|
-
name : str
|
1188
|
-
Name of the sensor on Airflow
|
1189
|
-
description : str
|
1190
|
-
Description of sensor in the Airflow UI
|
1191
|
-
external_dag_id : str
|
1192
|
-
The dag_id that contains the task you want to wait for.
|
1193
|
-
external_task_ids : List[str]
|
1194
|
-
The list of task_ids that you want to wait for.
|
1195
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
1196
|
-
allowed_states : List[str]
|
1197
|
-
Iterable of allowed states, (Default: ['success'])
|
1198
|
-
failed_states : List[str]
|
1199
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
1200
|
-
execution_delta : datetime.timedelta
|
1201
|
-
time difference with the previous execution to look at,
|
1202
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
1203
|
-
check_existence: bool
|
1204
|
-
Set to True to check if the external task exists or check if
|
1205
|
-
the DAG to wait for exists. (Default: True)
|
1206
1154
|
"""
|
1207
1155
|
...
|
1208
1156
|
|
@@ -1237,151 +1185,98 @@ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[Fl
|
|
1237
1185
|
"""
|
1238
1186
|
...
|
1239
1187
|
|
1240
|
-
|
1188
|
+
@typing.overload
|
1189
|
+
def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1241
1190
|
"""
|
1242
|
-
Specifies
|
1243
|
-
|
1244
|
-
A project-specific namespace is created for all flows that
|
1245
|
-
use the same `@project(name)`.
|
1191
|
+
Specifies the event(s) that this flow depends on.
|
1246
1192
|
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1193
|
+
```
|
1194
|
+
@trigger(event='foo')
|
1195
|
+
```
|
1196
|
+
or
|
1197
|
+
```
|
1198
|
+
@trigger(events=['foo', 'bar'])
|
1199
|
+
```
|
1253
1200
|
|
1201
|
+
Additionally, you can specify the parameter mappings
|
1202
|
+
to map event payload to Metaflow parameters for the flow.
|
1203
|
+
```
|
1204
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1205
|
+
```
|
1206
|
+
or
|
1207
|
+
```
|
1208
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1209
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1210
|
+
```
|
1254
1211
|
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1212
|
+
'parameters' can also be a list of strings and tuples like so:
|
1213
|
+
```
|
1214
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1215
|
+
```
|
1216
|
+
This is equivalent to:
|
1217
|
+
```
|
1218
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1219
|
+
```
|
1263
1220
|
|
1264
1221
|
Parameters
|
1265
1222
|
----------
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
cron : str, optional, default None
|
1273
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1274
|
-
specified by this expression.
|
1275
|
-
timezone : str, optional, default None
|
1276
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1277
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1278
|
-
"""
|
1279
|
-
...
|
1280
|
-
|
1281
|
-
@typing.overload
|
1282
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1283
|
-
...
|
1284
|
-
|
1285
|
-
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
1286
|
-
"""
|
1287
|
-
Specifies the times when the flow should be run when running on a
|
1288
|
-
production scheduler.
|
1223
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1224
|
+
Event dependency for this flow.
|
1225
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1226
|
+
Events dependency for this flow.
|
1227
|
+
options : Dict[str, Any], default {}
|
1228
|
+
Backend-specific configuration for tuning eventing behavior.
|
1289
1229
|
|
1290
|
-
Parameters
|
1291
|
-
----------
|
1292
|
-
hourly : bool, default False
|
1293
|
-
Run the workflow hourly.
|
1294
|
-
daily : bool, default True
|
1295
|
-
Run the workflow daily.
|
1296
|
-
weekly : bool, default False
|
1297
|
-
Run the workflow weekly.
|
1298
|
-
cron : str, optional, default None
|
1299
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1300
|
-
specified by this expression.
|
1301
|
-
timezone : str, optional, default None
|
1302
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1303
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1304
|
-
"""
|
1305
|
-
...
|
1306
|
-
|
1307
|
-
@typing.overload
|
1308
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1309
|
-
"""
|
1310
|
-
Specifies the PyPI packages for all steps of the flow.
|
1311
1230
|
|
1312
|
-
Use `@pypi_base` to set common packages required by all
|
1313
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1314
|
-
Parameters
|
1315
|
-
----------
|
1316
|
-
packages : Dict[str, str], default: {}
|
1317
|
-
Packages to use for this flow. The key is the name of the package
|
1318
|
-
and the value is the version to use.
|
1319
|
-
python : str, optional, default: None
|
1320
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1321
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1322
1231
|
"""
|
1323
1232
|
...
|
1324
1233
|
|
1325
1234
|
@typing.overload
|
1326
|
-
def
|
1235
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1327
1236
|
...
|
1328
1237
|
|
1329
|
-
def
|
1238
|
+
def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
1330
1239
|
"""
|
1331
|
-
Specifies the
|
1240
|
+
Specifies the event(s) that this flow depends on.
|
1241
|
+
|
1242
|
+
```
|
1243
|
+
@trigger(event='foo')
|
1244
|
+
```
|
1245
|
+
or
|
1246
|
+
```
|
1247
|
+
@trigger(events=['foo', 'bar'])
|
1248
|
+
```
|
1249
|
+
|
1250
|
+
Additionally, you can specify the parameter mappings
|
1251
|
+
to map event payload to Metaflow parameters for the flow.
|
1252
|
+
```
|
1253
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1254
|
+
```
|
1255
|
+
or
|
1256
|
+
```
|
1257
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1258
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1259
|
+
```
|
1260
|
+
|
1261
|
+
'parameters' can also be a list of strings and tuples like so:
|
1262
|
+
```
|
1263
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1264
|
+
```
|
1265
|
+
This is equivalent to:
|
1266
|
+
```
|
1267
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1268
|
+
```
|
1269
|
+
|
1270
|
+
Parameters
|
1271
|
+
----------
|
1272
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1273
|
+
Event dependency for this flow.
|
1274
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1275
|
+
Events dependency for this flow.
|
1276
|
+
options : Dict[str, Any], default {}
|
1277
|
+
Backend-specific configuration for tuning eventing behavior.
|
1332
1278
|
|
1333
|
-
Use `@pypi_base` to set common packages required by all
|
1334
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1335
|
-
Parameters
|
1336
|
-
----------
|
1337
|
-
packages : Dict[str, str], default: {}
|
1338
|
-
Packages to use for this flow. The key is the name of the package
|
1339
|
-
and the value is the version to use.
|
1340
|
-
python : str, optional, default: None
|
1341
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1342
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1343
|
-
"""
|
1344
|
-
...
|
1345
|
-
|
1346
|
-
def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1347
|
-
"""
|
1348
|
-
The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
|
1349
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1350
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1351
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1352
|
-
starts only after all sensors finish.
|
1353
1279
|
|
1354
|
-
Parameters
|
1355
|
-
----------
|
1356
|
-
timeout : int
|
1357
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1358
|
-
poke_interval : int
|
1359
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1360
|
-
mode : str
|
1361
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1362
|
-
exponential_backoff : bool
|
1363
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1364
|
-
pool : str
|
1365
|
-
the slot pool this task should run in,
|
1366
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1367
|
-
soft_fail : bool
|
1368
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1369
|
-
name : str
|
1370
|
-
Name of the sensor on Airflow
|
1371
|
-
description : str
|
1372
|
-
Description of sensor in the Airflow UI
|
1373
|
-
bucket_key : Union[str, List[str]]
|
1374
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1375
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1376
|
-
bucket_name : str
|
1377
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1378
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1379
|
-
wildcard_match : bool
|
1380
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1381
|
-
aws_conn_id : str
|
1382
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1383
|
-
verify : bool
|
1384
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1385
1280
|
"""
|
1386
1281
|
...
|
1387
1282
|
|
@@ -1488,98 +1383,203 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1488
1383
|
"""
|
1489
1384
|
...
|
1490
1385
|
|
1491
|
-
|
1492
|
-
def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1386
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1493
1387
|
"""
|
1494
|
-
Specifies
|
1388
|
+
Specifies what flows belong to the same project.
|
1495
1389
|
|
1496
|
-
|
1497
|
-
|
1498
|
-
```
|
1499
|
-
or
|
1500
|
-
```
|
1501
|
-
@trigger(events=['foo', 'bar'])
|
1502
|
-
```
|
1390
|
+
A project-specific namespace is created for all flows that
|
1391
|
+
use the same `@project(name)`.
|
1503
1392
|
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
```
|
1511
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1512
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1513
|
-
```
|
1393
|
+
Parameters
|
1394
|
+
----------
|
1395
|
+
name : str
|
1396
|
+
Project name. Make sure that the name is unique amongst all
|
1397
|
+
projects that use the same production scheduler. The name may
|
1398
|
+
contain only lowercase alphanumeric characters and underscores.
|
1514
1399
|
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1400
|
+
|
1401
|
+
"""
|
1402
|
+
...
|
1403
|
+
|
1404
|
+
def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1405
|
+
"""
|
1406
|
+
The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
|
1407
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1408
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1409
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1410
|
+
starts only after all sensors finish.
|
1523
1411
|
|
1524
1412
|
Parameters
|
1525
1413
|
----------
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1414
|
+
timeout : int
|
1415
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1416
|
+
poke_interval : int
|
1417
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1418
|
+
mode : str
|
1419
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1420
|
+
exponential_backoff : bool
|
1421
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1422
|
+
pool : str
|
1423
|
+
the slot pool this task should run in,
|
1424
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1425
|
+
soft_fail : bool
|
1426
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1427
|
+
name : str
|
1428
|
+
Name of the sensor on Airflow
|
1429
|
+
description : str
|
1430
|
+
Description of sensor in the Airflow UI
|
1431
|
+
bucket_key : Union[str, List[str]]
|
1432
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1433
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1434
|
+
bucket_name : str
|
1435
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1436
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1437
|
+
wildcard_match : bool
|
1438
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1439
|
+
aws_conn_id : str
|
1440
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1441
|
+
verify : bool
|
1442
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1443
|
+
"""
|
1444
|
+
...
|
1445
|
+
|
1446
|
+
@typing.overload
|
1447
|
+
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]]:
|
1448
|
+
"""
|
1449
|
+
Specifies the Conda environment for all steps of the flow.
|
1532
1450
|
|
1451
|
+
Use `@conda_base` to set common libraries required by all
|
1452
|
+
steps and use `@conda` to specify step-specific additions.
|
1533
1453
|
|
1454
|
+
Parameters
|
1455
|
+
----------
|
1456
|
+
packages : Dict[str, str], default {}
|
1457
|
+
Packages to use for this flow. The key is the name of the package
|
1458
|
+
and the value is the version to use.
|
1459
|
+
libraries : Dict[str, str], default {}
|
1460
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1461
|
+
python : str, optional, default None
|
1462
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1463
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1464
|
+
disabled : bool, default False
|
1465
|
+
If set to True, disables Conda.
|
1534
1466
|
"""
|
1535
1467
|
...
|
1536
1468
|
|
1537
1469
|
@typing.overload
|
1538
|
-
def
|
1470
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1539
1471
|
...
|
1540
1472
|
|
1541
|
-
def
|
1473
|
+
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):
|
1542
1474
|
"""
|
1543
|
-
Specifies the
|
1544
|
-
|
1545
|
-
```
|
1546
|
-
@trigger(event='foo')
|
1547
|
-
```
|
1548
|
-
or
|
1549
|
-
```
|
1550
|
-
@trigger(events=['foo', 'bar'])
|
1551
|
-
```
|
1475
|
+
Specifies the Conda environment for all steps of the flow.
|
1552
1476
|
|
1553
|
-
|
1554
|
-
|
1555
|
-
```
|
1556
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1557
|
-
```
|
1558
|
-
or
|
1559
|
-
```
|
1560
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1561
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1562
|
-
```
|
1477
|
+
Use `@conda_base` to set common libraries required by all
|
1478
|
+
steps and use `@conda` to specify step-specific additions.
|
1563
1479
|
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1480
|
+
Parameters
|
1481
|
+
----------
|
1482
|
+
packages : Dict[str, str], default {}
|
1483
|
+
Packages to use for this flow. The key is the name of the package
|
1484
|
+
and the value is the version to use.
|
1485
|
+
libraries : Dict[str, str], default {}
|
1486
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1487
|
+
python : str, optional, default None
|
1488
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1489
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1490
|
+
disabled : bool, default False
|
1491
|
+
If set to True, disables Conda.
|
1492
|
+
"""
|
1493
|
+
...
|
1494
|
+
|
1495
|
+
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]]:
|
1496
|
+
"""
|
1497
|
+
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.
|
1498
|
+
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.
|
1572
1499
|
|
1573
1500
|
Parameters
|
1574
1501
|
----------
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1502
|
+
timeout : int
|
1503
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1504
|
+
poke_interval : int
|
1505
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1506
|
+
mode : str
|
1507
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1508
|
+
exponential_backoff : bool
|
1509
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1510
|
+
pool : str
|
1511
|
+
the slot pool this task should run in,
|
1512
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1513
|
+
soft_fail : bool
|
1514
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1515
|
+
name : str
|
1516
|
+
Name of the sensor on Airflow
|
1517
|
+
description : str
|
1518
|
+
Description of sensor in the Airflow UI
|
1519
|
+
external_dag_id : str
|
1520
|
+
The dag_id that contains the task you want to wait for.
|
1521
|
+
external_task_ids : List[str]
|
1522
|
+
The list of task_ids that you want to wait for.
|
1523
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1524
|
+
allowed_states : List[str]
|
1525
|
+
Iterable of allowed states, (Default: ['success'])
|
1526
|
+
failed_states : List[str]
|
1527
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1528
|
+
execution_delta : datetime.timedelta
|
1529
|
+
time difference with the previous execution to look at,
|
1530
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1531
|
+
check_existence: bool
|
1532
|
+
Set to True to check if the external task exists or check if
|
1533
|
+
the DAG to wait for exists. (Default: True)
|
1534
|
+
"""
|
1535
|
+
...
|
1536
|
+
|
1537
|
+
@typing.overload
|
1538
|
+
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]]:
|
1539
|
+
"""
|
1540
|
+
Specifies the times when the flow should be run when running on a
|
1541
|
+
production scheduler.
|
1581
1542
|
|
1543
|
+
Parameters
|
1544
|
+
----------
|
1545
|
+
hourly : bool, default False
|
1546
|
+
Run the workflow hourly.
|
1547
|
+
daily : bool, default True
|
1548
|
+
Run the workflow daily.
|
1549
|
+
weekly : bool, default False
|
1550
|
+
Run the workflow weekly.
|
1551
|
+
cron : str, optional, default None
|
1552
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1553
|
+
specified by this expression.
|
1554
|
+
timezone : str, optional, default None
|
1555
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1556
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1557
|
+
"""
|
1558
|
+
...
|
1559
|
+
|
1560
|
+
@typing.overload
|
1561
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1562
|
+
...
|
1563
|
+
|
1564
|
+
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):
|
1565
|
+
"""
|
1566
|
+
Specifies the times when the flow should be run when running on a
|
1567
|
+
production scheduler.
|
1582
1568
|
|
1569
|
+
Parameters
|
1570
|
+
----------
|
1571
|
+
hourly : bool, default False
|
1572
|
+
Run the workflow hourly.
|
1573
|
+
daily : bool, default True
|
1574
|
+
Run the workflow daily.
|
1575
|
+
weekly : bool, default False
|
1576
|
+
Run the workflow weekly.
|
1577
|
+
cron : str, optional, default None
|
1578
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1579
|
+
specified by this expression.
|
1580
|
+
timezone : str, optional, default None
|
1581
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1582
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1583
1583
|
"""
|
1584
1584
|
...
|
1585
1585
|
|