ob-metaflow-stubs 3.6__py2.py3-none-any.whl → 3.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 +470 -470
- metaflow-stubs/cards.pyi +5 -5
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +3 -3
- 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 +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- 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 +18 -18
- 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 +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 +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 +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 +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_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
- 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 +5 -5
- 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 +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 +4 -4
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +3 -3
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
- 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 +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +4 -4
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- 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/perimeters.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 +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 +5 -5
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- {ob_metaflow_stubs-3.6.dist-info → ob_metaflow_stubs-3.7.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-3.7.dist-info/RECORD +138 -0
- ob_metaflow_stubs-3.6.dist-info/RECORD +0 -138
- {ob_metaflow_stubs-3.6.dist-info → ob_metaflow_stubs-3.7.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-3.6.dist-info → ob_metaflow_stubs-3.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.16.
|
4
|
-
# Generated on 2024-05-
|
3
|
+
# MF version: 2.11.16.2+ob(v1) #
|
4
|
+
# Generated on 2024-05-22T22:08:54.490721 #
|
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
|
11
12
|
import metaflow.metaflow_current
|
12
|
-
import
|
13
|
-
import datetime
|
13
|
+
import io
|
14
14
|
import metaflow.events
|
15
|
+
import datetime
|
16
|
+
import metaflow.parameters
|
15
17
|
import metaflow.datastore.inputs
|
16
18
|
import typing
|
17
|
-
import metaflow._vendor.click.types
|
18
|
-
import metaflow.client.core
|
19
|
-
import io
|
20
19
|
import metaflow.plugins.datatools.s3.s3
|
20
|
+
import metaflow._vendor.click.types
|
21
21
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
22
22
|
StepFlag = typing.NewType("StepFlag", bool)
|
23
23
|
|
@@ -726,51 +726,244 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
726
726
|
...
|
727
727
|
|
728
728
|
@typing.overload
|
729
|
-
def
|
729
|
+
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]]]:
|
730
730
|
"""
|
731
|
-
Specifies
|
731
|
+
Specifies a timeout for your step.
|
732
|
+
|
733
|
+
This decorator is useful if this step may hang indefinitely.
|
734
|
+
|
735
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
736
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
737
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
738
|
+
|
739
|
+
Note that all the values specified in parameters are added together so if you specify
|
740
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
741
|
+
|
742
|
+
Parameters
|
743
|
+
----------
|
744
|
+
seconds : int, default 0
|
745
|
+
Number of seconds to wait prior to timing out.
|
746
|
+
minutes : int, default 0
|
747
|
+
Number of minutes to wait prior to timing out.
|
748
|
+
hours : int, default 0
|
749
|
+
Number of hours to wait prior to timing out.
|
750
|
+
"""
|
751
|
+
...
|
752
|
+
|
753
|
+
@typing.overload
|
754
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
755
|
+
...
|
756
|
+
|
757
|
+
@typing.overload
|
758
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
759
|
+
...
|
760
|
+
|
761
|
+
def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
|
762
|
+
"""
|
763
|
+
Specifies a timeout for your step.
|
764
|
+
|
765
|
+
This decorator is useful if this step may hang indefinitely.
|
766
|
+
|
767
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
768
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
769
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
770
|
+
|
771
|
+
Note that all the values specified in parameters are added together so if you specify
|
772
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
773
|
+
|
774
|
+
Parameters
|
775
|
+
----------
|
776
|
+
seconds : int, default 0
|
777
|
+
Number of seconds to wait prior to timing out.
|
778
|
+
minutes : int, default 0
|
779
|
+
Number of minutes to wait prior to timing out.
|
780
|
+
hours : int, default 0
|
781
|
+
Number of hours to wait prior to timing out.
|
782
|
+
"""
|
783
|
+
...
|
784
|
+
|
785
|
+
@typing.overload
|
786
|
+
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]]]:
|
787
|
+
"""
|
788
|
+
Specifies the resources needed when executing this step.
|
789
|
+
|
790
|
+
Use `@resources` to specify the resource requirements
|
791
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
792
|
+
|
793
|
+
You can choose the compute layer on the command line by executing e.g.
|
794
|
+
```
|
795
|
+
python myflow.py run --with batch
|
796
|
+
```
|
797
|
+
or
|
798
|
+
```
|
799
|
+
python myflow.py run --with kubernetes
|
800
|
+
```
|
801
|
+
which executes the flow on the desired system using the
|
802
|
+
requirements specified in `@resources`.
|
803
|
+
|
804
|
+
Parameters
|
805
|
+
----------
|
806
|
+
cpu : int, default 1
|
807
|
+
Number of CPUs required for this step.
|
808
|
+
gpu : int, default 0
|
809
|
+
Number of GPUs required for this step.
|
810
|
+
disk : int, optional, default None
|
811
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
812
|
+
memory : int, default 4096
|
813
|
+
Memory size (in MB) required for this step.
|
814
|
+
shared_memory : int, optional, default None
|
815
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
816
|
+
This parameter maps to the `--shm-size` option in Docker.
|
817
|
+
"""
|
818
|
+
...
|
819
|
+
|
820
|
+
@typing.overload
|
821
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
822
|
+
...
|
823
|
+
|
824
|
+
@typing.overload
|
825
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
826
|
+
...
|
827
|
+
|
828
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
829
|
+
"""
|
830
|
+
Specifies the resources needed when executing this step.
|
831
|
+
|
832
|
+
Use `@resources` to specify the resource requirements
|
833
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
834
|
+
|
835
|
+
You can choose the compute layer on the command line by executing e.g.
|
836
|
+
```
|
837
|
+
python myflow.py run --with batch
|
838
|
+
```
|
839
|
+
or
|
840
|
+
```
|
841
|
+
python myflow.py run --with kubernetes
|
842
|
+
```
|
843
|
+
which executes the flow on the desired system using the
|
844
|
+
requirements specified in `@resources`.
|
845
|
+
|
846
|
+
Parameters
|
847
|
+
----------
|
848
|
+
cpu : int, default 1
|
849
|
+
Number of CPUs required for this step.
|
850
|
+
gpu : int, default 0
|
851
|
+
Number of GPUs required for this step.
|
852
|
+
disk : int, optional, default None
|
853
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
854
|
+
memory : int, default 4096
|
855
|
+
Memory size (in MB) required for this step.
|
856
|
+
shared_memory : int, optional, default None
|
857
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
858
|
+
This parameter maps to the `--shm-size` option in Docker.
|
859
|
+
"""
|
860
|
+
...
|
861
|
+
|
862
|
+
@typing.overload
|
863
|
+
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]]]:
|
864
|
+
"""
|
865
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
866
|
+
|
867
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
868
|
+
|
869
|
+
Parameters
|
870
|
+
----------
|
871
|
+
type : str, default 'default'
|
872
|
+
Card type.
|
873
|
+
id : str, optional, default None
|
874
|
+
If multiple cards are present, use this id to identify this card.
|
875
|
+
options : Dict[str, Any], default {}
|
876
|
+
Options passed to the card. The contents depend on the card type.
|
877
|
+
timeout : int, default 45
|
878
|
+
Interrupt reporting if it takes more than this many seconds.
|
879
|
+
|
880
|
+
|
881
|
+
"""
|
882
|
+
...
|
883
|
+
|
884
|
+
@typing.overload
|
885
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
886
|
+
...
|
887
|
+
|
888
|
+
@typing.overload
|
889
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
890
|
+
...
|
891
|
+
|
892
|
+
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):
|
893
|
+
"""
|
894
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
895
|
+
|
896
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
897
|
+
|
898
|
+
Parameters
|
899
|
+
----------
|
900
|
+
type : str, default 'default'
|
901
|
+
Card type.
|
902
|
+
id : str, optional, default None
|
903
|
+
If multiple cards are present, use this id to identify this card.
|
904
|
+
options : Dict[str, Any], default {}
|
905
|
+
Options passed to the card. The contents depend on the card type.
|
906
|
+
timeout : int, default 45
|
907
|
+
Interrupt reporting if it takes more than this many seconds.
|
908
|
+
|
909
|
+
|
910
|
+
"""
|
911
|
+
...
|
912
|
+
|
913
|
+
@typing.overload
|
914
|
+
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]]]:
|
915
|
+
"""
|
916
|
+
Specifies the Conda environment for the step.
|
732
917
|
|
733
918
|
Information in this decorator will augment any
|
734
|
-
attributes set in the `@
|
735
|
-
you can use `@
|
736
|
-
steps and use `@
|
919
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
920
|
+
you can use `@conda_base` to set packages required by all
|
921
|
+
steps and use `@conda` to specify step-specific overrides.
|
737
922
|
|
738
923
|
Parameters
|
739
924
|
----------
|
740
|
-
packages : Dict[str, str], default
|
925
|
+
packages : Dict[str, str], default {}
|
741
926
|
Packages to use for this step. The key is the name of the package
|
742
927
|
and the value is the version to use.
|
743
|
-
|
928
|
+
libraries : Dict[str, str], default {}
|
929
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
930
|
+
python : str, optional, default None
|
744
931
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
745
932
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
933
|
+
disabled : bool, default False
|
934
|
+
If set to True, disables @conda.
|
746
935
|
"""
|
747
936
|
...
|
748
937
|
|
749
938
|
@typing.overload
|
750
|
-
def
|
939
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
751
940
|
...
|
752
941
|
|
753
942
|
@typing.overload
|
754
|
-
def
|
943
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
755
944
|
...
|
756
945
|
|
757
|
-
def
|
946
|
+
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):
|
758
947
|
"""
|
759
|
-
Specifies the
|
948
|
+
Specifies the Conda environment for the step.
|
760
949
|
|
761
950
|
Information in this decorator will augment any
|
762
|
-
attributes set in the `@
|
763
|
-
you can use `@
|
764
|
-
steps and use `@
|
951
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
952
|
+
you can use `@conda_base` to set packages required by all
|
953
|
+
steps and use `@conda` to specify step-specific overrides.
|
765
954
|
|
766
955
|
Parameters
|
767
956
|
----------
|
768
|
-
packages : Dict[str, str], default
|
957
|
+
packages : Dict[str, str], default {}
|
769
958
|
Packages to use for this step. The key is the name of the package
|
770
959
|
and the value is the version to use.
|
771
|
-
|
960
|
+
libraries : Dict[str, str], default {}
|
961
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
962
|
+
python : str, optional, default None
|
772
963
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
773
964
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
965
|
+
disabled : bool, default False
|
966
|
+
If set to True, disables @conda.
|
774
967
|
"""
|
775
968
|
...
|
776
969
|
|
@@ -922,55 +1115,35 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
922
1115
|
...
|
923
1116
|
|
924
1117
|
@typing.overload
|
925
|
-
def
|
1118
|
+
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]]]:
|
926
1119
|
"""
|
927
|
-
Specifies
|
928
|
-
|
929
|
-
|
930
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
931
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
932
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
933
|
-
|
934
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
935
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
936
|
-
ensuring that the flow execution can continue.
|
1120
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1121
|
+
the execution of a step.
|
937
1122
|
|
938
1123
|
Parameters
|
939
1124
|
----------
|
940
|
-
|
941
|
-
|
942
|
-
minutes_between_retries : int, default 2
|
943
|
-
Number of minutes between retries.
|
1125
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1126
|
+
List of secret specs, defining how the secrets are to be retrieved
|
944
1127
|
"""
|
945
1128
|
...
|
946
1129
|
|
947
1130
|
@typing.overload
|
948
|
-
def
|
1131
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
949
1132
|
...
|
950
1133
|
|
951
1134
|
@typing.overload
|
952
|
-
def
|
1135
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
953
1136
|
...
|
954
1137
|
|
955
|
-
def
|
1138
|
+
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]]] = []):
|
956
1139
|
"""
|
957
|
-
Specifies
|
958
|
-
|
959
|
-
|
960
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
961
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
962
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
963
|
-
|
964
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
965
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
966
|
-
ensuring that the flow execution can continue.
|
1140
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1141
|
+
the execution of a step.
|
967
1142
|
|
968
1143
|
Parameters
|
969
1144
|
----------
|
970
|
-
|
971
|
-
|
972
|
-
minutes_between_retries : int, default 2
|
973
|
-
Number of minutes between retries.
|
1145
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1146
|
+
List of secret specs, defining how the secrets are to be retrieved
|
974
1147
|
"""
|
975
1148
|
...
|
976
1149
|
|
@@ -1065,375 +1238,385 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
1065
1238
|
...
|
1066
1239
|
|
1067
1240
|
@typing.overload
|
1068
|
-
def
|
1241
|
+
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]]]:
|
1069
1242
|
"""
|
1070
|
-
Specifies
|
1071
|
-
|
1243
|
+
Specifies the PyPI packages for the step.
|
1244
|
+
|
1245
|
+
Information in this decorator will augment any
|
1246
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1247
|
+
you can use `@pypi_base` to set packages required by all
|
1248
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1072
1249
|
|
1073
1250
|
Parameters
|
1074
1251
|
----------
|
1075
|
-
|
1076
|
-
|
1252
|
+
packages : Dict[str, str], default: {}
|
1253
|
+
Packages to use for this step. The key is the name of the package
|
1254
|
+
and the value is the version to use.
|
1255
|
+
python : str, optional, default: None
|
1256
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1257
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1077
1258
|
"""
|
1078
1259
|
...
|
1079
1260
|
|
1080
1261
|
@typing.overload
|
1081
|
-
def
|
1262
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1082
1263
|
...
|
1083
1264
|
|
1084
1265
|
@typing.overload
|
1085
|
-
def
|
1266
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1086
1267
|
...
|
1087
1268
|
|
1088
|
-
def
|
1269
|
+
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):
|
1089
1270
|
"""
|
1090
|
-
Specifies
|
1091
|
-
|
1271
|
+
Specifies the PyPI packages for the step.
|
1272
|
+
|
1273
|
+
Information in this decorator will augment any
|
1274
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1275
|
+
you can use `@pypi_base` to set packages required by all
|
1276
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1092
1277
|
|
1093
1278
|
Parameters
|
1094
1279
|
----------
|
1095
|
-
|
1096
|
-
|
1280
|
+
packages : Dict[str, str], default: {}
|
1281
|
+
Packages to use for this step. The key is the name of the package
|
1282
|
+
and the value is the version to use.
|
1283
|
+
python : str, optional, default: None
|
1284
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1285
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1097
1286
|
"""
|
1098
1287
|
...
|
1099
1288
|
|
1100
1289
|
@typing.overload
|
1101
|
-
def
|
1290
|
+
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]]]:
|
1102
1291
|
"""
|
1103
|
-
Specifies the
|
1292
|
+
Specifies that the step will success under all circumstances.
|
1104
1293
|
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1294
|
+
The decorator will create an optional artifact, specified by `var`, which
|
1295
|
+
contains the exception raised. You can use it to detect the presence
|
1296
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
1297
|
+
are missing.
|
1109
1298
|
|
1110
1299
|
Parameters
|
1111
1300
|
----------
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1119
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1120
|
-
disabled : bool, default False
|
1121
|
-
If set to True, disables @conda.
|
1301
|
+
var : str, optional, default None
|
1302
|
+
Name of the artifact in which to store the caught exception.
|
1303
|
+
If not specified, the exception is not stored.
|
1304
|
+
print_exception : bool, default True
|
1305
|
+
Determines whether or not the exception is printed to
|
1306
|
+
stdout when caught.
|
1122
1307
|
"""
|
1123
1308
|
...
|
1124
1309
|
|
1125
1310
|
@typing.overload
|
1126
|
-
def
|
1311
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1127
1312
|
...
|
1128
1313
|
|
1129
1314
|
@typing.overload
|
1130
|
-
def
|
1315
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1131
1316
|
...
|
1132
1317
|
|
1133
|
-
def
|
1318
|
+
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):
|
1134
1319
|
"""
|
1135
|
-
Specifies the
|
1320
|
+
Specifies that the step will success under all circumstances.
|
1136
1321
|
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1322
|
+
The decorator will create an optional artifact, specified by `var`, which
|
1323
|
+
contains the exception raised. You can use it to detect the presence
|
1324
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
1325
|
+
are missing.
|
1141
1326
|
|
1142
1327
|
Parameters
|
1143
1328
|
----------
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1151
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1152
|
-
disabled : bool, default False
|
1153
|
-
If set to True, disables @conda.
|
1329
|
+
var : str, optional, default None
|
1330
|
+
Name of the artifact in which to store the caught exception.
|
1331
|
+
If not specified, the exception is not stored.
|
1332
|
+
print_exception : bool, default True
|
1333
|
+
Determines whether or not the exception is printed to
|
1334
|
+
stdout when caught.
|
1154
1335
|
"""
|
1155
1336
|
...
|
1156
1337
|
|
1157
1338
|
@typing.overload
|
1158
|
-
def
|
1339
|
+
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]]]:
|
1159
1340
|
"""
|
1160
|
-
Specifies the
|
1341
|
+
Specifies the number of times the task corresponding
|
1342
|
+
to a step needs to be retried.
|
1161
1343
|
|
1162
|
-
|
1163
|
-
|
1344
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1345
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1346
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1164
1347
|
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
```
|
1169
|
-
or
|
1170
|
-
```
|
1171
|
-
python myflow.py run --with kubernetes
|
1172
|
-
```
|
1173
|
-
which executes the flow on the desired system using the
|
1174
|
-
requirements specified in `@resources`.
|
1348
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1349
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1350
|
+
ensuring that the flow execution can continue.
|
1175
1351
|
|
1176
1352
|
Parameters
|
1177
1353
|
----------
|
1178
|
-
|
1179
|
-
Number of
|
1180
|
-
|
1181
|
-
Number of
|
1182
|
-
disk : int, optional, default None
|
1183
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1184
|
-
memory : int, default 4096
|
1185
|
-
Memory size (in MB) required for this step.
|
1186
|
-
shared_memory : int, optional, default None
|
1187
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1188
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1354
|
+
times : int, default 3
|
1355
|
+
Number of times to retry this task.
|
1356
|
+
minutes_between_retries : int, default 2
|
1357
|
+
Number of minutes between retries.
|
1189
1358
|
"""
|
1190
1359
|
...
|
1191
1360
|
|
1192
1361
|
@typing.overload
|
1193
|
-
def
|
1362
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1194
1363
|
...
|
1195
1364
|
|
1196
1365
|
@typing.overload
|
1197
|
-
def
|
1366
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1198
1367
|
...
|
1199
1368
|
|
1200
|
-
def
|
1369
|
+
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):
|
1201
1370
|
"""
|
1202
|
-
Specifies the
|
1371
|
+
Specifies the number of times the task corresponding
|
1372
|
+
to a step needs to be retried.
|
1203
1373
|
|
1204
|
-
|
1205
|
-
|
1374
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
1375
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
1376
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
1206
1377
|
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
```
|
1211
|
-
or
|
1212
|
-
```
|
1213
|
-
python myflow.py run --with kubernetes
|
1214
|
-
```
|
1215
|
-
which executes the flow on the desired system using the
|
1216
|
-
requirements specified in `@resources`.
|
1378
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
1379
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
1380
|
+
ensuring that the flow execution can continue.
|
1217
1381
|
|
1218
1382
|
Parameters
|
1219
1383
|
----------
|
1220
|
-
|
1221
|
-
Number of
|
1222
|
-
|
1223
|
-
Number of
|
1224
|
-
disk : int, optional, default None
|
1225
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1226
|
-
memory : int, default 4096
|
1227
|
-
Memory size (in MB) required for this step.
|
1228
|
-
shared_memory : int, optional, default None
|
1229
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1230
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1384
|
+
times : int, default 3
|
1385
|
+
Number of times to retry this task.
|
1386
|
+
minutes_between_retries : int, default 2
|
1387
|
+
Number of minutes between retries.
|
1231
1388
|
"""
|
1232
1389
|
...
|
1233
1390
|
|
1234
1391
|
@typing.overload
|
1235
|
-
def
|
1392
|
+
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]]:
|
1236
1393
|
"""
|
1237
|
-
|
1238
|
-
|
1239
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1394
|
+
Specifies the times when the flow should be run when running on a
|
1395
|
+
production scheduler.
|
1240
1396
|
|
1241
1397
|
Parameters
|
1242
1398
|
----------
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1399
|
+
hourly : bool, default False
|
1400
|
+
Run the workflow hourly.
|
1401
|
+
daily : bool, default True
|
1402
|
+
Run the workflow daily.
|
1403
|
+
weekly : bool, default False
|
1404
|
+
Run the workflow weekly.
|
1405
|
+
cron : str, optional, default None
|
1406
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1407
|
+
specified by this expression.
|
1408
|
+
timezone : str, optional, default None
|
1409
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1410
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1253
1411
|
"""
|
1254
1412
|
...
|
1255
1413
|
|
1256
1414
|
@typing.overload
|
1257
|
-
def
|
1258
|
-
...
|
1259
|
-
|
1260
|
-
@typing.overload
|
1261
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1415
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1262
1416
|
...
|
1263
1417
|
|
1264
|
-
def
|
1418
|
+
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
1265
1419
|
"""
|
1266
|
-
|
1267
|
-
|
1268
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1420
|
+
Specifies the times when the flow should be run when running on a
|
1421
|
+
production scheduler.
|
1269
1422
|
|
1270
1423
|
Parameters
|
1271
1424
|
----------
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1425
|
+
hourly : bool, default False
|
1426
|
+
Run the workflow hourly.
|
1427
|
+
daily : bool, default True
|
1428
|
+
Run the workflow daily.
|
1429
|
+
weekly : bool, default False
|
1430
|
+
Run the workflow weekly.
|
1431
|
+
cron : str, optional, default None
|
1432
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1433
|
+
specified by this expression.
|
1434
|
+
timezone : str, optional, default None
|
1435
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1436
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1282
1437
|
"""
|
1283
1438
|
...
|
1284
1439
|
|
1285
1440
|
@typing.overload
|
1286
|
-
def
|
1441
|
+
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]]:
|
1287
1442
|
"""
|
1288
|
-
Specifies
|
1443
|
+
Specifies the Conda environment for all steps of the flow.
|
1289
1444
|
|
1290
|
-
|
1291
|
-
|
1292
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1293
|
-
are missing.
|
1445
|
+
Use `@conda_base` to set common libraries required by all
|
1446
|
+
steps and use `@conda` to specify step-specific additions.
|
1294
1447
|
|
1295
1448
|
Parameters
|
1296
1449
|
----------
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1450
|
+
packages : Dict[str, str], default {}
|
1451
|
+
Packages to use for this flow. The key is the name of the package
|
1452
|
+
and the value is the version to use.
|
1453
|
+
libraries : Dict[str, str], default {}
|
1454
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1455
|
+
python : str, optional, default None
|
1456
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1457
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1458
|
+
disabled : bool, default False
|
1459
|
+
If set to True, disables Conda.
|
1303
1460
|
"""
|
1304
1461
|
...
|
1305
1462
|
|
1306
1463
|
@typing.overload
|
1307
|
-
def
|
1308
|
-
...
|
1309
|
-
|
1310
|
-
@typing.overload
|
1311
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1464
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1312
1465
|
...
|
1313
1466
|
|
1314
|
-
def
|
1467
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
1315
1468
|
"""
|
1316
|
-
Specifies
|
1469
|
+
Specifies the Conda environment for all steps of the flow.
|
1317
1470
|
|
1318
|
-
|
1319
|
-
|
1320
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
1321
|
-
are missing.
|
1471
|
+
Use `@conda_base` to set common libraries required by all
|
1472
|
+
steps and use `@conda` to specify step-specific additions.
|
1322
1473
|
|
1323
1474
|
Parameters
|
1324
1475
|
----------
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1476
|
+
packages : Dict[str, str], default {}
|
1477
|
+
Packages to use for this flow. The key is the name of the package
|
1478
|
+
and the value is the version to use.
|
1479
|
+
libraries : Dict[str, str], default {}
|
1480
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1481
|
+
python : str, optional, default None
|
1482
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1483
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1484
|
+
disabled : bool, default False
|
1485
|
+
If set to True, disables Conda.
|
1331
1486
|
"""
|
1332
1487
|
...
|
1333
1488
|
|
1334
1489
|
@typing.overload
|
1335
|
-
def
|
1490
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1336
1491
|
"""
|
1337
|
-
Specifies
|
1338
|
-
|
1339
|
-
This decorator is useful if this step may hang indefinitely.
|
1340
|
-
|
1341
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1342
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1343
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1344
|
-
|
1345
|
-
Note that all the values specified in parameters are added together so if you specify
|
1346
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1492
|
+
Specifies the PyPI packages for all steps of the flow.
|
1347
1493
|
|
1494
|
+
Use `@pypi_base` to set common packages required by all
|
1495
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1348
1496
|
Parameters
|
1349
1497
|
----------
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1498
|
+
packages : Dict[str, str], default: {}
|
1499
|
+
Packages to use for this flow. The key is the name of the package
|
1500
|
+
and the value is the version to use.
|
1501
|
+
python : str, optional, default: None
|
1502
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1503
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1356
1504
|
"""
|
1357
1505
|
...
|
1358
1506
|
|
1359
1507
|
@typing.overload
|
1360
|
-
def
|
1361
|
-
...
|
1362
|
-
|
1363
|
-
@typing.overload
|
1364
|
-
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1508
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1365
1509
|
...
|
1366
1510
|
|
1367
|
-
def
|
1511
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1368
1512
|
"""
|
1369
|
-
Specifies
|
1370
|
-
|
1371
|
-
This decorator is useful if this step may hang indefinitely.
|
1372
|
-
|
1373
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1374
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1375
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1376
|
-
|
1377
|
-
Note that all the values specified in parameters are added together so if you specify
|
1378
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1513
|
+
Specifies the PyPI packages for all steps of the flow.
|
1379
1514
|
|
1515
|
+
Use `@pypi_base` to set common packages required by all
|
1516
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1380
1517
|
Parameters
|
1381
1518
|
----------
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1519
|
+
packages : Dict[str, str], default: {}
|
1520
|
+
Packages to use for this flow. The key is the name of the package
|
1521
|
+
and the value is the version to use.
|
1522
|
+
python : str, optional, default: None
|
1523
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1524
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1388
1525
|
"""
|
1389
1526
|
...
|
1390
1527
|
|
1391
1528
|
@typing.overload
|
1392
|
-
def
|
1529
|
+
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]]:
|
1393
1530
|
"""
|
1394
|
-
Specifies the
|
1395
|
-
|
1531
|
+
Specifies the event(s) that this flow depends on.
|
1532
|
+
|
1533
|
+
```
|
1534
|
+
@trigger(event='foo')
|
1535
|
+
```
|
1536
|
+
or
|
1537
|
+
```
|
1538
|
+
@trigger(events=['foo', 'bar'])
|
1539
|
+
```
|
1540
|
+
|
1541
|
+
Additionally, you can specify the parameter mappings
|
1542
|
+
to map event payload to Metaflow parameters for the flow.
|
1543
|
+
```
|
1544
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1545
|
+
```
|
1546
|
+
or
|
1547
|
+
```
|
1548
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1549
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1550
|
+
```
|
1551
|
+
|
1552
|
+
'parameters' can also be a list of strings and tuples like so:
|
1553
|
+
```
|
1554
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1555
|
+
```
|
1556
|
+
This is equivalent to:
|
1557
|
+
```
|
1558
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1559
|
+
```
|
1560
|
+
|
1561
|
+
Parameters
|
1562
|
+
----------
|
1563
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1564
|
+
Event dependency for this flow.
|
1565
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1566
|
+
Events dependency for this flow.
|
1567
|
+
options : Dict[str, Any], default {}
|
1568
|
+
Backend-specific configuration for tuning eventing behavior.
|
1569
|
+
|
1396
1570
|
|
1397
|
-
Parameters
|
1398
|
-
----------
|
1399
|
-
hourly : bool, default False
|
1400
|
-
Run the workflow hourly.
|
1401
|
-
daily : bool, default True
|
1402
|
-
Run the workflow daily.
|
1403
|
-
weekly : bool, default False
|
1404
|
-
Run the workflow weekly.
|
1405
|
-
cron : str, optional, default None
|
1406
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1407
|
-
specified by this expression.
|
1408
|
-
timezone : str, optional, default None
|
1409
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1410
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1411
1571
|
"""
|
1412
1572
|
...
|
1413
1573
|
|
1414
1574
|
@typing.overload
|
1415
|
-
def
|
1575
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1416
1576
|
...
|
1417
1577
|
|
1418
|
-
def
|
1578
|
+
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] = {}):
|
1419
1579
|
"""
|
1420
|
-
Specifies the
|
1421
|
-
|
1580
|
+
Specifies the event(s) that this flow depends on.
|
1581
|
+
|
1582
|
+
```
|
1583
|
+
@trigger(event='foo')
|
1584
|
+
```
|
1585
|
+
or
|
1586
|
+
```
|
1587
|
+
@trigger(events=['foo', 'bar'])
|
1588
|
+
```
|
1589
|
+
|
1590
|
+
Additionally, you can specify the parameter mappings
|
1591
|
+
to map event payload to Metaflow parameters for the flow.
|
1592
|
+
```
|
1593
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1594
|
+
```
|
1595
|
+
or
|
1596
|
+
```
|
1597
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1598
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1599
|
+
```
|
1600
|
+
|
1601
|
+
'parameters' can also be a list of strings and tuples like so:
|
1602
|
+
```
|
1603
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1604
|
+
```
|
1605
|
+
This is equivalent to:
|
1606
|
+
```
|
1607
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1608
|
+
```
|
1422
1609
|
|
1423
1610
|
Parameters
|
1424
1611
|
----------
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
specified by this expression.
|
1434
|
-
timezone : str, optional, default None
|
1435
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1436
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1612
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1613
|
+
Event dependency for this flow.
|
1614
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1615
|
+
Events dependency for this flow.
|
1616
|
+
options : Dict[str, Any], default {}
|
1617
|
+
Backend-specific configuration for tuning eventing behavior.
|
1618
|
+
|
1619
|
+
|
1437
1620
|
"""
|
1438
1621
|
...
|
1439
1622
|
|
@@ -1479,55 +1662,6 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
1479
1662
|
"""
|
1480
1663
|
...
|
1481
1664
|
|
1482
|
-
@typing.overload
|
1483
|
-
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]]:
|
1484
|
-
"""
|
1485
|
-
Specifies the Conda environment for all steps of the flow.
|
1486
|
-
|
1487
|
-
Use `@conda_base` to set common libraries required by all
|
1488
|
-
steps and use `@conda` to specify step-specific additions.
|
1489
|
-
|
1490
|
-
Parameters
|
1491
|
-
----------
|
1492
|
-
packages : Dict[str, str], default {}
|
1493
|
-
Packages to use for this flow. The key is the name of the package
|
1494
|
-
and the value is the version to use.
|
1495
|
-
libraries : Dict[str, str], default {}
|
1496
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1497
|
-
python : str, optional, default None
|
1498
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1499
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1500
|
-
disabled : bool, default False
|
1501
|
-
If set to True, disables Conda.
|
1502
|
-
"""
|
1503
|
-
...
|
1504
|
-
|
1505
|
-
@typing.overload
|
1506
|
-
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1507
|
-
...
|
1508
|
-
|
1509
|
-
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
1510
|
-
"""
|
1511
|
-
Specifies the Conda environment for all steps of the flow.
|
1512
|
-
|
1513
|
-
Use `@conda_base` to set common libraries required by all
|
1514
|
-
steps and use `@conda` to specify step-specific additions.
|
1515
|
-
|
1516
|
-
Parameters
|
1517
|
-
----------
|
1518
|
-
packages : Dict[str, str], default {}
|
1519
|
-
Packages to use for this flow. The key is the name of the package
|
1520
|
-
and the value is the version to use.
|
1521
|
-
libraries : Dict[str, str], default {}
|
1522
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1523
|
-
python : str, optional, default None
|
1524
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1525
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1526
|
-
disabled : bool, default False
|
1527
|
-
If set to True, disables Conda.
|
1528
|
-
"""
|
1529
|
-
...
|
1530
|
-
|
1531
1665
|
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]]:
|
1532
1666
|
"""
|
1533
1667
|
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.
|
@@ -1588,45 +1722,6 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
|
|
1588
1722
|
"""
|
1589
1723
|
...
|
1590
1724
|
|
1591
|
-
@typing.overload
|
1592
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1593
|
-
"""
|
1594
|
-
Specifies the PyPI packages for all steps of the flow.
|
1595
|
-
|
1596
|
-
Use `@pypi_base` to set common packages required by all
|
1597
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1598
|
-
Parameters
|
1599
|
-
----------
|
1600
|
-
packages : Dict[str, str], default: {}
|
1601
|
-
Packages to use for this flow. The key is the name of the package
|
1602
|
-
and the value is the version to use.
|
1603
|
-
python : str, optional, default: None
|
1604
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1605
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1606
|
-
"""
|
1607
|
-
...
|
1608
|
-
|
1609
|
-
@typing.overload
|
1610
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1611
|
-
...
|
1612
|
-
|
1613
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1614
|
-
"""
|
1615
|
-
Specifies the PyPI packages for all steps of the flow.
|
1616
|
-
|
1617
|
-
Use `@pypi_base` to set common packages required by all
|
1618
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1619
|
-
Parameters
|
1620
|
-
----------
|
1621
|
-
packages : Dict[str, str], default: {}
|
1622
|
-
Packages to use for this flow. The key is the name of the package
|
1623
|
-
and the value is the version to use.
|
1624
|
-
python : str, optional, default: None
|
1625
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1626
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1627
|
-
"""
|
1628
|
-
...
|
1629
|
-
|
1630
1725
|
@typing.overload
|
1631
1726
|
def trigger_on_finish(*, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1632
1727
|
"""
|
@@ -1730,101 +1825,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1730
1825
|
"""
|
1731
1826
|
...
|
1732
1827
|
|
1733
|
-
@typing.overload
|
1734
|
-
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]]:
|
1735
|
-
"""
|
1736
|
-
Specifies the event(s) that this flow depends on.
|
1737
|
-
|
1738
|
-
```
|
1739
|
-
@trigger(event='foo')
|
1740
|
-
```
|
1741
|
-
or
|
1742
|
-
```
|
1743
|
-
@trigger(events=['foo', 'bar'])
|
1744
|
-
```
|
1745
|
-
|
1746
|
-
Additionally, you can specify the parameter mappings
|
1747
|
-
to map event payload to Metaflow parameters for the flow.
|
1748
|
-
```
|
1749
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1750
|
-
```
|
1751
|
-
or
|
1752
|
-
```
|
1753
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1754
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1755
|
-
```
|
1756
|
-
|
1757
|
-
'parameters' can also be a list of strings and tuples like so:
|
1758
|
-
```
|
1759
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1760
|
-
```
|
1761
|
-
This is equivalent to:
|
1762
|
-
```
|
1763
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1764
|
-
```
|
1765
|
-
|
1766
|
-
Parameters
|
1767
|
-
----------
|
1768
|
-
event : Union[str, Dict[str, Any]], optional, default None
|
1769
|
-
Event dependency for this flow.
|
1770
|
-
events : List[Union[str, Dict[str, Any]]], default []
|
1771
|
-
Events dependency for this flow.
|
1772
|
-
options : Dict[str, Any], default {}
|
1773
|
-
Backend-specific configuration for tuning eventing behavior.
|
1774
|
-
|
1775
|
-
|
1776
|
-
"""
|
1777
|
-
...
|
1778
|
-
|
1779
|
-
@typing.overload
|
1780
|
-
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1781
|
-
...
|
1782
|
-
|
1783
|
-
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] = {}):
|
1784
|
-
"""
|
1785
|
-
Specifies the event(s) that this flow depends on.
|
1786
|
-
|
1787
|
-
```
|
1788
|
-
@trigger(event='foo')
|
1789
|
-
```
|
1790
|
-
or
|
1791
|
-
```
|
1792
|
-
@trigger(events=['foo', 'bar'])
|
1793
|
-
```
|
1794
|
-
|
1795
|
-
Additionally, you can specify the parameter mappings
|
1796
|
-
to map event payload to Metaflow parameters for the flow.
|
1797
|
-
```
|
1798
|
-
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1799
|
-
```
|
1800
|
-
or
|
1801
|
-
```
|
1802
|
-
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1803
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1804
|
-
```
|
1805
|
-
|
1806
|
-
'parameters' can also be a list of strings and tuples like so:
|
1807
|
-
```
|
1808
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1809
|
-
```
|
1810
|
-
This is equivalent to:
|
1811
|
-
```
|
1812
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1813
|
-
```
|
1814
|
-
|
1815
|
-
Parameters
|
1816
|
-
----------
|
1817
|
-
event : Union[str, Dict[str, Any]], optional, default None
|
1818
|
-
Event dependency for this flow.
|
1819
|
-
events : List[Union[str, Dict[str, Any]]], default []
|
1820
|
-
Events dependency for this flow.
|
1821
|
-
options : Dict[str, Any], default {}
|
1822
|
-
Backend-specific configuration for tuning eventing behavior.
|
1823
|
-
|
1824
|
-
|
1825
|
-
"""
|
1826
|
-
...
|
1827
|
-
|
1828
1828
|
def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
|
1829
1829
|
"""
|
1830
1830
|
Switch namespace to the one provided.
|