ob-metaflow-stubs 4.4__py2.py3-none-any.whl → 4.6__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 +479 -479
- metaflow-stubs/cards.pyi +3 -3
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +6 -6
- metaflow-stubs/client/filecache.pyi +1 -1
- metaflow-stubs/clone_util.pyi +1 -1
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +1 -1
- metaflow-stubs/flowspec.pyi +2 -2
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- 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 +17 -17
- metaflow-stubs/mflog/mflog.pyi +1 -1
- metaflow-stubs/multicore_utils.pyi +1 -1
- metaflow-stubs/parameters.pyi +3 -3
- metaflow-stubs/plugins/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/airflow.pyi +3 -3
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +3 -3
- metaflow-stubs/plugins/airflow/airflow_decorator.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 +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 +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 +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- 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_cli.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 +3 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.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_cli.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +1 -1
- 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 +3 -3
- 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 +2 -2
- metaflow-stubs/plugins/cards/card_client.pyi +1 -1
- 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 +1 -1
- metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/components.pyi +1 -1
- 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 +1 -1
- 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 +4 -4
- 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 +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
- 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/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 +2 -2
- metaflow-stubs/plugins/logs_cli.pyi +2 -2
- metaflow-stubs/plugins/package_cli.pyi +1 -1
- metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
- metaflow-stubs/plugins/perimeters.pyi +3 -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 +3 -3
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- 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/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbrun.pyi +1 -1
- metaflow-stubs/runner/subprocess_manager.pyi +1 -1
- metaflow-stubs/system/__init__.pyi +3 -3
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +1 -1
- metaflow-stubs/tuple_util.pyi +1 -1
- {ob_metaflow_stubs-4.4.dist-info → ob_metaflow_stubs-4.6.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-4.6.dist-info/RECORD +145 -0
- ob_metaflow_stubs-4.4.dist-info/RECORD +0 -145
- {ob_metaflow_stubs-4.4.dist-info → ob_metaflow_stubs-4.6.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-4.4.dist-info → ob_metaflow_stubs-4.6.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
3
|
# MF version: 2.12.7.1+ob(v1) #
|
4
|
-
# Generated on 2024-07-
|
4
|
+
# Generated on 2024-07-12T16:22:02.506423 #
|
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.
|
12
|
-
import metaflow.client.core
|
13
|
-
import typing
|
11
|
+
import metaflow.metaflow_current
|
14
12
|
import metaflow.flowspec
|
15
|
-
import
|
16
|
-
import metaflow.
|
13
|
+
import typing
|
14
|
+
import metaflow.client.core
|
17
15
|
import metaflow.runner.metaflow_runner
|
18
16
|
import io
|
19
|
-
import metaflow.
|
17
|
+
import metaflow.parameters
|
20
18
|
import datetime
|
19
|
+
import metaflow._vendor.click.types
|
20
|
+
import metaflow.plugins.datatools.s3.s3
|
21
|
+
import metaflow.events
|
21
22
|
import metaflow.datastore.inputs
|
22
|
-
import metaflow.metaflow_current
|
23
23
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
24
24
|
StepFlag = typing.NewType("StepFlag", bool)
|
25
25
|
|
@@ -728,149 +728,219 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
728
728
|
...
|
729
729
|
|
730
730
|
@typing.overload
|
731
|
-
def
|
731
|
+
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]]]:
|
732
732
|
"""
|
733
|
-
Specifies
|
734
|
-
|
735
|
-
Information in this decorator will augment any
|
736
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
737
|
-
you can use `@conda_base` to set packages required by all
|
738
|
-
steps and use `@conda` to specify step-specific overrides.
|
733
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
734
|
+
the execution of a step.
|
739
735
|
|
740
736
|
Parameters
|
741
737
|
----------
|
742
|
-
|
743
|
-
|
744
|
-
and the value is the version to use.
|
745
|
-
libraries : Dict[str, str], default {}
|
746
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
747
|
-
python : str, optional, default None
|
748
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
749
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
750
|
-
disabled : bool, default False
|
751
|
-
If set to True, disables @conda.
|
738
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
739
|
+
List of secret specs, defining how the secrets are to be retrieved
|
752
740
|
"""
|
753
741
|
...
|
754
742
|
|
755
743
|
@typing.overload
|
756
|
-
def
|
744
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
757
745
|
...
|
758
746
|
|
759
747
|
@typing.overload
|
760
|
-
def
|
748
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
761
749
|
...
|
762
750
|
|
763
|
-
def
|
751
|
+
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]]] = []):
|
764
752
|
"""
|
765
|
-
Specifies
|
753
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
754
|
+
the execution of a step.
|
766
755
|
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
756
|
+
Parameters
|
757
|
+
----------
|
758
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
759
|
+
List of secret specs, defining how the secrets are to be retrieved
|
760
|
+
"""
|
761
|
+
...
|
762
|
+
|
763
|
+
@typing.overload
|
764
|
+
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]]]:
|
765
|
+
"""
|
766
|
+
Specifies that the step will success under all circumstances.
|
767
|
+
|
768
|
+
The decorator will create an optional artifact, specified by `var`, which
|
769
|
+
contains the exception raised. You can use it to detect the presence
|
770
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
771
|
+
are missing.
|
771
772
|
|
772
773
|
Parameters
|
773
774
|
----------
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
781
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
782
|
-
disabled : bool, default False
|
783
|
-
If set to True, disables @conda.
|
775
|
+
var : str, optional, default None
|
776
|
+
Name of the artifact in which to store the caught exception.
|
777
|
+
If not specified, the exception is not stored.
|
778
|
+
print_exception : bool, default True
|
779
|
+
Determines whether or not the exception is printed to
|
780
|
+
stdout when caught.
|
784
781
|
"""
|
785
782
|
...
|
786
783
|
|
787
784
|
@typing.overload
|
788
|
-
def
|
785
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
786
|
+
...
|
787
|
+
|
788
|
+
@typing.overload
|
789
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
790
|
+
...
|
791
|
+
|
792
|
+
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):
|
789
793
|
"""
|
790
|
-
Specifies
|
794
|
+
Specifies that the step will success under all circumstances.
|
791
795
|
|
792
|
-
|
796
|
+
The decorator will create an optional artifact, specified by `var`, which
|
797
|
+
contains the exception raised. You can use it to detect the presence
|
798
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
799
|
+
are missing.
|
793
800
|
|
794
|
-
|
795
|
-
|
796
|
-
|
801
|
+
Parameters
|
802
|
+
----------
|
803
|
+
var : str, optional, default None
|
804
|
+
Name of the artifact in which to store the caught exception.
|
805
|
+
If not specified, the exception is not stored.
|
806
|
+
print_exception : bool, default True
|
807
|
+
Determines whether or not the exception is printed to
|
808
|
+
stdout when caught.
|
809
|
+
"""
|
810
|
+
...
|
811
|
+
|
812
|
+
@typing.overload
|
813
|
+
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]]]:
|
814
|
+
"""
|
815
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
797
816
|
|
798
|
-
Note that
|
799
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
817
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
800
818
|
|
801
819
|
Parameters
|
802
820
|
----------
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
821
|
+
type : str, default 'default'
|
822
|
+
Card type.
|
823
|
+
id : str, optional, default None
|
824
|
+
If multiple cards are present, use this id to identify this card.
|
825
|
+
options : Dict[str, Any], default {}
|
826
|
+
Options passed to the card. The contents depend on the card type.
|
827
|
+
timeout : int, default 45
|
828
|
+
Interrupt reporting if it takes more than this many seconds.
|
829
|
+
|
830
|
+
|
809
831
|
"""
|
810
832
|
...
|
811
833
|
|
812
834
|
@typing.overload
|
813
|
-
def
|
835
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
814
836
|
...
|
815
837
|
|
816
838
|
@typing.overload
|
817
|
-
def
|
839
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
818
840
|
...
|
819
841
|
|
820
|
-
def
|
842
|
+
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):
|
821
843
|
"""
|
822
|
-
|
844
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
823
845
|
|
824
|
-
|
846
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
825
847
|
|
826
|
-
|
827
|
-
|
828
|
-
|
848
|
+
Parameters
|
849
|
+
----------
|
850
|
+
type : str, default 'default'
|
851
|
+
Card type.
|
852
|
+
id : str, optional, default None
|
853
|
+
If multiple cards are present, use this id to identify this card.
|
854
|
+
options : Dict[str, Any], default {}
|
855
|
+
Options passed to the card. The contents depend on the card type.
|
856
|
+
timeout : int, default 45
|
857
|
+
Interrupt reporting if it takes more than this many seconds.
|
829
858
|
|
830
|
-
|
831
|
-
|
859
|
+
|
860
|
+
"""
|
861
|
+
...
|
862
|
+
|
863
|
+
@typing.overload
|
864
|
+
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]]]:
|
865
|
+
"""
|
866
|
+
Specifies the number of times the task corresponding
|
867
|
+
to a step needs to be retried.
|
868
|
+
|
869
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
870
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
871
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
872
|
+
|
873
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
874
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
875
|
+
ensuring that the flow execution can continue.
|
832
876
|
|
833
877
|
Parameters
|
834
878
|
----------
|
835
|
-
|
836
|
-
Number of
|
837
|
-
|
838
|
-
Number of minutes
|
839
|
-
hours : int, default 0
|
840
|
-
Number of hours to wait prior to timing out.
|
879
|
+
times : int, default 3
|
880
|
+
Number of times to retry this task.
|
881
|
+
minutes_between_retries : int, default 2
|
882
|
+
Number of minutes between retries.
|
841
883
|
"""
|
842
884
|
...
|
843
885
|
|
844
886
|
@typing.overload
|
845
|
-
def
|
887
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
888
|
+
...
|
889
|
+
|
890
|
+
@typing.overload
|
891
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
892
|
+
...
|
893
|
+
|
894
|
+
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):
|
846
895
|
"""
|
847
|
-
Specifies
|
848
|
-
|
896
|
+
Specifies the number of times the task corresponding
|
897
|
+
to a step needs to be retried.
|
898
|
+
|
899
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
900
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
901
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
902
|
+
|
903
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
904
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
905
|
+
ensuring that the flow execution can continue.
|
849
906
|
|
850
907
|
Parameters
|
851
908
|
----------
|
852
|
-
|
853
|
-
|
909
|
+
times : int, default 3
|
910
|
+
Number of times to retry this task.
|
911
|
+
minutes_between_retries : int, default 2
|
912
|
+
Number of minutes between retries.
|
854
913
|
"""
|
855
914
|
...
|
856
915
|
|
857
916
|
@typing.overload
|
858
|
-
def
|
917
|
+
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]]]:
|
918
|
+
"""
|
919
|
+
Specifies environment variables to be set prior to the execution of a step.
|
920
|
+
|
921
|
+
Parameters
|
922
|
+
----------
|
923
|
+
vars : Dict[str, str], default {}
|
924
|
+
Dictionary of environment variables to set.
|
925
|
+
"""
|
859
926
|
...
|
860
927
|
|
861
928
|
@typing.overload
|
862
|
-
def
|
929
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
863
930
|
...
|
864
931
|
|
865
|
-
|
932
|
+
@typing.overload
|
933
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
934
|
+
...
|
935
|
+
|
936
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
866
937
|
"""
|
867
|
-
Specifies
|
868
|
-
the execution of a step.
|
938
|
+
Specifies environment variables to be set prior to the execution of a step.
|
869
939
|
|
870
940
|
Parameters
|
871
941
|
----------
|
872
|
-
|
873
|
-
|
942
|
+
vars : Dict[str, str], default {}
|
943
|
+
Dictionary of environment variables to set.
|
874
944
|
"""
|
875
945
|
...
|
876
946
|
|
@@ -1021,20 +1091,134 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1021
1091
|
"""
|
1022
1092
|
...
|
1023
1093
|
|
1024
|
-
|
1094
|
+
@typing.overload
|
1095
|
+
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]]]:
|
1025
1096
|
"""
|
1026
|
-
Specifies
|
1097
|
+
Specifies the Conda environment for the step.
|
1098
|
+
|
1099
|
+
Information in this decorator will augment any
|
1100
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1101
|
+
you can use `@conda_base` to set packages required by all
|
1102
|
+
steps and use `@conda` to specify step-specific overrides.
|
1027
1103
|
|
1028
1104
|
Parameters
|
1029
1105
|
----------
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1106
|
+
packages : Dict[str, str], default {}
|
1107
|
+
Packages to use for this step. The key is the name of the package
|
1108
|
+
and the value is the version to use.
|
1109
|
+
libraries : Dict[str, str], default {}
|
1110
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1111
|
+
python : str, optional, default None
|
1112
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1113
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1114
|
+
disabled : bool, default False
|
1115
|
+
If set to True, disables @conda.
|
1116
|
+
"""
|
1117
|
+
...
|
1118
|
+
|
1119
|
+
@typing.overload
|
1120
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1121
|
+
...
|
1122
|
+
|
1123
|
+
@typing.overload
|
1124
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1125
|
+
...
|
1126
|
+
|
1127
|
+
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):
|
1128
|
+
"""
|
1129
|
+
Specifies the Conda environment for the step.
|
1130
|
+
|
1131
|
+
Information in this decorator will augment any
|
1132
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1133
|
+
you can use `@conda_base` to set packages required by all
|
1134
|
+
steps and use `@conda` to specify step-specific overrides.
|
1135
|
+
|
1136
|
+
Parameters
|
1137
|
+
----------
|
1138
|
+
packages : Dict[str, str], default {}
|
1139
|
+
Packages to use for this step. The key is the name of the package
|
1140
|
+
and the value is the version to use.
|
1141
|
+
libraries : Dict[str, str], default {}
|
1142
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1143
|
+
python : str, optional, default None
|
1144
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1145
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1146
|
+
disabled : bool, default False
|
1147
|
+
If set to True, disables @conda.
|
1148
|
+
"""
|
1149
|
+
...
|
1150
|
+
|
1151
|
+
@typing.overload
|
1152
|
+
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]]]:
|
1153
|
+
"""
|
1154
|
+
Specifies a timeout for your step.
|
1155
|
+
|
1156
|
+
This decorator is useful if this step may hang indefinitely.
|
1157
|
+
|
1158
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1159
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1160
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1161
|
+
|
1162
|
+
Note that all the values specified in parameters are added together so if you specify
|
1163
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1164
|
+
|
1165
|
+
Parameters
|
1166
|
+
----------
|
1167
|
+
seconds : int, default 0
|
1168
|
+
Number of seconds to wait prior to timing out.
|
1169
|
+
minutes : int, default 0
|
1170
|
+
Number of minutes to wait prior to timing out.
|
1171
|
+
hours : int, default 0
|
1172
|
+
Number of hours to wait prior to timing out.
|
1173
|
+
"""
|
1174
|
+
...
|
1175
|
+
|
1176
|
+
@typing.overload
|
1177
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1178
|
+
...
|
1179
|
+
|
1180
|
+
@typing.overload
|
1181
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1182
|
+
...
|
1183
|
+
|
1184
|
+
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):
|
1185
|
+
"""
|
1186
|
+
Specifies a timeout for your step.
|
1187
|
+
|
1188
|
+
This decorator is useful if this step may hang indefinitely.
|
1189
|
+
|
1190
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1191
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1192
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1193
|
+
|
1194
|
+
Note that all the values specified in parameters are added together so if you specify
|
1195
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1196
|
+
|
1197
|
+
Parameters
|
1198
|
+
----------
|
1199
|
+
seconds : int, default 0
|
1200
|
+
Number of seconds to wait prior to timing out.
|
1201
|
+
minutes : int, default 0
|
1202
|
+
Number of minutes to wait prior to timing out.
|
1203
|
+
hours : int, default 0
|
1204
|
+
Number of hours to wait prior to timing out.
|
1205
|
+
"""
|
1206
|
+
...
|
1207
|
+
|
1208
|
+
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, 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) -> 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]]]:
|
1209
|
+
"""
|
1210
|
+
Specifies that this step should execute on Kubernetes.
|
1211
|
+
|
1212
|
+
Parameters
|
1213
|
+
----------
|
1214
|
+
cpu : int, default 1
|
1215
|
+
Number of CPUs required for this step. If `@resources` is
|
1216
|
+
also present, the maximum value from all decorators is used.
|
1217
|
+
memory : int, default 4096
|
1218
|
+
Memory size (in MB) required for this step. If
|
1219
|
+
`@resources` is also present, the maximum value from all decorators is
|
1220
|
+
used.
|
1221
|
+
disk : int, default 10240
|
1038
1222
|
Disk size (in MB) required for this step. If
|
1039
1223
|
`@resources` is also present, the maximum value from all decorators is
|
1040
1224
|
used.
|
@@ -1081,33 +1265,51 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
1081
1265
|
...
|
1082
1266
|
|
1083
1267
|
@typing.overload
|
1084
|
-
def
|
1268
|
+
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]]]:
|
1085
1269
|
"""
|
1086
|
-
Specifies
|
1270
|
+
Specifies the PyPI packages for the step.
|
1271
|
+
|
1272
|
+
Information in this decorator will augment any
|
1273
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1274
|
+
you can use `@pypi_base` to set packages required by all
|
1275
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1087
1276
|
|
1088
1277
|
Parameters
|
1089
1278
|
----------
|
1090
|
-
|
1091
|
-
|
1279
|
+
packages : Dict[str, str], default: {}
|
1280
|
+
Packages to use for this step. The key is the name of the package
|
1281
|
+
and the value is the version to use.
|
1282
|
+
python : str, optional, default: None
|
1283
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1284
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1092
1285
|
"""
|
1093
1286
|
...
|
1094
1287
|
|
1095
1288
|
@typing.overload
|
1096
|
-
def
|
1289
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1097
1290
|
...
|
1098
1291
|
|
1099
1292
|
@typing.overload
|
1100
|
-
def
|
1293
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1101
1294
|
...
|
1102
1295
|
|
1103
|
-
def
|
1296
|
+
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):
|
1104
1297
|
"""
|
1105
|
-
Specifies
|
1298
|
+
Specifies the PyPI packages for the step.
|
1299
|
+
|
1300
|
+
Information in this decorator will augment any
|
1301
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1302
|
+
you can use `@pypi_base` to set packages required by all
|
1303
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1106
1304
|
|
1107
1305
|
Parameters
|
1108
1306
|
----------
|
1109
|
-
|
1110
|
-
|
1307
|
+
packages : Dict[str, str], default: {}
|
1308
|
+
Packages to use for this step. The key is the name of the package
|
1309
|
+
and the value is the version to use.
|
1310
|
+
python : str, optional, default: None
|
1311
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1312
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1111
1313
|
"""
|
1112
1314
|
...
|
1113
1315
|
|
@@ -1189,310 +1391,51 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
1189
1391
|
...
|
1190
1392
|
|
1191
1393
|
@typing.overload
|
1192
|
-
def
|
1193
|
-
"""
|
1194
|
-
Specifies that the step will success under all circumstances.
|
1195
|
-
|
1196
|
-
The decorator will create an optional artifact, specified by `var`, which
|
1197
|
-
contains the exception raised. You can use it to detect the presence
|
1198
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1199
|
-
are missing.
|
1200
|
-
|
1201
|
-
Parameters
|
1202
|
-
----------
|
1203
|
-
var : str, optional, default None
|
1204
|
-
Name of the artifact in which to store the caught exception.
|
1205
|
-
If not specified, the exception is not stored.
|
1206
|
-
print_exception : bool, default True
|
1207
|
-
Determines whether or not the exception is printed to
|
1208
|
-
stdout when caught.
|
1209
|
-
"""
|
1210
|
-
...
|
1211
|
-
|
1212
|
-
@typing.overload
|
1213
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1214
|
-
...
|
1215
|
-
|
1216
|
-
@typing.overload
|
1217
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1218
|
-
...
|
1219
|
-
|
1220
|
-
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):
|
1221
|
-
"""
|
1222
|
-
Specifies that the step will success under all circumstances.
|
1223
|
-
|
1224
|
-
The decorator will create an optional artifact, specified by `var`, which
|
1225
|
-
contains the exception raised. You can use it to detect the presence
|
1226
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1227
|
-
are missing.
|
1228
|
-
|
1229
|
-
Parameters
|
1230
|
-
----------
|
1231
|
-
var : str, optional, default None
|
1232
|
-
Name of the artifact in which to store the caught exception.
|
1233
|
-
If not specified, the exception is not stored.
|
1234
|
-
print_exception : bool, default True
|
1235
|
-
Determines whether or not the exception is printed to
|
1236
|
-
stdout when caught.
|
1237
|
-
"""
|
1238
|
-
...
|
1239
|
-
|
1240
|
-
@typing.overload
|
1241
|
-
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]]]:
|
1242
|
-
"""
|
1243
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1244
|
-
|
1245
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1246
|
-
|
1247
|
-
Parameters
|
1248
|
-
----------
|
1249
|
-
type : str, default 'default'
|
1250
|
-
Card type.
|
1251
|
-
id : str, optional, default None
|
1252
|
-
If multiple cards are present, use this id to identify this card.
|
1253
|
-
options : Dict[str, Any], default {}
|
1254
|
-
Options passed to the card. The contents depend on the card type.
|
1255
|
-
timeout : int, default 45
|
1256
|
-
Interrupt reporting if it takes more than this many seconds.
|
1257
|
-
|
1258
|
-
|
1259
|
-
"""
|
1260
|
-
...
|
1261
|
-
|
1262
|
-
@typing.overload
|
1263
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1264
|
-
...
|
1265
|
-
|
1266
|
-
@typing.overload
|
1267
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1268
|
-
...
|
1269
|
-
|
1270
|
-
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):
|
1271
|
-
"""
|
1272
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1273
|
-
|
1274
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1275
|
-
|
1276
|
-
Parameters
|
1277
|
-
----------
|
1278
|
-
type : str, default 'default'
|
1279
|
-
Card type.
|
1280
|
-
id : str, optional, default None
|
1281
|
-
If multiple cards are present, use this id to identify this card.
|
1282
|
-
options : Dict[str, Any], default {}
|
1283
|
-
Options passed to the card. The contents depend on the card type.
|
1284
|
-
timeout : int, default 45
|
1285
|
-
Interrupt reporting if it takes more than this many seconds.
|
1286
|
-
|
1287
|
-
|
1288
|
-
"""
|
1289
|
-
...
|
1290
|
-
|
1291
|
-
@typing.overload
|
1292
|
-
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]]]:
|
1293
|
-
"""
|
1294
|
-
Specifies the number of times the task corresponding
|
1295
|
-
to a step needs to be retried.
|
1296
|
-
|
1297
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
1298
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
1299
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
1300
|
-
|
1301
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1302
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
1303
|
-
ensuring that the flow execution can continue.
|
1304
|
-
|
1305
|
-
Parameters
|
1306
|
-
----------
|
1307
|
-
times : int, default 3
|
1308
|
-
Number of times to retry this task.
|
1309
|
-
minutes_between_retries : int, default 2
|
1310
|
-
Number of minutes between retries.
|
1311
|
-
"""
|
1312
|
-
...
|
1313
|
-
|
1314
|
-
@typing.overload
|
1315
|
-
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1316
|
-
...
|
1317
|
-
|
1318
|
-
@typing.overload
|
1319
|
-
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1320
|
-
...
|
1321
|
-
|
1322
|
-
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):
|
1323
|
-
"""
|
1324
|
-
Specifies the number of times the task corresponding
|
1325
|
-
to a step needs to be retried.
|
1326
|
-
|
1327
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
1328
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
1329
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
1330
|
-
|
1331
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1332
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
1333
|
-
ensuring that the flow execution can continue.
|
1334
|
-
|
1335
|
-
Parameters
|
1336
|
-
----------
|
1337
|
-
times : int, default 3
|
1338
|
-
Number of times to retry this task.
|
1339
|
-
minutes_between_retries : int, default 2
|
1340
|
-
Number of minutes between retries.
|
1341
|
-
"""
|
1342
|
-
...
|
1343
|
-
|
1344
|
-
@typing.overload
|
1345
|
-
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]]]:
|
1346
|
-
"""
|
1347
|
-
Specifies the PyPI packages for the step.
|
1348
|
-
|
1349
|
-
Information in this decorator will augment any
|
1350
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1351
|
-
you can use `@pypi_base` to set packages required by all
|
1352
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1353
|
-
|
1354
|
-
Parameters
|
1355
|
-
----------
|
1356
|
-
packages : Dict[str, str], default: {}
|
1357
|
-
Packages to use for this step. The key is the name of the package
|
1358
|
-
and the value is the version to use.
|
1359
|
-
python : str, optional, default: None
|
1360
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1361
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1362
|
-
"""
|
1363
|
-
...
|
1364
|
-
|
1365
|
-
@typing.overload
|
1366
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1367
|
-
...
|
1368
|
-
|
1369
|
-
@typing.overload
|
1370
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1371
|
-
...
|
1372
|
-
|
1373
|
-
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):
|
1374
|
-
"""
|
1375
|
-
Specifies the PyPI packages for the step.
|
1376
|
-
|
1377
|
-
Information in this decorator will augment any
|
1378
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1379
|
-
you can use `@pypi_base` to set packages required by all
|
1380
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1381
|
-
|
1382
|
-
Parameters
|
1383
|
-
----------
|
1384
|
-
packages : Dict[str, str], default: {}
|
1385
|
-
Packages to use for this step. The key is the name of the package
|
1386
|
-
and the value is the version to use.
|
1387
|
-
python : str, optional, default: None
|
1388
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1389
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1390
|
-
"""
|
1391
|
-
...
|
1392
|
-
|
1393
|
-
@typing.overload
|
1394
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1395
|
-
"""
|
1396
|
-
Specifies the PyPI packages for all steps of the flow.
|
1397
|
-
|
1398
|
-
Use `@pypi_base` to set common packages required by all
|
1399
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1400
|
-
Parameters
|
1401
|
-
----------
|
1402
|
-
packages : Dict[str, str], default: {}
|
1403
|
-
Packages to use for this flow. The key is the name of the package
|
1404
|
-
and the value is the version to use.
|
1405
|
-
python : str, optional, default: None
|
1406
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1407
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1408
|
-
"""
|
1409
|
-
...
|
1410
|
-
|
1411
|
-
@typing.overload
|
1412
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1413
|
-
...
|
1414
|
-
|
1415
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1416
|
-
"""
|
1417
|
-
Specifies the PyPI packages for all steps of the flow.
|
1418
|
-
|
1419
|
-
Use `@pypi_base` to set common packages required by all
|
1420
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1421
|
-
Parameters
|
1422
|
-
----------
|
1423
|
-
packages : Dict[str, str], default: {}
|
1424
|
-
Packages to use for this flow. The key is the name of the package
|
1425
|
-
and the value is the version to use.
|
1426
|
-
python : str, optional, default: None
|
1427
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1428
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1429
|
-
"""
|
1430
|
-
...
|
1431
|
-
|
1432
|
-
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1433
|
-
"""
|
1434
|
-
Specifies what flows belong to the same project.
|
1435
|
-
|
1436
|
-
A project-specific namespace is created for all flows that
|
1437
|
-
use the same `@project(name)`.
|
1438
|
-
|
1439
|
-
Parameters
|
1440
|
-
----------
|
1441
|
-
name : str
|
1442
|
-
Project name. Make sure that the name is unique amongst all
|
1443
|
-
projects that use the same production scheduler. The name may
|
1444
|
-
contain only lowercase alphanumeric characters and underscores.
|
1445
|
-
|
1446
|
-
|
1447
|
-
"""
|
1448
|
-
...
|
1449
|
-
|
1450
|
-
@typing.overload
|
1451
|
-
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]]:
|
1394
|
+
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]]:
|
1452
1395
|
"""
|
1453
|
-
Specifies the
|
1454
|
-
|
1455
|
-
Use `@conda_base` to set common libraries required by all
|
1456
|
-
steps and use `@conda` to specify step-specific additions.
|
1396
|
+
Specifies the times when the flow should be run when running on a
|
1397
|
+
production scheduler.
|
1457
1398
|
|
1458
1399
|
Parameters
|
1459
1400
|
----------
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1401
|
+
hourly : bool, default False
|
1402
|
+
Run the workflow hourly.
|
1403
|
+
daily : bool, default True
|
1404
|
+
Run the workflow daily.
|
1405
|
+
weekly : bool, default False
|
1406
|
+
Run the workflow weekly.
|
1407
|
+
cron : str, optional, default None
|
1408
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1409
|
+
specified by this expression.
|
1410
|
+
timezone : str, optional, default None
|
1411
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1412
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1470
1413
|
"""
|
1471
1414
|
...
|
1472
1415
|
|
1473
1416
|
@typing.overload
|
1474
|
-
def
|
1417
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1475
1418
|
...
|
1476
1419
|
|
1477
|
-
def
|
1420
|
+
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):
|
1478
1421
|
"""
|
1479
|
-
Specifies the
|
1480
|
-
|
1481
|
-
Use `@conda_base` to set common libraries required by all
|
1482
|
-
steps and use `@conda` to specify step-specific additions.
|
1422
|
+
Specifies the times when the flow should be run when running on a
|
1423
|
+
production scheduler.
|
1483
1424
|
|
1484
1425
|
Parameters
|
1485
1426
|
----------
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1427
|
+
hourly : bool, default False
|
1428
|
+
Run the workflow hourly.
|
1429
|
+
daily : bool, default True
|
1430
|
+
Run the workflow daily.
|
1431
|
+
weekly : bool, default False
|
1432
|
+
Run the workflow weekly.
|
1433
|
+
cron : str, optional, default None
|
1434
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1435
|
+
specified by this expression.
|
1436
|
+
timezone : str, optional, default None
|
1437
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1438
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1496
1439
|
"""
|
1497
1440
|
...
|
1498
1441
|
|
@@ -1538,45 +1481,42 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1538
1481
|
"""
|
1539
1482
|
...
|
1540
1483
|
|
1541
|
-
|
1484
|
+
@typing.overload
|
1485
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1542
1486
|
"""
|
1543
|
-
|
1544
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1545
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1546
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1547
|
-
starts only after all sensors finish.
|
1487
|
+
Specifies the PyPI packages for all steps of the flow.
|
1548
1488
|
|
1489
|
+
Use `@pypi_base` to set common packages required by all
|
1490
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1549
1491
|
Parameters
|
1550
1492
|
----------
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
verify : bool
|
1579
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1493
|
+
packages : Dict[str, str], default: {}
|
1494
|
+
Packages to use for this flow. The key is the name of the package
|
1495
|
+
and the value is the version to use.
|
1496
|
+
python : str, optional, default: None
|
1497
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1498
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1499
|
+
"""
|
1500
|
+
...
|
1501
|
+
|
1502
|
+
@typing.overload
|
1503
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1504
|
+
...
|
1505
|
+
|
1506
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1507
|
+
"""
|
1508
|
+
Specifies the PyPI packages for all steps of the flow.
|
1509
|
+
|
1510
|
+
Use `@pypi_base` to set common packages required by all
|
1511
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1512
|
+
Parameters
|
1513
|
+
----------
|
1514
|
+
packages : Dict[str, str], default: {}
|
1515
|
+
Packages to use for this flow. The key is the name of the package
|
1516
|
+
and the value is the version to use.
|
1517
|
+
python : str, optional, default: None
|
1518
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1519
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1580
1520
|
"""
|
1581
1521
|
...
|
1582
1522
|
|
@@ -1675,55 +1615,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1675
1615
|
"""
|
1676
1616
|
...
|
1677
1617
|
|
1678
|
-
@typing.overload
|
1679
|
-
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]]:
|
1680
|
-
"""
|
1681
|
-
Specifies the times when the flow should be run when running on a
|
1682
|
-
production scheduler.
|
1683
|
-
|
1684
|
-
Parameters
|
1685
|
-
----------
|
1686
|
-
hourly : bool, default False
|
1687
|
-
Run the workflow hourly.
|
1688
|
-
daily : bool, default True
|
1689
|
-
Run the workflow daily.
|
1690
|
-
weekly : bool, default False
|
1691
|
-
Run the workflow weekly.
|
1692
|
-
cron : str, optional, default None
|
1693
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1694
|
-
specified by this expression.
|
1695
|
-
timezone : str, optional, default None
|
1696
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1697
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1698
|
-
"""
|
1699
|
-
...
|
1700
|
-
|
1701
|
-
@typing.overload
|
1702
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1703
|
-
...
|
1704
|
-
|
1705
|
-
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):
|
1706
|
-
"""
|
1707
|
-
Specifies the times when the flow should be run when running on a
|
1708
|
-
production scheduler.
|
1709
|
-
|
1710
|
-
Parameters
|
1711
|
-
----------
|
1712
|
-
hourly : bool, default False
|
1713
|
-
Run the workflow hourly.
|
1714
|
-
daily : bool, default True
|
1715
|
-
Run the workflow daily.
|
1716
|
-
weekly : bool, default False
|
1717
|
-
Run the workflow weekly.
|
1718
|
-
cron : str, optional, default None
|
1719
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1720
|
-
specified by this expression.
|
1721
|
-
timezone : str, optional, default None
|
1722
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1723
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1724
|
-
"""
|
1725
|
-
...
|
1726
|
-
|
1727
1618
|
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1728
1619
|
"""
|
1729
1620
|
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
@@ -1755,6 +1646,115 @@ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[Fl
|
|
1755
1646
|
"""
|
1756
1647
|
...
|
1757
1648
|
|
1649
|
+
@typing.overload
|
1650
|
+
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]]:
|
1651
|
+
"""
|
1652
|
+
Specifies the Conda environment for all steps of the flow.
|
1653
|
+
|
1654
|
+
Use `@conda_base` to set common libraries required by all
|
1655
|
+
steps and use `@conda` to specify step-specific additions.
|
1656
|
+
|
1657
|
+
Parameters
|
1658
|
+
----------
|
1659
|
+
packages : Dict[str, str], default {}
|
1660
|
+
Packages to use for this flow. The key is the name of the package
|
1661
|
+
and the value is the version to use.
|
1662
|
+
libraries : Dict[str, str], default {}
|
1663
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1664
|
+
python : str, optional, default None
|
1665
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1666
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1667
|
+
disabled : bool, default False
|
1668
|
+
If set to True, disables Conda.
|
1669
|
+
"""
|
1670
|
+
...
|
1671
|
+
|
1672
|
+
@typing.overload
|
1673
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1674
|
+
...
|
1675
|
+
|
1676
|
+
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):
|
1677
|
+
"""
|
1678
|
+
Specifies the Conda environment for all steps of the flow.
|
1679
|
+
|
1680
|
+
Use `@conda_base` to set common libraries required by all
|
1681
|
+
steps and use `@conda` to specify step-specific additions.
|
1682
|
+
|
1683
|
+
Parameters
|
1684
|
+
----------
|
1685
|
+
packages : Dict[str, str], default {}
|
1686
|
+
Packages to use for this flow. The key is the name of the package
|
1687
|
+
and the value is the version to use.
|
1688
|
+
libraries : Dict[str, str], default {}
|
1689
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1690
|
+
python : str, optional, default None
|
1691
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1692
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1693
|
+
disabled : bool, default False
|
1694
|
+
If set to True, disables Conda.
|
1695
|
+
"""
|
1696
|
+
...
|
1697
|
+
|
1698
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1699
|
+
"""
|
1700
|
+
Specifies what flows belong to the same project.
|
1701
|
+
|
1702
|
+
A project-specific namespace is created for all flows that
|
1703
|
+
use the same `@project(name)`.
|
1704
|
+
|
1705
|
+
Parameters
|
1706
|
+
----------
|
1707
|
+
name : str
|
1708
|
+
Project name. Make sure that the name is unique amongst all
|
1709
|
+
projects that use the same production scheduler. The name may
|
1710
|
+
contain only lowercase alphanumeric characters and underscores.
|
1711
|
+
|
1712
|
+
|
1713
|
+
"""
|
1714
|
+
...
|
1715
|
+
|
1716
|
+
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]]:
|
1717
|
+
"""
|
1718
|
+
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)
|
1719
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1720
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1721
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1722
|
+
starts only after all sensors finish.
|
1723
|
+
|
1724
|
+
Parameters
|
1725
|
+
----------
|
1726
|
+
timeout : int
|
1727
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1728
|
+
poke_interval : int
|
1729
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1730
|
+
mode : str
|
1731
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1732
|
+
exponential_backoff : bool
|
1733
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1734
|
+
pool : str
|
1735
|
+
the slot pool this task should run in,
|
1736
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1737
|
+
soft_fail : bool
|
1738
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1739
|
+
name : str
|
1740
|
+
Name of the sensor on Airflow
|
1741
|
+
description : str
|
1742
|
+
Description of sensor in the Airflow UI
|
1743
|
+
bucket_key : Union[str, List[str]]
|
1744
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1745
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1746
|
+
bucket_name : str
|
1747
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1748
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1749
|
+
wildcard_match : bool
|
1750
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1751
|
+
aws_conn_id : str
|
1752
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1753
|
+
verify : bool
|
1754
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1755
|
+
"""
|
1756
|
+
...
|
1757
|
+
|
1758
1758
|
@typing.overload
|
1759
1759
|
def trigger_on_finish(*, flow: typing.Union[str, typing.Dict[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]]:
|
1760
1760
|
"""
|