metaflow-stubs 2.12.3__py2.py3-none-any.whl → 2.12.5__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- metaflow-stubs/__init__.pyi +460 -459
- metaflow-stubs/cards.pyi +11 -5
- metaflow-stubs/cli.pyi +3 -3
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +7 -7
- 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 +6 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +5 -5
- metaflow-stubs/metadata/metadata.pyi +3 -3
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +17 -17
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +11 -5
- metaflow-stubs/plugins/__init__.pyi +8 -2
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +3 -3
- 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 +4 -4
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +4 -4
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +5 -5
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +5 -5
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
- 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 +4 -4
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
- 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 +4 -4
- 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_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.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 +3 -3
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +9 -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 +3 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +3 -3
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +4 -4
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -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 +3 -3
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +4 -4
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.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 +4 -4
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +3 -3
- metaflow-stubs/plugins/logs_cli.pyi +3 -3
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +3 -3
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +4 -4
- 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/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +5 -5
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.12.3.dist-info → metaflow_stubs-2.12.5.dist-info}/METADATA +2 -2
- metaflow_stubs-2.12.5.dist-info/RECORD +142 -0
- {metaflow_stubs-2.12.3.dist-info → metaflow_stubs-2.12.5.dist-info}/WHEEL +1 -1
- metaflow_stubs-2.12.3.dist-info/RECORD +0 -142
- {metaflow_stubs-2.12.3.dist-info → metaflow_stubs-2.12.5.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,24 +1,25 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-06-
|
3
|
+
# MF version: 2.12.5 #
|
4
|
+
# Generated on 2024-06-20T19:51:33.982232 #
|
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.client.core
|
12
|
+
import metaflow.runner.metaflow_runner
|
13
|
+
import metaflow._vendor.click.types
|
14
|
+
import typing
|
11
15
|
import metaflow.parameters
|
16
|
+
import metaflow.flowspec
|
17
|
+
import metaflow.plugins.datatools.s3.s3
|
18
|
+
import datetime
|
12
19
|
import io
|
13
20
|
import metaflow.metaflow_current
|
14
21
|
import metaflow.datastore.inputs
|
15
|
-
import metaflow.plugins.datatools.s3.s3
|
16
|
-
import datetime
|
17
|
-
import typing
|
18
|
-
import metaflow.runner.metaflow_runner
|
19
22
|
import metaflow.events
|
20
|
-
import metaflow.client.core
|
21
|
-
import metaflow._vendor.click.types
|
22
23
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
23
24
|
StepFlag = typing.NewType("StepFlag", bool)
|
24
25
|
|
@@ -105,7 +106,7 @@ def metadata(ms: str) -> str:
|
|
105
106
|
"""
|
106
107
|
...
|
107
108
|
|
108
|
-
class FlowSpec(object, metaclass=
|
109
|
+
class FlowSpec(object, metaclass=metaflow.flowspec._FlowSpecMeta):
|
109
110
|
def __init__(self, use_cli = True):
|
110
111
|
"""
|
111
112
|
Construct a FlowSpec
|
@@ -727,151 +728,35 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
727
728
|
...
|
728
729
|
|
729
730
|
@typing.overload
|
730
|
-
def
|
731
|
-
"""
|
732
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
733
|
-
|
734
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
735
|
-
|
736
|
-
Parameters
|
737
|
-
----------
|
738
|
-
type : str, default 'default'
|
739
|
-
Card type.
|
740
|
-
id : str, optional, default None
|
741
|
-
If multiple cards are present, use this id to identify this card.
|
742
|
-
options : Dict[str, Any], default {}
|
743
|
-
Options passed to the card. The contents depend on the card type.
|
744
|
-
timeout : int, default 45
|
745
|
-
Interrupt reporting if it takes more than this many seconds.
|
746
|
-
|
747
|
-
|
748
|
-
"""
|
749
|
-
...
|
750
|
-
|
751
|
-
@typing.overload
|
752
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
753
|
-
...
|
754
|
-
|
755
|
-
@typing.overload
|
756
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
757
|
-
...
|
758
|
-
|
759
|
-
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):
|
760
|
-
"""
|
761
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
762
|
-
|
763
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
764
|
-
|
765
|
-
Parameters
|
766
|
-
----------
|
767
|
-
type : str, default 'default'
|
768
|
-
Card type.
|
769
|
-
id : str, optional, default None
|
770
|
-
If multiple cards are present, use this id to identify this card.
|
771
|
-
options : Dict[str, Any], default {}
|
772
|
-
Options passed to the card. The contents depend on the card type.
|
773
|
-
timeout : int, default 45
|
774
|
-
Interrupt reporting if it takes more than this many seconds.
|
775
|
-
|
776
|
-
|
777
|
-
"""
|
778
|
-
...
|
779
|
-
|
780
|
-
@typing.overload
|
781
|
-
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]]]:
|
782
|
-
"""
|
783
|
-
Specifies that the step will success under all circumstances.
|
784
|
-
|
785
|
-
The decorator will create an optional artifact, specified by `var`, which
|
786
|
-
contains the exception raised. You can use it to detect the presence
|
787
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
788
|
-
are missing.
|
789
|
-
|
790
|
-
Parameters
|
791
|
-
----------
|
792
|
-
var : str, optional, default None
|
793
|
-
Name of the artifact in which to store the caught exception.
|
794
|
-
If not specified, the exception is not stored.
|
795
|
-
print_exception : bool, default True
|
796
|
-
Determines whether or not the exception is printed to
|
797
|
-
stdout when caught.
|
798
|
-
"""
|
799
|
-
...
|
800
|
-
|
801
|
-
@typing.overload
|
802
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
803
|
-
...
|
804
|
-
|
805
|
-
@typing.overload
|
806
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
807
|
-
...
|
808
|
-
|
809
|
-
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):
|
810
|
-
"""
|
811
|
-
Specifies that the step will success under all circumstances.
|
812
|
-
|
813
|
-
The decorator will create an optional artifact, specified by `var`, which
|
814
|
-
contains the exception raised. You can use it to detect the presence
|
815
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
816
|
-
are missing.
|
817
|
-
|
818
|
-
Parameters
|
819
|
-
----------
|
820
|
-
var : str, optional, default None
|
821
|
-
Name of the artifact in which to store the caught exception.
|
822
|
-
If not specified, the exception is not stored.
|
823
|
-
print_exception : bool, default True
|
824
|
-
Determines whether or not the exception is printed to
|
825
|
-
stdout when caught.
|
826
|
-
"""
|
827
|
-
...
|
828
|
-
|
829
|
-
@typing.overload
|
830
|
-
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]]]:
|
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]]]:
|
831
732
|
"""
|
832
|
-
Specifies
|
833
|
-
|
834
|
-
Information in this decorator will augment any
|
835
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
836
|
-
you can use `@pypi_base` to set packages required by all
|
837
|
-
steps and use `@pypi` to specify step-specific overrides.
|
733
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
734
|
+
the execution of a step.
|
838
735
|
|
839
736
|
Parameters
|
840
737
|
----------
|
841
|
-
|
842
|
-
|
843
|
-
and the value is the version to use.
|
844
|
-
python : str, optional, default: None
|
845
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
846
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
738
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
739
|
+
List of secret specs, defining how the secrets are to be retrieved
|
847
740
|
"""
|
848
741
|
...
|
849
742
|
|
850
743
|
@typing.overload
|
851
|
-
def
|
744
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
852
745
|
...
|
853
746
|
|
854
747
|
@typing.overload
|
855
|
-
def
|
748
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
856
749
|
...
|
857
750
|
|
858
|
-
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]]] = []):
|
859
752
|
"""
|
860
|
-
Specifies
|
861
|
-
|
862
|
-
Information in this decorator will augment any
|
863
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
864
|
-
you can use `@pypi_base` to set packages required by all
|
865
|
-
steps and use `@pypi` to specify step-specific overrides.
|
753
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
754
|
+
the execution of a step.
|
866
755
|
|
867
756
|
Parameters
|
868
757
|
----------
|
869
|
-
|
870
|
-
|
871
|
-
and the value is the version to use.
|
872
|
-
python : str, optional, default: None
|
873
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
874
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
758
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
759
|
+
List of secret specs, defining how the secrets are to be retrieved
|
875
760
|
"""
|
876
761
|
...
|
877
762
|
|
@@ -1022,48 +907,246 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1022
907
|
"""
|
1023
908
|
...
|
1024
909
|
|
1025
|
-
|
1026
|
-
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]]]:
|
910
|
+
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]]]:
|
1027
911
|
"""
|
1028
|
-
Specifies
|
1029
|
-
to a step needs to be retried.
|
912
|
+
Specifies that this step should execute on Kubernetes.
|
1030
913
|
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
914
|
+
Parameters
|
915
|
+
----------
|
916
|
+
cpu : int, default 1
|
917
|
+
Number of CPUs required for this step. If `@resources` is
|
918
|
+
also present, the maximum value from all decorators is used.
|
919
|
+
memory : int, default 4096
|
920
|
+
Memory size (in MB) required for this step. If
|
921
|
+
`@resources` is also present, the maximum value from all decorators is
|
922
|
+
used.
|
923
|
+
disk : int, default 10240
|
924
|
+
Disk size (in MB) required for this step. If
|
925
|
+
`@resources` is also present, the maximum value from all decorators is
|
926
|
+
used.
|
927
|
+
image : str, optional, default None
|
928
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
929
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
930
|
+
not, a default Docker image mapping to the current version of Python is used.
|
931
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
932
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
933
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
934
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
935
|
+
secrets : List[str], optional, default None
|
936
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
937
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
938
|
+
in Metaflow configuration.
|
939
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
940
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
941
|
+
gpu : int, optional, default None
|
942
|
+
Number of GPUs required for this step. A value of zero implies that
|
943
|
+
the scheduled node should not have GPUs.
|
944
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
945
|
+
The vendor of the GPUs to be used for this step.
|
946
|
+
tolerations : List[str], default []
|
947
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
948
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
949
|
+
use_tmpfs : bool, default False
|
950
|
+
This enables an explicit tmpfs mount for this step.
|
951
|
+
tmpfs_tempdir : bool, default True
|
952
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
953
|
+
tmpfs_size : int, optional, default: None
|
954
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
955
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
956
|
+
memory allocated for this step.
|
957
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
958
|
+
Path to tmpfs mount for this step.
|
959
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
960
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
961
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
962
|
+
shared_memory: int, optional
|
963
|
+
Shared memory size (in MiB) required for this step
|
964
|
+
port: int, optional
|
965
|
+
Port number to specify in the Kubernetes job object
|
966
|
+
"""
|
967
|
+
...
|
968
|
+
|
969
|
+
@typing.overload
|
970
|
+
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]]]:
|
971
|
+
"""
|
972
|
+
Specifies the Conda environment for the step.
|
1034
973
|
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
974
|
+
Information in this decorator will augment any
|
975
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
976
|
+
you can use `@conda_base` to set packages required by all
|
977
|
+
steps and use `@conda` to specify step-specific overrides.
|
1038
978
|
|
1039
979
|
Parameters
|
1040
980
|
----------
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
981
|
+
packages : Dict[str, str], default {}
|
982
|
+
Packages to use for this step. The key is the name of the package
|
983
|
+
and the value is the version to use.
|
984
|
+
libraries : Dict[str, str], default {}
|
985
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
986
|
+
python : str, optional, default None
|
987
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
988
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
989
|
+
disabled : bool, default False
|
990
|
+
If set to True, disables @conda.
|
1045
991
|
"""
|
1046
992
|
...
|
1047
993
|
|
1048
994
|
@typing.overload
|
1049
|
-
def
|
995
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1050
996
|
...
|
1051
997
|
|
1052
998
|
@typing.overload
|
1053
|
-
def
|
999
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1054
1000
|
...
|
1055
1001
|
|
1056
|
-
def
|
1002
|
+
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):
|
1057
1003
|
"""
|
1058
|
-
Specifies the
|
1059
|
-
to a step needs to be retried.
|
1060
|
-
|
1061
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
1062
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
1063
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
1004
|
+
Specifies the Conda environment for the step.
|
1064
1005
|
|
1065
|
-
|
1066
|
-
|
1006
|
+
Information in this decorator will augment any
|
1007
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1008
|
+
you can use `@conda_base` to set packages required by all
|
1009
|
+
steps and use `@conda` to specify step-specific overrides.
|
1010
|
+
|
1011
|
+
Parameters
|
1012
|
+
----------
|
1013
|
+
packages : Dict[str, str], default {}
|
1014
|
+
Packages to use for this step. The key is the name of the package
|
1015
|
+
and the value is the version to use.
|
1016
|
+
libraries : Dict[str, str], default {}
|
1017
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1018
|
+
python : str, optional, default None
|
1019
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1020
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1021
|
+
disabled : bool, default False
|
1022
|
+
If set to True, disables @conda.
|
1023
|
+
"""
|
1024
|
+
...
|
1025
|
+
|
1026
|
+
@typing.overload
|
1027
|
+
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]]]:
|
1028
|
+
"""
|
1029
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1030
|
+
|
1031
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1032
|
+
|
1033
|
+
Parameters
|
1034
|
+
----------
|
1035
|
+
type : str, default 'default'
|
1036
|
+
Card type.
|
1037
|
+
id : str, optional, default None
|
1038
|
+
If multiple cards are present, use this id to identify this card.
|
1039
|
+
options : Dict[str, Any], default {}
|
1040
|
+
Options passed to the card. The contents depend on the card type.
|
1041
|
+
timeout : int, default 45
|
1042
|
+
Interrupt reporting if it takes more than this many seconds.
|
1043
|
+
|
1044
|
+
|
1045
|
+
"""
|
1046
|
+
...
|
1047
|
+
|
1048
|
+
@typing.overload
|
1049
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1050
|
+
...
|
1051
|
+
|
1052
|
+
@typing.overload
|
1053
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1054
|
+
...
|
1055
|
+
|
1056
|
+
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):
|
1057
|
+
"""
|
1058
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1059
|
+
|
1060
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1061
|
+
|
1062
|
+
Parameters
|
1063
|
+
----------
|
1064
|
+
type : str, default 'default'
|
1065
|
+
Card type.
|
1066
|
+
id : str, optional, default None
|
1067
|
+
If multiple cards are present, use this id to identify this card.
|
1068
|
+
options : Dict[str, Any], default {}
|
1069
|
+
Options passed to the card. The contents depend on the card type.
|
1070
|
+
timeout : int, default 45
|
1071
|
+
Interrupt reporting if it takes more than this many seconds.
|
1072
|
+
|
1073
|
+
|
1074
|
+
"""
|
1075
|
+
...
|
1076
|
+
|
1077
|
+
@typing.overload
|
1078
|
+
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]]]:
|
1079
|
+
"""
|
1080
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1081
|
+
|
1082
|
+
Parameters
|
1083
|
+
----------
|
1084
|
+
vars : Dict[str, str], default {}
|
1085
|
+
Dictionary of environment variables to set.
|
1086
|
+
"""
|
1087
|
+
...
|
1088
|
+
|
1089
|
+
@typing.overload
|
1090
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1091
|
+
...
|
1092
|
+
|
1093
|
+
@typing.overload
|
1094
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1095
|
+
...
|
1096
|
+
|
1097
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1098
|
+
"""
|
1099
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1100
|
+
|
1101
|
+
Parameters
|
1102
|
+
----------
|
1103
|
+
vars : Dict[str, str], default {}
|
1104
|
+
Dictionary of environment variables to set.
|
1105
|
+
"""
|
1106
|
+
...
|
1107
|
+
|
1108
|
+
@typing.overload
|
1109
|
+
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]]]:
|
1110
|
+
"""
|
1111
|
+
Specifies the number of times the task corresponding
|
1112
|
+
to a step needs to be retried.
|
1113
|
+
|
1114
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1115
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1116
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1117
|
+
|
1118
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1119
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1120
|
+
ensuring that the flow execution can continue.
|
1121
|
+
|
1122
|
+
Parameters
|
1123
|
+
----------
|
1124
|
+
times : int, default 3
|
1125
|
+
Number of times to retry this task.
|
1126
|
+
minutes_between_retries : int, default 2
|
1127
|
+
Number of minutes between retries.
|
1128
|
+
"""
|
1129
|
+
...
|
1130
|
+
|
1131
|
+
@typing.overload
|
1132
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1133
|
+
...
|
1134
|
+
|
1135
|
+
@typing.overload
|
1136
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1137
|
+
...
|
1138
|
+
|
1139
|
+
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):
|
1140
|
+
"""
|
1141
|
+
Specifies the number of times the task corresponding
|
1142
|
+
to a step needs to be retried.
|
1143
|
+
|
1144
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1145
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1146
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1147
|
+
|
1148
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1149
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1067
1150
|
ensuring that the flow execution can continue.
|
1068
1151
|
|
1069
1152
|
Parameters
|
@@ -1075,6 +1158,55 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1075
1158
|
"""
|
1076
1159
|
...
|
1077
1160
|
|
1161
|
+
@typing.overload
|
1162
|
+
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]]]:
|
1163
|
+
"""
|
1164
|
+
Specifies that the step will success under all circumstances.
|
1165
|
+
|
1166
|
+
The decorator will create an optional artifact, specified by `var`, which
|
1167
|
+
contains the exception raised. You can use it to detect the presence
|
1168
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
1169
|
+
are missing.
|
1170
|
+
|
1171
|
+
Parameters
|
1172
|
+
----------
|
1173
|
+
var : str, optional, default None
|
1174
|
+
Name of the artifact in which to store the caught exception.
|
1175
|
+
If not specified, the exception is not stored.
|
1176
|
+
print_exception : bool, default True
|
1177
|
+
Determines whether or not the exception is printed to
|
1178
|
+
stdout when caught.
|
1179
|
+
"""
|
1180
|
+
...
|
1181
|
+
|
1182
|
+
@typing.overload
|
1183
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1184
|
+
...
|
1185
|
+
|
1186
|
+
@typing.overload
|
1187
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1188
|
+
...
|
1189
|
+
|
1190
|
+
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):
|
1191
|
+
"""
|
1192
|
+
Specifies that the step will success under all circumstances.
|
1193
|
+
|
1194
|
+
The decorator will create an optional artifact, specified by `var`, which
|
1195
|
+
contains the exception raised. You can use it to detect the presence
|
1196
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
1197
|
+
are missing.
|
1198
|
+
|
1199
|
+
Parameters
|
1200
|
+
----------
|
1201
|
+
var : str, optional, default None
|
1202
|
+
Name of the artifact in which to store the caught exception.
|
1203
|
+
If not specified, the exception is not stored.
|
1204
|
+
print_exception : bool, default True
|
1205
|
+
Determines whether or not the exception is printed to
|
1206
|
+
stdout when caught.
|
1207
|
+
"""
|
1208
|
+
...
|
1209
|
+
|
1078
1210
|
@typing.overload
|
1079
1211
|
def resources(*, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1080
1212
|
"""
|
@@ -1152,98 +1284,6 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
1152
1284
|
"""
|
1153
1285
|
...
|
1154
1286
|
|
1155
|
-
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]]]:
|
1156
|
-
"""
|
1157
|
-
Specifies that this step should execute on Kubernetes.
|
1158
|
-
|
1159
|
-
Parameters
|
1160
|
-
----------
|
1161
|
-
cpu : int, default 1
|
1162
|
-
Number of CPUs required for this step. If `@resources` is
|
1163
|
-
also present, the maximum value from all decorators is used.
|
1164
|
-
memory : int, default 4096
|
1165
|
-
Memory size (in MB) required for this step. If
|
1166
|
-
`@resources` is also present, the maximum value from all decorators is
|
1167
|
-
used.
|
1168
|
-
disk : int, default 10240
|
1169
|
-
Disk size (in MB) required for this step. If
|
1170
|
-
`@resources` is also present, the maximum value from all decorators is
|
1171
|
-
used.
|
1172
|
-
image : str, optional, default None
|
1173
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
1174
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
1175
|
-
not, a default Docker image mapping to the current version of Python is used.
|
1176
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
1177
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
1178
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
1179
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
1180
|
-
secrets : List[str], optional, default None
|
1181
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
1182
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
1183
|
-
in Metaflow configuration.
|
1184
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
1185
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
1186
|
-
gpu : int, optional, default None
|
1187
|
-
Number of GPUs required for this step. A value of zero implies that
|
1188
|
-
the scheduled node should not have GPUs.
|
1189
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
1190
|
-
The vendor of the GPUs to be used for this step.
|
1191
|
-
tolerations : List[str], default []
|
1192
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
1193
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
1194
|
-
use_tmpfs : bool, default False
|
1195
|
-
This enables an explicit tmpfs mount for this step.
|
1196
|
-
tmpfs_tempdir : bool, default True
|
1197
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1198
|
-
tmpfs_size : int, optional, default: None
|
1199
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1200
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1201
|
-
memory allocated for this step.
|
1202
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
1203
|
-
Path to tmpfs mount for this step.
|
1204
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
1205
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
1206
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
1207
|
-
shared_memory: int, optional
|
1208
|
-
Shared memory size (in MiB) required for this step
|
1209
|
-
port: int, optional
|
1210
|
-
Port number to specify in the Kubernetes job object
|
1211
|
-
"""
|
1212
|
-
...
|
1213
|
-
|
1214
|
-
@typing.overload
|
1215
|
-
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]]]:
|
1216
|
-
"""
|
1217
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1218
|
-
the execution of a step.
|
1219
|
-
|
1220
|
-
Parameters
|
1221
|
-
----------
|
1222
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1223
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1224
|
-
"""
|
1225
|
-
...
|
1226
|
-
|
1227
|
-
@typing.overload
|
1228
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1229
|
-
...
|
1230
|
-
|
1231
|
-
@typing.overload
|
1232
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1233
|
-
...
|
1234
|
-
|
1235
|
-
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]]] = []):
|
1236
|
-
"""
|
1237
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1238
|
-
the execution of a step.
|
1239
|
-
|
1240
|
-
Parameters
|
1241
|
-
----------
|
1242
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1243
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1244
|
-
"""
|
1245
|
-
...
|
1246
|
-
|
1247
1287
|
@typing.overload
|
1248
1288
|
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]]]:
|
1249
1289
|
"""
|
@@ -1302,132 +1342,51 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
1302
1342
|
...
|
1303
1343
|
|
1304
1344
|
@typing.overload
|
1305
|
-
def
|
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]]]:
|
1306
1346
|
"""
|
1307
|
-
Specifies the
|
1347
|
+
Specifies the PyPI packages for the step.
|
1308
1348
|
|
1309
1349
|
Information in this decorator will augment any
|
1310
|
-
attributes set in the `@
|
1311
|
-
you can use `@
|
1312
|
-
steps and use `@
|
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.
|
1313
1353
|
|
1314
1354
|
Parameters
|
1315
1355
|
----------
|
1316
|
-
packages : Dict[str, str], default {}
|
1356
|
+
packages : Dict[str, str], default: {}
|
1317
1357
|
Packages to use for this step. The key is the name of the package
|
1318
1358
|
and the value is the version to use.
|
1319
|
-
|
1320
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1321
|
-
python : str, optional, default None
|
1359
|
+
python : str, optional, default: None
|
1322
1360
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1323
1361
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1324
|
-
disabled : bool, default False
|
1325
|
-
If set to True, disables @conda.
|
1326
1362
|
"""
|
1327
1363
|
...
|
1328
1364
|
|
1329
1365
|
@typing.overload
|
1330
|
-
def
|
1366
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1331
1367
|
...
|
1332
1368
|
|
1333
1369
|
@typing.overload
|
1334
|
-
def
|
1370
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1335
1371
|
...
|
1336
1372
|
|
1337
|
-
def
|
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):
|
1338
1374
|
"""
|
1339
|
-
Specifies the
|
1375
|
+
Specifies the PyPI packages for the step.
|
1340
1376
|
|
1341
1377
|
Information in this decorator will augment any
|
1342
|
-
attributes set in the `@
|
1343
|
-
you can use `@
|
1344
|
-
steps and use `@
|
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.
|
1345
1381
|
|
1346
1382
|
Parameters
|
1347
1383
|
----------
|
1348
|
-
packages : Dict[str, str], default {}
|
1384
|
+
packages : Dict[str, str], default: {}
|
1349
1385
|
Packages to use for this step. The key is the name of the package
|
1350
|
-
and the value is the version to use.
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1355
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1356
|
-
disabled : bool, default False
|
1357
|
-
If set to True, disables @conda.
|
1358
|
-
"""
|
1359
|
-
...
|
1360
|
-
|
1361
|
-
@typing.overload
|
1362
|
-
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]]]:
|
1363
|
-
"""
|
1364
|
-
Specifies environment variables to be set prior to the execution of a step.
|
1365
|
-
|
1366
|
-
Parameters
|
1367
|
-
----------
|
1368
|
-
vars : Dict[str, str], default {}
|
1369
|
-
Dictionary of environment variables to set.
|
1370
|
-
"""
|
1371
|
-
...
|
1372
|
-
|
1373
|
-
@typing.overload
|
1374
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1375
|
-
...
|
1376
|
-
|
1377
|
-
@typing.overload
|
1378
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1379
|
-
...
|
1380
|
-
|
1381
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1382
|
-
"""
|
1383
|
-
Specifies environment variables to be set prior to the execution of a step.
|
1384
|
-
|
1385
|
-
Parameters
|
1386
|
-
----------
|
1387
|
-
vars : Dict[str, str], default {}
|
1388
|
-
Dictionary of environment variables to set.
|
1389
|
-
"""
|
1390
|
-
...
|
1391
|
-
|
1392
|
-
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]]:
|
1393
|
-
"""
|
1394
|
-
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)
|
1395
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1396
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1397
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1398
|
-
starts only after all sensors finish.
|
1399
|
-
|
1400
|
-
Parameters
|
1401
|
-
----------
|
1402
|
-
timeout : int
|
1403
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1404
|
-
poke_interval : int
|
1405
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1406
|
-
mode : str
|
1407
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1408
|
-
exponential_backoff : bool
|
1409
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1410
|
-
pool : str
|
1411
|
-
the slot pool this task should run in,
|
1412
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1413
|
-
soft_fail : bool
|
1414
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1415
|
-
name : str
|
1416
|
-
Name of the sensor on Airflow
|
1417
|
-
description : str
|
1418
|
-
Description of sensor in the Airflow UI
|
1419
|
-
bucket_key : Union[str, List[str]]
|
1420
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1421
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1422
|
-
bucket_name : str
|
1423
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1424
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1425
|
-
wildcard_match : bool
|
1426
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1427
|
-
aws_conn_id : str
|
1428
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1429
|
-
verify : bool
|
1430
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
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.
|
1431
1390
|
"""
|
1432
1391
|
...
|
1433
1392
|
|
@@ -1480,6 +1439,119 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1480
1439
|
"""
|
1481
1440
|
...
|
1482
1441
|
|
1442
|
+
@typing.overload
|
1443
|
+
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]]:
|
1444
|
+
"""
|
1445
|
+
Specifies the event(s) that this flow depends on.
|
1446
|
+
|
1447
|
+
```
|
1448
|
+
@trigger(event='foo')
|
1449
|
+
```
|
1450
|
+
or
|
1451
|
+
```
|
1452
|
+
@trigger(events=['foo', 'bar'])
|
1453
|
+
```
|
1454
|
+
|
1455
|
+
Additionally, you can specify the parameter mappings
|
1456
|
+
to map event payload to Metaflow parameters for the flow.
|
1457
|
+
```
|
1458
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1459
|
+
```
|
1460
|
+
or
|
1461
|
+
```
|
1462
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1463
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1464
|
+
```
|
1465
|
+
|
1466
|
+
'parameters' can also be a list of strings and tuples like so:
|
1467
|
+
```
|
1468
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1469
|
+
```
|
1470
|
+
This is equivalent to:
|
1471
|
+
```
|
1472
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1473
|
+
```
|
1474
|
+
|
1475
|
+
Parameters
|
1476
|
+
----------
|
1477
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1478
|
+
Event dependency for this flow.
|
1479
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1480
|
+
Events dependency for this flow.
|
1481
|
+
options : Dict[str, Any], default {}
|
1482
|
+
Backend-specific configuration for tuning eventing behavior.
|
1483
|
+
|
1484
|
+
|
1485
|
+
"""
|
1486
|
+
...
|
1487
|
+
|
1488
|
+
@typing.overload
|
1489
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1490
|
+
...
|
1491
|
+
|
1492
|
+
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] = {}):
|
1493
|
+
"""
|
1494
|
+
Specifies the event(s) that this flow depends on.
|
1495
|
+
|
1496
|
+
```
|
1497
|
+
@trigger(event='foo')
|
1498
|
+
```
|
1499
|
+
or
|
1500
|
+
```
|
1501
|
+
@trigger(events=['foo', 'bar'])
|
1502
|
+
```
|
1503
|
+
|
1504
|
+
Additionally, you can specify the parameter mappings
|
1505
|
+
to map event payload to Metaflow parameters for the flow.
|
1506
|
+
```
|
1507
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1508
|
+
```
|
1509
|
+
or
|
1510
|
+
```
|
1511
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1512
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1513
|
+
```
|
1514
|
+
|
1515
|
+
'parameters' can also be a list of strings and tuples like so:
|
1516
|
+
```
|
1517
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1518
|
+
```
|
1519
|
+
This is equivalent to:
|
1520
|
+
```
|
1521
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1522
|
+
```
|
1523
|
+
|
1524
|
+
Parameters
|
1525
|
+
----------
|
1526
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1527
|
+
Event dependency for this flow.
|
1528
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1529
|
+
Events dependency for this flow.
|
1530
|
+
options : Dict[str, Any], default {}
|
1531
|
+
Backend-specific configuration for tuning eventing behavior.
|
1532
|
+
|
1533
|
+
|
1534
|
+
"""
|
1535
|
+
...
|
1536
|
+
|
1537
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1538
|
+
"""
|
1539
|
+
Specifies what flows belong to the same project.
|
1540
|
+
|
1541
|
+
A project-specific namespace is created for all flows that
|
1542
|
+
use the same `@project(name)`.
|
1543
|
+
|
1544
|
+
Parameters
|
1545
|
+
----------
|
1546
|
+
name : str
|
1547
|
+
Project name. Make sure that the name is unique amongst all
|
1548
|
+
projects that use the same production scheduler. The name may
|
1549
|
+
contain only lowercase alphanumeric characters and underscores.
|
1550
|
+
|
1551
|
+
|
1552
|
+
"""
|
1553
|
+
...
|
1554
|
+
|
1483
1555
|
@typing.overload
|
1484
1556
|
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]]:
|
1485
1557
|
"""
|
@@ -1529,21 +1601,45 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1529
1601
|
"""
|
1530
1602
|
...
|
1531
1603
|
|
1532
|
-
def
|
1604
|
+
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]]:
|
1533
1605
|
"""
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1606
|
+
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)
|
1607
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1608
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1609
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1610
|
+
starts only after all sensors finish.
|
1538
1611
|
|
1539
1612
|
Parameters
|
1540
1613
|
----------
|
1614
|
+
timeout : int
|
1615
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1616
|
+
poke_interval : int
|
1617
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1618
|
+
mode : str
|
1619
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1620
|
+
exponential_backoff : bool
|
1621
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1622
|
+
pool : str
|
1623
|
+
the slot pool this task should run in,
|
1624
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1625
|
+
soft_fail : bool
|
1626
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1541
1627
|
name : str
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1628
|
+
Name of the sensor on Airflow
|
1629
|
+
description : str
|
1630
|
+
Description of sensor in the Airflow UI
|
1631
|
+
bucket_key : Union[str, List[str]]
|
1632
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1633
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1634
|
+
bucket_name : str
|
1635
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1636
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1637
|
+
wildcard_match : bool
|
1638
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1639
|
+
aws_conn_id : str
|
1640
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1641
|
+
verify : bool
|
1642
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1547
1643
|
"""
|
1548
1644
|
...
|
1549
1645
|
|
@@ -1589,101 +1685,6 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1589
1685
|
"""
|
1590
1686
|
...
|
1591
1687
|
|
1592
|
-
@typing.overload
|
1593
|
-
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]]:
|
1594
|
-
"""
|
1595
|
-
Specifies the event(s) that this flow depends on.
|
1596
|
-
|
1597
|
-
```
|
1598
|
-
@trigger(event='foo')
|
1599
|
-
```
|
1600
|
-
or
|
1601
|
-
```
|
1602
|
-
@trigger(events=['foo', 'bar'])
|
1603
|
-
```
|
1604
|
-
|
1605
|
-
Additionally, you can specify the parameter mappings
|
1606
|
-
to map event payload to Metaflow parameters for the flow.
|
1607
|
-
```
|
1608
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1609
|
-
```
|
1610
|
-
or
|
1611
|
-
```
|
1612
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1613
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1614
|
-
```
|
1615
|
-
|
1616
|
-
'parameters' can also be a list of strings and tuples like so:
|
1617
|
-
```
|
1618
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1619
|
-
```
|
1620
|
-
This is equivalent to:
|
1621
|
-
```
|
1622
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1623
|
-
```
|
1624
|
-
|
1625
|
-
Parameters
|
1626
|
-
----------
|
1627
|
-
event : Union[str, Dict[str, Any]], optional, default None
|
1628
|
-
Event dependency for this flow.
|
1629
|
-
events : List[Union[str, Dict[str, Any]]], default []
|
1630
|
-
Events dependency for this flow.
|
1631
|
-
options : Dict[str, Any], default {}
|
1632
|
-
Backend-specific configuration for tuning eventing behavior.
|
1633
|
-
|
1634
|
-
|
1635
|
-
"""
|
1636
|
-
...
|
1637
|
-
|
1638
|
-
@typing.overload
|
1639
|
-
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1640
|
-
...
|
1641
|
-
|
1642
|
-
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] = {}):
|
1643
|
-
"""
|
1644
|
-
Specifies the event(s) that this flow depends on.
|
1645
|
-
|
1646
|
-
```
|
1647
|
-
@trigger(event='foo')
|
1648
|
-
```
|
1649
|
-
or
|
1650
|
-
```
|
1651
|
-
@trigger(events=['foo', 'bar'])
|
1652
|
-
```
|
1653
|
-
|
1654
|
-
Additionally, you can specify the parameter mappings
|
1655
|
-
to map event payload to Metaflow parameters for the flow.
|
1656
|
-
```
|
1657
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1658
|
-
```
|
1659
|
-
or
|
1660
|
-
```
|
1661
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1662
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1663
|
-
```
|
1664
|
-
|
1665
|
-
'parameters' can also be a list of strings and tuples like so:
|
1666
|
-
```
|
1667
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1668
|
-
```
|
1669
|
-
This is equivalent to:
|
1670
|
-
```
|
1671
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1672
|
-
```
|
1673
|
-
|
1674
|
-
Parameters
|
1675
|
-
----------
|
1676
|
-
event : Union[str, Dict[str, Any]], optional, default None
|
1677
|
-
Event dependency for this flow.
|
1678
|
-
events : List[Union[str, Dict[str, Any]]], default []
|
1679
|
-
Events dependency for this flow.
|
1680
|
-
options : Dict[str, Any], default {}
|
1681
|
-
Backend-specific configuration for tuning eventing behavior.
|
1682
|
-
|
1683
|
-
|
1684
|
-
"""
|
1685
|
-
...
|
1686
|
-
|
1687
1688
|
@typing.overload
|
1688
1689
|
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1689
1690
|
"""
|