metaflow-stubs 2.11.6__py2.py3-none-any.whl → 2.11.7__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 +342 -342
- metaflow-stubs/cards.pyi +5 -5
- metaflow-stubs/cli.pyi +3 -3
- metaflow-stubs/client/__init__.pyi +4 -4
- metaflow-stubs/client/core.pyi +4 -4
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/clone_util.pyi +2 -2
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/metadata/metadata.pyi +2 -2
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +16 -16
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +4 -4
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +3 -3
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +3 -3
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +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 +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
- metaflow-stubs/plugins/cards/card_client.pyi +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +4 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.11.6.dist-info → metaflow_stubs-2.11.7.dist-info}/METADATA +2 -2
- metaflow_stubs-2.11.7.dist-info/RECORD +132 -0
- metaflow_stubs-2.11.6.dist-info/RECORD +0 -132
- {metaflow_stubs-2.11.6.dist-info → metaflow_stubs-2.11.7.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.11.6.dist-info → metaflow_stubs-2.11.7.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.11.
|
4
|
-
# Generated on 2024-03-
|
3
|
+
# MF version: 2.11.7 #
|
4
|
+
# Generated on 2024-03-27T23:22:57.990224 #
|
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.datastore.inputs
|
11
12
|
import metaflow.metaflow_current
|
12
|
-
import datetime
|
13
|
-
import metaflow.events
|
14
13
|
import metaflow.parameters
|
15
14
|
import typing
|
16
|
-
import metaflow.
|
15
|
+
import metaflow.client.core
|
17
16
|
import io
|
17
|
+
import metaflow.events
|
18
|
+
import datetime
|
19
|
+
import metaflow.plugins.datatools.s3.s3
|
18
20
|
import metaflow._vendor.click.types
|
19
|
-
import metaflow.datastore.inputs
|
20
|
-
import metaflow.client.core
|
21
21
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
22
22
|
StepFlag = typing.NewType("StepFlag", bool)
|
23
23
|
|
@@ -803,82 +803,84 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
803
803
|
...
|
804
804
|
|
805
805
|
@typing.overload
|
806
|
-
def
|
806
|
+
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]]]:
|
807
807
|
"""
|
808
|
-
Specifies
|
809
|
-
|
810
|
-
The decorator will create an optional artifact, specified by `var`, which
|
811
|
-
contains the exception raised. You can use it to detect the presence
|
812
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
813
|
-
are missing.
|
808
|
+
Specifies environment variables to be set prior to the execution of a step.
|
814
809
|
|
815
810
|
Parameters
|
816
811
|
----------
|
817
|
-
|
818
|
-
|
819
|
-
If not specified, the exception is not stored.
|
820
|
-
print_exception : bool, default True
|
821
|
-
Determines whether or not the exception is printed to
|
822
|
-
stdout when caught.
|
812
|
+
vars : Dict[str, str], default {}
|
813
|
+
Dictionary of environment variables to set.
|
823
814
|
"""
|
824
815
|
...
|
825
816
|
|
826
817
|
@typing.overload
|
827
|
-
def
|
818
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
828
819
|
...
|
829
820
|
|
830
821
|
@typing.overload
|
831
|
-
def
|
822
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
832
823
|
...
|
833
824
|
|
834
|
-
def
|
825
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
835
826
|
"""
|
836
|
-
Specifies
|
837
|
-
|
838
|
-
The decorator will create an optional artifact, specified by `var`, which
|
839
|
-
contains the exception raised. You can use it to detect the presence
|
840
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
841
|
-
are missing.
|
827
|
+
Specifies environment variables to be set prior to the execution of a step.
|
842
828
|
|
843
829
|
Parameters
|
844
830
|
----------
|
845
|
-
|
846
|
-
|
847
|
-
If not specified, the exception is not stored.
|
848
|
-
print_exception : bool, default True
|
849
|
-
Determines whether or not the exception is printed to
|
850
|
-
stdout when caught.
|
831
|
+
vars : Dict[str, str], default {}
|
832
|
+
Dictionary of environment variables to set.
|
851
833
|
"""
|
852
834
|
...
|
853
835
|
|
854
836
|
@typing.overload
|
855
|
-
def
|
837
|
+
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]]]:
|
856
838
|
"""
|
857
|
-
|
839
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
840
|
+
|
841
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
858
842
|
|
859
843
|
Parameters
|
860
844
|
----------
|
861
|
-
|
862
|
-
|
845
|
+
type : str, default 'default'
|
846
|
+
Card type.
|
847
|
+
id : str, optional, default None
|
848
|
+
If multiple cards are present, use this id to identify this card.
|
849
|
+
options : Dict[str, Any], default {}
|
850
|
+
Options passed to the card. The contents depend on the card type.
|
851
|
+
timeout : int, default 45
|
852
|
+
Interrupt reporting if it takes more than this many seconds.
|
853
|
+
|
854
|
+
|
863
855
|
"""
|
864
856
|
...
|
865
857
|
|
866
858
|
@typing.overload
|
867
|
-
def
|
859
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
868
860
|
...
|
869
861
|
|
870
862
|
@typing.overload
|
871
|
-
def
|
863
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
872
864
|
...
|
873
865
|
|
874
|
-
def
|
866
|
+
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):
|
875
867
|
"""
|
876
|
-
|
868
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
869
|
+
|
870
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
877
871
|
|
878
872
|
Parameters
|
879
873
|
----------
|
880
|
-
|
881
|
-
|
874
|
+
type : str, default 'default'
|
875
|
+
Card type.
|
876
|
+
id : str, optional, default None
|
877
|
+
If multiple cards are present, use this id to identify this card.
|
878
|
+
options : Dict[str, Any], default {}
|
879
|
+
Options passed to the card. The contents depend on the card type.
|
880
|
+
timeout : int, default 45
|
881
|
+
Interrupt reporting if it takes more than this many seconds.
|
882
|
+
|
883
|
+
|
882
884
|
"""
|
883
885
|
...
|
884
886
|
|
@@ -1029,6 +1031,112 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1029
1031
|
"""
|
1030
1032
|
...
|
1031
1033
|
|
1034
|
+
@typing.overload
|
1035
|
+
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]]]:
|
1036
|
+
"""
|
1037
|
+
Specifies that the step will success under all circumstances.
|
1038
|
+
|
1039
|
+
The decorator will create an optional artifact, specified by `var`, which
|
1040
|
+
contains the exception raised. You can use it to detect the presence
|
1041
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
1042
|
+
are missing.
|
1043
|
+
|
1044
|
+
Parameters
|
1045
|
+
----------
|
1046
|
+
var : str, optional, default None
|
1047
|
+
Name of the artifact in which to store the caught exception.
|
1048
|
+
If not specified, the exception is not stored.
|
1049
|
+
print_exception : bool, default True
|
1050
|
+
Determines whether or not the exception is printed to
|
1051
|
+
stdout when caught.
|
1052
|
+
"""
|
1053
|
+
...
|
1054
|
+
|
1055
|
+
@typing.overload
|
1056
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1057
|
+
...
|
1058
|
+
|
1059
|
+
@typing.overload
|
1060
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1061
|
+
...
|
1062
|
+
|
1063
|
+
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):
|
1064
|
+
"""
|
1065
|
+
Specifies that the step will success under all circumstances.
|
1066
|
+
|
1067
|
+
The decorator will create an optional artifact, specified by `var`, which
|
1068
|
+
contains the exception raised. You can use it to detect the presence
|
1069
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
1070
|
+
are missing.
|
1071
|
+
|
1072
|
+
Parameters
|
1073
|
+
----------
|
1074
|
+
var : str, optional, default None
|
1075
|
+
Name of the artifact in which to store the caught exception.
|
1076
|
+
If not specified, the exception is not stored.
|
1077
|
+
print_exception : bool, default True
|
1078
|
+
Determines whether or not the exception is printed to
|
1079
|
+
stdout when caught.
|
1080
|
+
"""
|
1081
|
+
...
|
1082
|
+
|
1083
|
+
@typing.overload
|
1084
|
+
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]]]:
|
1085
|
+
"""
|
1086
|
+
Specifies the Conda environment for the step.
|
1087
|
+
|
1088
|
+
Information in this decorator will augment any
|
1089
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1090
|
+
you can use `@conda_base` to set packages required by all
|
1091
|
+
steps and use `@conda` to specify step-specific overrides.
|
1092
|
+
|
1093
|
+
Parameters
|
1094
|
+
----------
|
1095
|
+
packages : Dict[str, str], default {}
|
1096
|
+
Packages to use for this step. The key is the name of the package
|
1097
|
+
and the value is the version to use.
|
1098
|
+
libraries : Dict[str, str], default {}
|
1099
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1100
|
+
python : str, optional, default None
|
1101
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1102
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1103
|
+
disabled : bool, default False
|
1104
|
+
If set to True, disables @conda.
|
1105
|
+
"""
|
1106
|
+
...
|
1107
|
+
|
1108
|
+
@typing.overload
|
1109
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1110
|
+
...
|
1111
|
+
|
1112
|
+
@typing.overload
|
1113
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1114
|
+
...
|
1115
|
+
|
1116
|
+
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):
|
1117
|
+
"""
|
1118
|
+
Specifies the Conda environment for the step.
|
1119
|
+
|
1120
|
+
Information in this decorator will augment any
|
1121
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1122
|
+
you can use `@conda_base` to set packages required by all
|
1123
|
+
steps and use `@conda` to specify step-specific overrides.
|
1124
|
+
|
1125
|
+
Parameters
|
1126
|
+
----------
|
1127
|
+
packages : Dict[str, str], default {}
|
1128
|
+
Packages to use for this step. The key is the name of the package
|
1129
|
+
and the value is the version to use.
|
1130
|
+
libraries : Dict[str, str], default {}
|
1131
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1132
|
+
python : str, optional, default None
|
1133
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1134
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1135
|
+
disabled : bool, default False
|
1136
|
+
If set to True, disables @conda.
|
1137
|
+
"""
|
1138
|
+
...
|
1139
|
+
|
1032
1140
|
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) -> 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]]]:
|
1033
1141
|
"""
|
1034
1142
|
Specifies that this step should execute on Kubernetes.
|
@@ -1087,110 +1195,84 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
1087
1195
|
...
|
1088
1196
|
|
1089
1197
|
@typing.overload
|
1090
|
-
def
|
1198
|
+
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]]]:
|
1091
1199
|
"""
|
1092
|
-
|
1093
|
-
|
1094
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1200
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1201
|
+
the execution of a step.
|
1095
1202
|
|
1096
1203
|
Parameters
|
1097
1204
|
----------
|
1098
|
-
|
1099
|
-
|
1100
|
-
id : str, optional, default None
|
1101
|
-
If multiple cards are present, use this id to identify this card.
|
1102
|
-
options : Dict[str, Any], default {}
|
1103
|
-
Options passed to the card. The contents depend on the card type.
|
1104
|
-
timeout : int, default 45
|
1105
|
-
Interrupt reporting if it takes more than this many seconds.
|
1106
|
-
|
1107
|
-
|
1205
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1206
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1108
1207
|
"""
|
1109
1208
|
...
|
1110
1209
|
|
1111
1210
|
@typing.overload
|
1112
|
-
def
|
1211
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1113
1212
|
...
|
1114
1213
|
|
1115
1214
|
@typing.overload
|
1116
|
-
def
|
1215
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1117
1216
|
...
|
1118
1217
|
|
1119
|
-
def
|
1218
|
+
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]]] = []):
|
1120
1219
|
"""
|
1121
|
-
|
1122
|
-
|
1123
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1220
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1221
|
+
the execution of a step.
|
1124
1222
|
|
1125
1223
|
Parameters
|
1126
1224
|
----------
|
1127
|
-
|
1128
|
-
|
1129
|
-
id : str, optional, default None
|
1130
|
-
If multiple cards are present, use this id to identify this card.
|
1131
|
-
options : Dict[str, Any], default {}
|
1132
|
-
Options passed to the card. The contents depend on the card type.
|
1133
|
-
timeout : int, default 45
|
1134
|
-
Interrupt reporting if it takes more than this many seconds.
|
1135
|
-
|
1136
|
-
|
1225
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1226
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1137
1227
|
"""
|
1138
1228
|
...
|
1139
1229
|
|
1140
1230
|
@typing.overload
|
1141
|
-
def
|
1231
|
+
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]]]:
|
1142
1232
|
"""
|
1143
|
-
Specifies the
|
1233
|
+
Specifies the PyPI packages for the step.
|
1144
1234
|
|
1145
1235
|
Information in this decorator will augment any
|
1146
|
-
attributes set in the `@
|
1147
|
-
you can use `@
|
1148
|
-
steps and use `@
|
1236
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1237
|
+
you can use `@pypi_base` to set packages required by all
|
1238
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1149
1239
|
|
1150
1240
|
Parameters
|
1151
1241
|
----------
|
1152
|
-
packages : Dict[str, str], default {}
|
1242
|
+
packages : Dict[str, str], default: {}
|
1153
1243
|
Packages to use for this step. The key is the name of the package
|
1154
1244
|
and the value is the version to use.
|
1155
|
-
|
1156
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1157
|
-
python : str, optional, default None
|
1245
|
+
python : str, optional, default: None
|
1158
1246
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1159
1247
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1160
|
-
disabled : bool, default False
|
1161
|
-
If set to True, disables @conda.
|
1162
1248
|
"""
|
1163
1249
|
...
|
1164
1250
|
|
1165
1251
|
@typing.overload
|
1166
|
-
def
|
1252
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1167
1253
|
...
|
1168
1254
|
|
1169
1255
|
@typing.overload
|
1170
|
-
def
|
1256
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1171
1257
|
...
|
1172
1258
|
|
1173
|
-
def
|
1259
|
+
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):
|
1174
1260
|
"""
|
1175
|
-
Specifies the
|
1261
|
+
Specifies the PyPI packages for the step.
|
1176
1262
|
|
1177
1263
|
Information in this decorator will augment any
|
1178
|
-
attributes set in the `@
|
1179
|
-
you can use `@
|
1180
|
-
steps and use `@
|
1264
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1265
|
+
you can use `@pypi_base` to set packages required by all
|
1266
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1181
1267
|
|
1182
1268
|
Parameters
|
1183
1269
|
----------
|
1184
|
-
packages : Dict[str, str], default {}
|
1270
|
+
packages : Dict[str, str], default: {}
|
1185
1271
|
Packages to use for this step. The key is the name of the package
|
1186
1272
|
and the value is the version to use.
|
1187
|
-
|
1188
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1189
|
-
python : str, optional, default None
|
1273
|
+
python : str, optional, default: None
|
1190
1274
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1191
1275
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1192
|
-
disabled : bool, default False
|
1193
|
-
If set to True, disables @conda.
|
1194
1276
|
"""
|
1195
1277
|
...
|
1196
1278
|
|
@@ -1247,55 +1329,6 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1247
1329
|
"""
|
1248
1330
|
...
|
1249
1331
|
|
1250
|
-
@typing.overload
|
1251
|
-
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]]]:
|
1252
|
-
"""
|
1253
|
-
Specifies the PyPI packages for the step.
|
1254
|
-
|
1255
|
-
Information in this decorator will augment any
|
1256
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1257
|
-
you can use `@pypi_base` to set packages required by all
|
1258
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1259
|
-
|
1260
|
-
Parameters
|
1261
|
-
----------
|
1262
|
-
packages : Dict[str, str], default: {}
|
1263
|
-
Packages to use for this step. The key is the name of the package
|
1264
|
-
and the value is the version to use.
|
1265
|
-
python : str, optional, default: None
|
1266
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1267
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1268
|
-
"""
|
1269
|
-
...
|
1270
|
-
|
1271
|
-
@typing.overload
|
1272
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1273
|
-
...
|
1274
|
-
|
1275
|
-
@typing.overload
|
1276
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1277
|
-
...
|
1278
|
-
|
1279
|
-
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):
|
1280
|
-
"""
|
1281
|
-
Specifies the PyPI packages for the step.
|
1282
|
-
|
1283
|
-
Information in this decorator will augment any
|
1284
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1285
|
-
you can use `@pypi_base` to set packages required by all
|
1286
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1287
|
-
|
1288
|
-
Parameters
|
1289
|
-
----------
|
1290
|
-
packages : Dict[str, str], default: {}
|
1291
|
-
Packages to use for this step. The key is the name of the package
|
1292
|
-
and the value is the version to use.
|
1293
|
-
python : str, optional, default: None
|
1294
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1295
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1296
|
-
"""
|
1297
|
-
...
|
1298
|
-
|
1299
1332
|
@typing.overload
|
1300
1333
|
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]]]:
|
1301
1334
|
"""
|
@@ -1353,78 +1386,6 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
1353
1386
|
"""
|
1354
1387
|
...
|
1355
1388
|
|
1356
|
-
@typing.overload
|
1357
|
-
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]]]:
|
1358
|
-
"""
|
1359
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1360
|
-
the execution of a step.
|
1361
|
-
|
1362
|
-
Parameters
|
1363
|
-
----------
|
1364
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1365
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1366
|
-
"""
|
1367
|
-
...
|
1368
|
-
|
1369
|
-
@typing.overload
|
1370
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1371
|
-
...
|
1372
|
-
|
1373
|
-
@typing.overload
|
1374
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1375
|
-
...
|
1376
|
-
|
1377
|
-
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]]] = []):
|
1378
|
-
"""
|
1379
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1380
|
-
the execution of a step.
|
1381
|
-
|
1382
|
-
Parameters
|
1383
|
-
----------
|
1384
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1385
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1386
|
-
"""
|
1387
|
-
...
|
1388
|
-
|
1389
|
-
@typing.overload
|
1390
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1391
|
-
"""
|
1392
|
-
Specifies the PyPI packages for all steps of the flow.
|
1393
|
-
|
1394
|
-
Use `@pypi_base` to set common packages required by all
|
1395
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1396
|
-
Parameters
|
1397
|
-
----------
|
1398
|
-
packages : Dict[str, str], default: {}
|
1399
|
-
Packages to use for this flow. The key is the name of the package
|
1400
|
-
and the value is the version to use.
|
1401
|
-
python : str, optional, default: None
|
1402
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1403
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1404
|
-
"""
|
1405
|
-
...
|
1406
|
-
|
1407
|
-
@typing.overload
|
1408
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1409
|
-
...
|
1410
|
-
|
1411
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1412
|
-
"""
|
1413
|
-
Specifies the PyPI packages for all steps of the flow.
|
1414
|
-
|
1415
|
-
Use `@pypi_base` to set common packages required by all
|
1416
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1417
|
-
Parameters
|
1418
|
-
----------
|
1419
|
-
packages : Dict[str, str], default: {}
|
1420
|
-
Packages to use for this flow. The key is the name of the package
|
1421
|
-
and the value is the version to use.
|
1422
|
-
python : str, optional, default: None
|
1423
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1424
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1425
|
-
"""
|
1426
|
-
...
|
1427
|
-
|
1428
1389
|
@typing.overload
|
1429
1390
|
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]]:
|
1430
1391
|
"""
|
@@ -1474,138 +1435,58 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1474
1435
|
"""
|
1475
1436
|
...
|
1476
1437
|
|
1477
|
-
|
1438
|
+
@typing.overload
|
1439
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1478
1440
|
"""
|
1479
|
-
|
1480
|
-
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.
|
1441
|
+
Specifies the PyPI packages for all steps of the flow.
|
1481
1442
|
|
1443
|
+
Use `@pypi_base` to set common packages required by all
|
1444
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1482
1445
|
Parameters
|
1483
1446
|
----------
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
exponential_backoff : bool
|
1491
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1492
|
-
pool : str
|
1493
|
-
the slot pool this task should run in,
|
1494
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1495
|
-
soft_fail : bool
|
1496
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1497
|
-
name : str
|
1498
|
-
Name of the sensor on Airflow
|
1499
|
-
description : str
|
1500
|
-
Description of sensor in the Airflow UI
|
1501
|
-
external_dag_id : str
|
1502
|
-
The dag_id that contains the task you want to wait for.
|
1503
|
-
external_task_ids : List[str]
|
1504
|
-
The list of task_ids that you want to wait for.
|
1505
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
1506
|
-
allowed_states : List[str]
|
1507
|
-
Iterable of allowed states, (Default: ['success'])
|
1508
|
-
failed_states : List[str]
|
1509
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
1510
|
-
execution_delta : datetime.timedelta
|
1511
|
-
time difference with the previous execution to look at,
|
1512
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
1513
|
-
check_existence: bool
|
1514
|
-
Set to True to check if the external task exists or check if
|
1515
|
-
the DAG to wait for exists. (Default: True)
|
1447
|
+
packages : Dict[str, str], default: {}
|
1448
|
+
Packages to use for this flow. The key is the name of the package
|
1449
|
+
and the value is the version to use.
|
1450
|
+
python : str, optional, default: None
|
1451
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1452
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1516
1453
|
"""
|
1517
1454
|
...
|
1518
1455
|
|
1519
1456
|
@typing.overload
|
1520
|
-
def
|
1457
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1458
|
+
...
|
1459
|
+
|
1460
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1521
1461
|
"""
|
1522
|
-
Specifies the
|
1523
|
-
|
1524
|
-
```
|
1525
|
-
@trigger(event='foo')
|
1526
|
-
```
|
1527
|
-
or
|
1528
|
-
```
|
1529
|
-
@trigger(events=['foo', 'bar'])
|
1530
|
-
```
|
1531
|
-
|
1532
|
-
Additionally, you can specify the parameter mappings
|
1533
|
-
to map event payload to Metaflow parameters for the flow.
|
1534
|
-
```
|
1535
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1536
|
-
```
|
1537
|
-
or
|
1538
|
-
```
|
1539
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1540
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1541
|
-
```
|
1542
|
-
|
1543
|
-
'parameters' can also be a list of strings and tuples like so:
|
1544
|
-
```
|
1545
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1546
|
-
```
|
1547
|
-
This is equivalent to:
|
1548
|
-
```
|
1549
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1550
|
-
```
|
1462
|
+
Specifies the PyPI packages for all steps of the flow.
|
1551
1463
|
|
1464
|
+
Use `@pypi_base` to set common packages required by all
|
1465
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1552
1466
|
Parameters
|
1553
1467
|
----------
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1468
|
+
packages : Dict[str, str], default: {}
|
1469
|
+
Packages to use for this flow. The key is the name of the package
|
1470
|
+
and the value is the version to use.
|
1471
|
+
python : str, optional, default: None
|
1472
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1473
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1562
1474
|
"""
|
1563
1475
|
...
|
1564
1476
|
|
1565
|
-
|
1566
|
-
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1567
|
-
...
|
1568
|
-
|
1569
|
-
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] = {}):
|
1477
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1570
1478
|
"""
|
1571
|
-
Specifies
|
1572
|
-
|
1573
|
-
```
|
1574
|
-
@trigger(event='foo')
|
1575
|
-
```
|
1576
|
-
or
|
1577
|
-
```
|
1578
|
-
@trigger(events=['foo', 'bar'])
|
1579
|
-
```
|
1580
|
-
|
1581
|
-
Additionally, you can specify the parameter mappings
|
1582
|
-
to map event payload to Metaflow parameters for the flow.
|
1583
|
-
```
|
1584
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1585
|
-
```
|
1586
|
-
or
|
1587
|
-
```
|
1588
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1589
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1590
|
-
```
|
1479
|
+
Specifies what flows belong to the same project.
|
1591
1480
|
|
1592
|
-
|
1593
|
-
|
1594
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1595
|
-
```
|
1596
|
-
This is equivalent to:
|
1597
|
-
```
|
1598
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1599
|
-
```
|
1481
|
+
A project-specific namespace is created for all flows that
|
1482
|
+
use the same `@project(name)`.
|
1600
1483
|
|
1601
1484
|
Parameters
|
1602
1485
|
----------
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
options : Dict[str, Any], default {}
|
1608
|
-
Backend-specific configuration for tuning eventing behavior.
|
1486
|
+
name : str
|
1487
|
+
Project name. Make sure that the name is unique amongst all
|
1488
|
+
projects that use the same production scheduler. The name may
|
1489
|
+
contain only lowercase alphanumeric characters and underscores.
|
1609
1490
|
|
1610
1491
|
|
1611
1492
|
"""
|
@@ -1653,21 +1534,45 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
1653
1534
|
"""
|
1654
1535
|
...
|
1655
1536
|
|
1656
|
-
def
|
1537
|
+
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]]:
|
1657
1538
|
"""
|
1658
|
-
|
1659
|
-
|
1660
|
-
A project-specific namespace is created for all flows that
|
1661
|
-
use the same `@project(name)`.
|
1539
|
+
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.
|
1540
|
+
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.
|
1662
1541
|
|
1663
1542
|
Parameters
|
1664
1543
|
----------
|
1544
|
+
timeout : int
|
1545
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1546
|
+
poke_interval : int
|
1547
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1548
|
+
mode : str
|
1549
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1550
|
+
exponential_backoff : bool
|
1551
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1552
|
+
pool : str
|
1553
|
+
the slot pool this task should run in,
|
1554
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1555
|
+
soft_fail : bool
|
1556
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1665
1557
|
name : str
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1558
|
+
Name of the sensor on Airflow
|
1559
|
+
description : str
|
1560
|
+
Description of sensor in the Airflow UI
|
1561
|
+
external_dag_id : str
|
1562
|
+
The dag_id that contains the task you want to wait for.
|
1563
|
+
external_task_ids : List[str]
|
1564
|
+
The list of task_ids that you want to wait for.
|
1565
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1566
|
+
allowed_states : List[str]
|
1567
|
+
Iterable of allowed states, (Default: ['success'])
|
1568
|
+
failed_states : List[str]
|
1569
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1570
|
+
execution_delta : datetime.timedelta
|
1571
|
+
time difference with the previous execution to look at,
|
1572
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1573
|
+
check_existence: bool
|
1574
|
+
Set to True to check if the external task exists or check if
|
1575
|
+
the DAG to wait for exists. (Default: True)
|
1671
1576
|
"""
|
1672
1577
|
...
|
1673
1578
|
|
@@ -1823,6 +1728,101 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1823
1728
|
"""
|
1824
1729
|
...
|
1825
1730
|
|
1731
|
+
@typing.overload
|
1732
|
+
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]]:
|
1733
|
+
"""
|
1734
|
+
Specifies the event(s) that this flow depends on.
|
1735
|
+
|
1736
|
+
```
|
1737
|
+
@trigger(event='foo')
|
1738
|
+
```
|
1739
|
+
or
|
1740
|
+
```
|
1741
|
+
@trigger(events=['foo', 'bar'])
|
1742
|
+
```
|
1743
|
+
|
1744
|
+
Additionally, you can specify the parameter mappings
|
1745
|
+
to map event payload to Metaflow parameters for the flow.
|
1746
|
+
```
|
1747
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1748
|
+
```
|
1749
|
+
or
|
1750
|
+
```
|
1751
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1752
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1753
|
+
```
|
1754
|
+
|
1755
|
+
'parameters' can also be a list of strings and tuples like so:
|
1756
|
+
```
|
1757
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1758
|
+
```
|
1759
|
+
This is equivalent to:
|
1760
|
+
```
|
1761
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1762
|
+
```
|
1763
|
+
|
1764
|
+
Parameters
|
1765
|
+
----------
|
1766
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1767
|
+
Event dependency for this flow.
|
1768
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1769
|
+
Events dependency for this flow.
|
1770
|
+
options : Dict[str, Any], default {}
|
1771
|
+
Backend-specific configuration for tuning eventing behavior.
|
1772
|
+
|
1773
|
+
|
1774
|
+
"""
|
1775
|
+
...
|
1776
|
+
|
1777
|
+
@typing.overload
|
1778
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1779
|
+
...
|
1780
|
+
|
1781
|
+
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] = {}):
|
1782
|
+
"""
|
1783
|
+
Specifies the event(s) that this flow depends on.
|
1784
|
+
|
1785
|
+
```
|
1786
|
+
@trigger(event='foo')
|
1787
|
+
```
|
1788
|
+
or
|
1789
|
+
```
|
1790
|
+
@trigger(events=['foo', 'bar'])
|
1791
|
+
```
|
1792
|
+
|
1793
|
+
Additionally, you can specify the parameter mappings
|
1794
|
+
to map event payload to Metaflow parameters for the flow.
|
1795
|
+
```
|
1796
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1797
|
+
```
|
1798
|
+
or
|
1799
|
+
```
|
1800
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1801
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1802
|
+
```
|
1803
|
+
|
1804
|
+
'parameters' can also be a list of strings and tuples like so:
|
1805
|
+
```
|
1806
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1807
|
+
```
|
1808
|
+
This is equivalent to:
|
1809
|
+
```
|
1810
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1811
|
+
```
|
1812
|
+
|
1813
|
+
Parameters
|
1814
|
+
----------
|
1815
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1816
|
+
Event dependency for this flow.
|
1817
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1818
|
+
Events dependency for this flow.
|
1819
|
+
options : Dict[str, Any], default {}
|
1820
|
+
Backend-specific configuration for tuning eventing behavior.
|
1821
|
+
|
1822
|
+
|
1823
|
+
"""
|
1824
|
+
...
|
1825
|
+
|
1826
1826
|
def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
|
1827
1827
|
"""
|
1828
1828
|
Switch namespace to the one provided.
|