ob-metaflow-stubs 2.11.9.1__py2.py3-none-any.whl → 3.1__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 +498 -495
- metaflow-stubs/cards.pyi +4 -4
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +3 -3
- metaflow-stubs/client/core.pyi +6 -6
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/clone_util.pyi +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 +2 -2
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +4 -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 +4 -4
- metaflow-stubs/plugins/__init__.pyi +3 -3
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +5 -5
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +4 -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 +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
- 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_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 +3 -3
- metaflow-stubs/plugins/cards/card_client.pyi +3 -3
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/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 +5 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +4 -4
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +4 -31
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.pyi +24 -0
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +4 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +16 -0
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- {ob_metaflow_stubs-2.11.9.1.dist-info → ob_metaflow_stubs-3.1.dist-info}/METADATA +1 -2
- ob_metaflow_stubs-3.1.dist-info/RECORD +134 -0
- {ob_metaflow_stubs-2.11.9.1.dist-info → ob_metaflow_stubs-3.1.dist-info}/WHEEL +1 -1
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +0 -100
- ob_metaflow_stubs-2.11.9.1.dist-info/RECORD +0 -133
- {ob_metaflow_stubs-2.11.9.1.dist-info → ob_metaflow_stubs-3.1.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.11.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.11.10.3+ob(v1) #
|
4
|
+
# Generated on 2024-05-06T19:56:35.236170 #
|
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.parameters
|
12
|
-
import metaflow.datastore.inputs
|
13
11
|
import metaflow.client.core
|
14
|
-
import metaflow.
|
15
|
-
import metaflow.
|
16
|
-
import io
|
12
|
+
import metaflow.parameters
|
13
|
+
import metaflow.metaflow_current
|
17
14
|
import datetime
|
18
|
-
import typing
|
19
15
|
import metaflow._vendor.click.types
|
20
|
-
import metaflow.
|
16
|
+
import metaflow.events
|
17
|
+
import typing
|
18
|
+
import io
|
19
|
+
import metaflow.datastore.inputs
|
20
|
+
import metaflow.plugins.datatools.s3.s3
|
21
21
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
22
22
|
StepFlag = typing.NewType("StepFlag", bool)
|
23
23
|
|
@@ -725,6 +725,116 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
725
725
|
"""
|
726
726
|
...
|
727
727
|
|
728
|
+
@typing.overload
|
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
|
+
"""
|
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 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]]]:
|
787
|
+
"""
|
788
|
+
Specifies the number of times the task corresponding
|
789
|
+
to a step needs to be retried.
|
790
|
+
|
791
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
792
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
793
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
794
|
+
|
795
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
796
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
797
|
+
ensuring that the flow execution can continue.
|
798
|
+
|
799
|
+
Parameters
|
800
|
+
----------
|
801
|
+
times : int, default 3
|
802
|
+
Number of times to retry this task.
|
803
|
+
minutes_between_retries : int, default 2
|
804
|
+
Number of minutes between retries.
|
805
|
+
"""
|
806
|
+
...
|
807
|
+
|
808
|
+
@typing.overload
|
809
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
810
|
+
...
|
811
|
+
|
812
|
+
@typing.overload
|
813
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
814
|
+
...
|
815
|
+
|
816
|
+
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):
|
817
|
+
"""
|
818
|
+
Specifies the number of times the task corresponding
|
819
|
+
to a step needs to be retried.
|
820
|
+
|
821
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
822
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
823
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
824
|
+
|
825
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
826
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
827
|
+
ensuring that the flow execution can continue.
|
828
|
+
|
829
|
+
Parameters
|
830
|
+
----------
|
831
|
+
times : int, default 3
|
832
|
+
Number of times to retry this task.
|
833
|
+
minutes_between_retries : int, default 2
|
834
|
+
Number of minutes between retries.
|
835
|
+
"""
|
836
|
+
...
|
837
|
+
|
728
838
|
@typing.overload
|
729
839
|
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]]]:
|
730
840
|
"""
|
@@ -803,126 +913,212 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
803
913
|
...
|
804
914
|
|
805
915
|
@typing.overload
|
806
|
-
def
|
916
|
+
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]]]:
|
807
917
|
"""
|
808
|
-
Specifies the
|
809
|
-
to a step needs to be retried.
|
810
|
-
|
811
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
812
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
813
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
918
|
+
Specifies the Conda environment for the step.
|
814
919
|
|
815
|
-
|
816
|
-
|
817
|
-
|
920
|
+
Information in this decorator will augment any
|
921
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
922
|
+
you can use `@conda_base` to set packages required by all
|
923
|
+
steps and use `@conda` to specify step-specific overrides.
|
818
924
|
|
819
925
|
Parameters
|
820
926
|
----------
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
927
|
+
packages : Dict[str, str], default {}
|
928
|
+
Packages to use for this step. The key is the name of the package
|
929
|
+
and the value is the version to use.
|
930
|
+
libraries : Dict[str, str], default {}
|
931
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
932
|
+
python : str, optional, default None
|
933
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
934
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
935
|
+
disabled : bool, default False
|
936
|
+
If set to True, disables @conda.
|
825
937
|
"""
|
826
938
|
...
|
827
939
|
|
828
940
|
@typing.overload
|
829
|
-
def
|
941
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
830
942
|
...
|
831
943
|
|
832
944
|
@typing.overload
|
833
|
-
def
|
945
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
834
946
|
...
|
835
947
|
|
836
|
-
def
|
948
|
+
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):
|
837
949
|
"""
|
838
|
-
Specifies the
|
839
|
-
to a step needs to be retried.
|
840
|
-
|
841
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
842
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
843
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
950
|
+
Specifies the Conda environment for the step.
|
844
951
|
|
845
|
-
|
846
|
-
|
847
|
-
|
952
|
+
Information in this decorator will augment any
|
953
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
954
|
+
you can use `@conda_base` to set packages required by all
|
955
|
+
steps and use `@conda` to specify step-specific overrides.
|
848
956
|
|
849
957
|
Parameters
|
850
958
|
----------
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
959
|
+
packages : Dict[str, str], default {}
|
960
|
+
Packages to use for this step. The key is the name of the package
|
961
|
+
and the value is the version to use.
|
962
|
+
libraries : Dict[str, str], default {}
|
963
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
964
|
+
python : str, optional, default None
|
965
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
966
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
967
|
+
disabled : bool, default False
|
968
|
+
If set to True, disables @conda.
|
855
969
|
"""
|
856
970
|
...
|
857
971
|
|
858
972
|
@typing.overload
|
859
|
-
def
|
973
|
+
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]]]:
|
860
974
|
"""
|
861
|
-
Specifies
|
862
|
-
|
863
|
-
This decorator is useful if this step may hang indefinitely.
|
864
|
-
|
865
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
866
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
867
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
975
|
+
Specifies the PyPI packages for the step.
|
868
976
|
|
869
|
-
|
870
|
-
|
977
|
+
Information in this decorator will augment any
|
978
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
979
|
+
you can use `@pypi_base` to set packages required by all
|
980
|
+
steps and use `@pypi` to specify step-specific overrides.
|
871
981
|
|
872
982
|
Parameters
|
873
983
|
----------
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
984
|
+
packages : Dict[str, str], default: {}
|
985
|
+
Packages to use for this step. The key is the name of the package
|
986
|
+
and the value is the version to use.
|
987
|
+
python : str, optional, default: None
|
988
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
989
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
880
990
|
"""
|
881
991
|
...
|
882
992
|
|
883
993
|
@typing.overload
|
884
|
-
def
|
994
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
885
995
|
...
|
886
996
|
|
887
997
|
@typing.overload
|
888
|
-
def
|
998
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
889
999
|
...
|
890
1000
|
|
891
|
-
def
|
1001
|
+
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):
|
892
1002
|
"""
|
893
|
-
Specifies
|
894
|
-
|
895
|
-
This decorator is useful if this step may hang indefinitely.
|
896
|
-
|
897
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
898
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
899
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1003
|
+
Specifies the PyPI packages for the step.
|
900
1004
|
|
901
|
-
|
902
|
-
|
1005
|
+
Information in this decorator will augment any
|
1006
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1007
|
+
you can use `@pypi_base` to set packages required by all
|
1008
|
+
steps and use `@pypi` to specify step-specific overrides.
|
903
1009
|
|
904
1010
|
Parameters
|
905
1011
|
----------
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
1012
|
+
packages : Dict[str, str], default: {}
|
1013
|
+
Packages to use for this step. The key is the name of the package
|
1014
|
+
and the value is the version to use.
|
1015
|
+
python : str, optional, default: None
|
1016
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1017
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
912
1018
|
"""
|
913
1019
|
...
|
914
1020
|
|
915
1021
|
@typing.overload
|
916
|
-
def
|
1022
|
+
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]]]:
|
917
1023
|
"""
|
918
|
-
Specifies
|
1024
|
+
Specifies environment variables to be set prior to the execution of a step.
|
919
1025
|
|
920
1026
|
Parameters
|
921
1027
|
----------
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
1028
|
+
vars : Dict[str, str], default {}
|
1029
|
+
Dictionary of environment variables to set.
|
1030
|
+
"""
|
1031
|
+
...
|
1032
|
+
|
1033
|
+
@typing.overload
|
1034
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1035
|
+
...
|
1036
|
+
|
1037
|
+
@typing.overload
|
1038
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1039
|
+
...
|
1040
|
+
|
1041
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1042
|
+
"""
|
1043
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1044
|
+
|
1045
|
+
Parameters
|
1046
|
+
----------
|
1047
|
+
vars : Dict[str, str], default {}
|
1048
|
+
Dictionary of environment variables to set.
|
1049
|
+
"""
|
1050
|
+
...
|
1051
|
+
|
1052
|
+
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]]]:
|
1053
|
+
"""
|
1054
|
+
Specifies that this step should execute on Kubernetes.
|
1055
|
+
|
1056
|
+
Parameters
|
1057
|
+
----------
|
1058
|
+
cpu : int, default 1
|
1059
|
+
Number of CPUs required for this step. If `@resources` is
|
1060
|
+
also present, the maximum value from all decorators is used.
|
1061
|
+
memory : int, default 4096
|
1062
|
+
Memory size (in MB) required for this step. If
|
1063
|
+
`@resources` is also present, the maximum value from all decorators is
|
1064
|
+
used.
|
1065
|
+
disk : int, default 10240
|
1066
|
+
Disk size (in MB) required for this step. If
|
1067
|
+
`@resources` is also present, the maximum value from all decorators is
|
1068
|
+
used.
|
1069
|
+
image : str, optional, default None
|
1070
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
1071
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
1072
|
+
not, a default Docker image mapping to the current version of Python is used.
|
1073
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
1074
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
1075
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
1076
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
1077
|
+
secrets : List[str], optional, default None
|
1078
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
1079
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
1080
|
+
in Metaflow configuration.
|
1081
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
1082
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
1083
|
+
gpu : int, optional, default None
|
1084
|
+
Number of GPUs required for this step. A value of zero implies that
|
1085
|
+
the scheduled node should not have GPUs.
|
1086
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
1087
|
+
The vendor of the GPUs to be used for this step.
|
1088
|
+
tolerations : List[str], default []
|
1089
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
1090
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
1091
|
+
use_tmpfs : bool, default False
|
1092
|
+
This enables an explicit tmpfs mount for this step.
|
1093
|
+
tmpfs_tempdir : bool, default True
|
1094
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1095
|
+
tmpfs_size : int, optional, default: None
|
1096
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
1097
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1098
|
+
memory allocated for this step.
|
1099
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
1100
|
+
Path to tmpfs mount for this step.
|
1101
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
1102
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
1103
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
1104
|
+
shared_memory: int, optional
|
1105
|
+
Shared memory size (in MiB) required for this step
|
1106
|
+
port: int, optional
|
1107
|
+
Port number to specify in the Kubernetes job object
|
1108
|
+
"""
|
1109
|
+
...
|
1110
|
+
|
1111
|
+
@typing.overload
|
1112
|
+
def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = "METAFLOW_BATCH_JOB_QUEUE", iam_role: str = "METAFLOW_ECS_S3_ACCESS_IAM_ROLE", execution_role: str = "METAFLOW_ECS_FARGATE_EXECUTION_ROLE", shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[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]]]:
|
1113
|
+
"""
|
1114
|
+
Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
|
1115
|
+
|
1116
|
+
Parameters
|
1117
|
+
----------
|
1118
|
+
cpu : int, default 1
|
1119
|
+
Number of CPUs required for this step. If `@resources` is
|
1120
|
+
also present, the maximum value from all decorators is used.
|
1121
|
+
gpu : int, default 0
|
926
1122
|
Number of GPUs required for this step. If `@resources` is
|
927
1123
|
also present, the maximum value from all decorators is used.
|
928
1124
|
memory : int, default 4096
|
@@ -1059,6 +1255,39 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1059
1255
|
"""
|
1060
1256
|
...
|
1061
1257
|
|
1258
|
+
@typing.overload
|
1259
|
+
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]]]:
|
1260
|
+
"""
|
1261
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1262
|
+
the execution of a step.
|
1263
|
+
|
1264
|
+
Parameters
|
1265
|
+
----------
|
1266
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1267
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1268
|
+
"""
|
1269
|
+
...
|
1270
|
+
|
1271
|
+
@typing.overload
|
1272
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1273
|
+
...
|
1274
|
+
|
1275
|
+
@typing.overload
|
1276
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1277
|
+
...
|
1278
|
+
|
1279
|
+
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]]] = []):
|
1280
|
+
"""
|
1281
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1282
|
+
the execution of a step.
|
1283
|
+
|
1284
|
+
Parameters
|
1285
|
+
----------
|
1286
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1287
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1288
|
+
"""
|
1289
|
+
...
|
1290
|
+
|
1062
1291
|
@typing.overload
|
1063
1292
|
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]]]:
|
1064
1293
|
"""
|
@@ -1159,232 +1388,45 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1159
1388
|
"""
|
1160
1389
|
...
|
1161
1390
|
|
1162
|
-
|
1163
|
-
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]]]:
|
1164
|
-
"""
|
1165
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1166
|
-
the execution of a step.
|
1167
|
-
|
1168
|
-
Parameters
|
1169
|
-
----------
|
1170
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1171
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1172
|
-
"""
|
1173
|
-
...
|
1174
|
-
|
1175
|
-
@typing.overload
|
1176
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1177
|
-
...
|
1178
|
-
|
1179
|
-
@typing.overload
|
1180
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1181
|
-
...
|
1182
|
-
|
1183
|
-
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]]] = []):
|
1184
|
-
"""
|
1185
|
-
Specifies secrets to be retrieved and injected as environment variables prior to
|
1186
|
-
the execution of a step.
|
1187
|
-
|
1188
|
-
Parameters
|
1189
|
-
----------
|
1190
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
1191
|
-
List of secret specs, defining how the secrets are to be retrieved
|
1192
|
-
"""
|
1193
|
-
...
|
1194
|
-
|
1195
|
-
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, port: typing.Optional[int] = None, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1196
|
-
"""
|
1197
|
-
Specifies that this step should execute on Kubernetes.
|
1198
|
-
|
1199
|
-
Parameters
|
1200
|
-
----------
|
1201
|
-
cpu : int, default 1
|
1202
|
-
Number of CPUs required for this step. If `@resources` is
|
1203
|
-
also present, the maximum value from all decorators is used.
|
1204
|
-
memory : int, default 4096
|
1205
|
-
Memory size (in MB) required for this step. If
|
1206
|
-
`@resources` is also present, the maximum value from all decorators is
|
1207
|
-
used.
|
1208
|
-
disk : int, default 10240
|
1209
|
-
Disk size (in MB) required for this step. If
|
1210
|
-
`@resources` is also present, the maximum value from all decorators is
|
1211
|
-
used.
|
1212
|
-
image : str, optional, default None
|
1213
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
1214
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
1215
|
-
not, a default Docker image mapping to the current version of Python is used.
|
1216
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
1217
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
1218
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
1219
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
1220
|
-
secrets : List[str], optional, default None
|
1221
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
1222
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
1223
|
-
in Metaflow configuration.
|
1224
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
1225
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
1226
|
-
gpu : int, optional, default None
|
1227
|
-
Number of GPUs required for this step. A value of zero implies that
|
1228
|
-
the scheduled node should not have GPUs.
|
1229
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
1230
|
-
The vendor of the GPUs to be used for this step.
|
1231
|
-
tolerations : List[str], default []
|
1232
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
1233
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
1234
|
-
use_tmpfs : bool, default False
|
1235
|
-
This enables an explicit tmpfs mount for this step.
|
1236
|
-
tmpfs_tempdir : bool, default True
|
1237
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
1238
|
-
tmpfs_size : int, optional, default: None
|
1239
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
1240
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
1241
|
-
memory allocated for this step.
|
1242
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
1243
|
-
Path to tmpfs mount for this step.
|
1244
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
1245
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
1246
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
1247
|
-
port: int, optional
|
1248
|
-
Number of the port to specify in the Kubernetes job object
|
1249
|
-
shared_memory: int, optional
|
1250
|
-
Shared memory size (in MiB) required for this steps
|
1251
|
-
"""
|
1252
|
-
...
|
1253
|
-
|
1254
|
-
@typing.overload
|
1255
|
-
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]]]:
|
1256
|
-
"""
|
1257
|
-
Specifies the PyPI packages for the step.
|
1258
|
-
|
1259
|
-
Information in this decorator will augment any
|
1260
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1261
|
-
you can use `@pypi_base` to set packages required by all
|
1262
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1263
|
-
|
1264
|
-
Parameters
|
1265
|
-
----------
|
1266
|
-
packages : Dict[str, str], default: {}
|
1267
|
-
Packages to use for this step. The key is the name of the package
|
1268
|
-
and the value is the version to use.
|
1269
|
-
python : str, optional, default: None
|
1270
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1271
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1272
|
-
"""
|
1273
|
-
...
|
1274
|
-
|
1275
|
-
@typing.overload
|
1276
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1277
|
-
...
|
1278
|
-
|
1279
|
-
@typing.overload
|
1280
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1281
|
-
...
|
1282
|
-
|
1283
|
-
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):
|
1284
|
-
"""
|
1285
|
-
Specifies the PyPI packages for the step.
|
1286
|
-
|
1287
|
-
Information in this decorator will augment any
|
1288
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1289
|
-
you can use `@pypi_base` to set packages required by all
|
1290
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1291
|
-
|
1292
|
-
Parameters
|
1293
|
-
----------
|
1294
|
-
packages : Dict[str, str], default: {}
|
1295
|
-
Packages to use for this step. The key is the name of the package
|
1296
|
-
and the value is the version to use.
|
1297
|
-
python : str, optional, default: None
|
1298
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1299
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1300
|
-
"""
|
1301
|
-
...
|
1302
|
-
|
1303
|
-
@typing.overload
|
1304
|
-
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]]]:
|
1305
|
-
"""
|
1306
|
-
Specifies the Conda environment for the step.
|
1307
|
-
|
1308
|
-
Information in this decorator will augment any
|
1309
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1310
|
-
you can use `@conda_base` to set packages required by all
|
1311
|
-
steps and use `@conda` to specify step-specific overrides.
|
1312
|
-
|
1313
|
-
Parameters
|
1314
|
-
----------
|
1315
|
-
packages : Dict[str, str], default {}
|
1316
|
-
Packages to use for this step. The key is the name of the package
|
1317
|
-
and the value is the version to use.
|
1318
|
-
libraries : Dict[str, str], default {}
|
1319
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1320
|
-
python : str, optional, default None
|
1321
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1322
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1323
|
-
disabled : bool, default False
|
1324
|
-
If set to True, disables @conda.
|
1325
|
-
"""
|
1326
|
-
...
|
1327
|
-
|
1328
|
-
@typing.overload
|
1329
|
-
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1330
|
-
...
|
1331
|
-
|
1332
|
-
@typing.overload
|
1333
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1334
|
-
...
|
1335
|
-
|
1336
|
-
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):
|
1337
|
-
"""
|
1338
|
-
Specifies the Conda environment for the step.
|
1339
|
-
|
1340
|
-
Information in this decorator will augment any
|
1341
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
1342
|
-
you can use `@conda_base` to set packages required by all
|
1343
|
-
steps and use `@conda` to specify step-specific overrides.
|
1344
|
-
|
1345
|
-
Parameters
|
1346
|
-
----------
|
1347
|
-
packages : Dict[str, str], default {}
|
1348
|
-
Packages to use for this step. The key is the name of the package
|
1349
|
-
and the value is the version to use.
|
1350
|
-
libraries : Dict[str, str], default {}
|
1351
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1352
|
-
python : str, optional, default None
|
1353
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1354
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1355
|
-
disabled : bool, default False
|
1356
|
-
If set to True, disables @conda.
|
1357
|
-
"""
|
1358
|
-
...
|
1359
|
-
|
1360
|
-
@typing.overload
|
1361
|
-
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]]]:
|
1362
|
-
"""
|
1363
|
-
Specifies environment variables to be set prior to the execution of a step.
|
1364
|
-
|
1365
|
-
Parameters
|
1366
|
-
----------
|
1367
|
-
vars : Dict[str, str], default {}
|
1368
|
-
Dictionary of environment variables to set.
|
1369
|
-
"""
|
1370
|
-
...
|
1371
|
-
|
1372
|
-
@typing.overload
|
1373
|
-
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1374
|
-
...
|
1375
|
-
|
1376
|
-
@typing.overload
|
1377
|
-
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1378
|
-
...
|
1379
|
-
|
1380
|
-
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1391
|
+
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]]:
|
1381
1392
|
"""
|
1382
|
-
|
1393
|
+
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)
|
1394
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1395
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1396
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1397
|
+
starts only after all sensors finish.
|
1383
1398
|
|
1384
1399
|
Parameters
|
1385
1400
|
----------
|
1386
|
-
|
1387
|
-
|
1401
|
+
timeout : int
|
1402
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1403
|
+
poke_interval : int
|
1404
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1405
|
+
mode : str
|
1406
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1407
|
+
exponential_backoff : bool
|
1408
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1409
|
+
pool : str
|
1410
|
+
the slot pool this task should run in,
|
1411
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1412
|
+
soft_fail : bool
|
1413
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1414
|
+
name : str
|
1415
|
+
Name of the sensor on Airflow
|
1416
|
+
description : str
|
1417
|
+
Description of sensor in the Airflow UI
|
1418
|
+
bucket_key : Union[str, List[str]]
|
1419
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1420
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1421
|
+
bucket_name : str
|
1422
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1423
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1424
|
+
wildcard_match : bool
|
1425
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1426
|
+
aws_conn_id : str
|
1427
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1428
|
+
verify : bool
|
1429
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1388
1430
|
"""
|
1389
1431
|
...
|
1390
1432
|
|
@@ -1430,6 +1472,109 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1430
1472
|
"""
|
1431
1473
|
...
|
1432
1474
|
|
1475
|
+
@typing.overload
|
1476
|
+
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]]:
|
1477
|
+
"""
|
1478
|
+
Specifies the flow(s) that this flow depends on.
|
1479
|
+
|
1480
|
+
```
|
1481
|
+
@trigger_on_finish(flow='FooFlow')
|
1482
|
+
```
|
1483
|
+
or
|
1484
|
+
```
|
1485
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1486
|
+
```
|
1487
|
+
This decorator respects the @project decorator and triggers the flow
|
1488
|
+
when upstream runs within the same namespace complete successfully
|
1489
|
+
|
1490
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1491
|
+
by specifying the fully qualified project_flow_name.
|
1492
|
+
```
|
1493
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1494
|
+
```
|
1495
|
+
or
|
1496
|
+
```
|
1497
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1498
|
+
```
|
1499
|
+
|
1500
|
+
You can also specify just the project or project branch (other values will be
|
1501
|
+
inferred from the current project or project branch):
|
1502
|
+
```
|
1503
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1504
|
+
```
|
1505
|
+
|
1506
|
+
Note that `branch` is typically one of:
|
1507
|
+
- `prod`
|
1508
|
+
- `user.bob`
|
1509
|
+
- `test.my_experiment`
|
1510
|
+
- `prod.staging`
|
1511
|
+
|
1512
|
+
Parameters
|
1513
|
+
----------
|
1514
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1515
|
+
Upstream flow dependency for this flow.
|
1516
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1517
|
+
Upstream flow dependencies for this flow.
|
1518
|
+
options : Dict[str, Any], default {}
|
1519
|
+
Backend-specific configuration for tuning eventing behavior.
|
1520
|
+
|
1521
|
+
|
1522
|
+
"""
|
1523
|
+
...
|
1524
|
+
|
1525
|
+
@typing.overload
|
1526
|
+
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1527
|
+
...
|
1528
|
+
|
1529
|
+
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
|
1530
|
+
"""
|
1531
|
+
Specifies the flow(s) that this flow depends on.
|
1532
|
+
|
1533
|
+
```
|
1534
|
+
@trigger_on_finish(flow='FooFlow')
|
1535
|
+
```
|
1536
|
+
or
|
1537
|
+
```
|
1538
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1539
|
+
```
|
1540
|
+
This decorator respects the @project decorator and triggers the flow
|
1541
|
+
when upstream runs within the same namespace complete successfully
|
1542
|
+
|
1543
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1544
|
+
by specifying the fully qualified project_flow_name.
|
1545
|
+
```
|
1546
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1547
|
+
```
|
1548
|
+
or
|
1549
|
+
```
|
1550
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1551
|
+
```
|
1552
|
+
|
1553
|
+
You can also specify just the project or project branch (other values will be
|
1554
|
+
inferred from the current project or project branch):
|
1555
|
+
```
|
1556
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1557
|
+
```
|
1558
|
+
|
1559
|
+
Note that `branch` is typically one of:
|
1560
|
+
- `prod`
|
1561
|
+
- `user.bob`
|
1562
|
+
- `test.my_experiment`
|
1563
|
+
- `prod.staging`
|
1564
|
+
|
1565
|
+
Parameters
|
1566
|
+
----------
|
1567
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1568
|
+
Upstream flow dependency for this flow.
|
1569
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1570
|
+
Upstream flow dependencies for this flow.
|
1571
|
+
options : Dict[str, Any], default {}
|
1572
|
+
Backend-specific configuration for tuning eventing behavior.
|
1573
|
+
|
1574
|
+
|
1575
|
+
"""
|
1576
|
+
...
|
1577
|
+
|
1433
1578
|
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1434
1579
|
"""
|
1435
1580
|
Specifies what flows belong to the same project.
|
@@ -1448,6 +1593,55 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
|
|
1448
1593
|
"""
|
1449
1594
|
...
|
1450
1595
|
|
1596
|
+
@typing.overload
|
1597
|
+
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]]:
|
1598
|
+
"""
|
1599
|
+
Specifies the times when the flow should be run when running on a
|
1600
|
+
production scheduler.
|
1601
|
+
|
1602
|
+
Parameters
|
1603
|
+
----------
|
1604
|
+
hourly : bool, default False
|
1605
|
+
Run the workflow hourly.
|
1606
|
+
daily : bool, default True
|
1607
|
+
Run the workflow daily.
|
1608
|
+
weekly : bool, default False
|
1609
|
+
Run the workflow weekly.
|
1610
|
+
cron : str, optional, default None
|
1611
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1612
|
+
specified by this expression.
|
1613
|
+
timezone : str, optional, default None
|
1614
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1615
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1616
|
+
"""
|
1617
|
+
...
|
1618
|
+
|
1619
|
+
@typing.overload
|
1620
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1621
|
+
...
|
1622
|
+
|
1623
|
+
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):
|
1624
|
+
"""
|
1625
|
+
Specifies the times when the flow should be run when running on a
|
1626
|
+
production scheduler.
|
1627
|
+
|
1628
|
+
Parameters
|
1629
|
+
----------
|
1630
|
+
hourly : bool, default False
|
1631
|
+
Run the workflow hourly.
|
1632
|
+
daily : bool, default True
|
1633
|
+
Run the workflow daily.
|
1634
|
+
weekly : bool, default False
|
1635
|
+
Run the workflow weekly.
|
1636
|
+
cron : str, optional, default None
|
1637
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1638
|
+
specified by this expression.
|
1639
|
+
timezone : str, optional, default None
|
1640
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1641
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1642
|
+
"""
|
1643
|
+
...
|
1644
|
+
|
1451
1645
|
@typing.overload
|
1452
1646
|
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1453
1647
|
"""
|
@@ -1582,55 +1776,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1582
1776
|
"""
|
1583
1777
|
...
|
1584
1778
|
|
1585
|
-
@typing.overload
|
1586
|
-
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]]:
|
1587
|
-
"""
|
1588
|
-
Specifies the times when the flow should be run when running on a
|
1589
|
-
production scheduler.
|
1590
|
-
|
1591
|
-
Parameters
|
1592
|
-
----------
|
1593
|
-
hourly : bool, default False
|
1594
|
-
Run the workflow hourly.
|
1595
|
-
daily : bool, default True
|
1596
|
-
Run the workflow daily.
|
1597
|
-
weekly : bool, default False
|
1598
|
-
Run the workflow weekly.
|
1599
|
-
cron : str, optional, default None
|
1600
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1601
|
-
specified by this expression.
|
1602
|
-
timezone : str, optional, default None
|
1603
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1604
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1605
|
-
"""
|
1606
|
-
...
|
1607
|
-
|
1608
|
-
@typing.overload
|
1609
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1610
|
-
...
|
1611
|
-
|
1612
|
-
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):
|
1613
|
-
"""
|
1614
|
-
Specifies the times when the flow should be run when running on a
|
1615
|
-
production scheduler.
|
1616
|
-
|
1617
|
-
Parameters
|
1618
|
-
----------
|
1619
|
-
hourly : bool, default False
|
1620
|
-
Run the workflow hourly.
|
1621
|
-
daily : bool, default True
|
1622
|
-
Run the workflow daily.
|
1623
|
-
weekly : bool, default False
|
1624
|
-
Run the workflow weekly.
|
1625
|
-
cron : str, optional, default None
|
1626
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1627
|
-
specified by this expression.
|
1628
|
-
timezone : str, optional, default None
|
1629
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1630
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1631
|
-
"""
|
1632
|
-
...
|
1633
|
-
|
1634
1779
|
@typing.overload
|
1635
1780
|
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]]:
|
1636
1781
|
"""
|
@@ -1680,151 +1825,6 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1680
1825
|
"""
|
1681
1826
|
...
|
1682
1827
|
|
1683
|
-
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]]:
|
1684
|
-
"""
|
1685
|
-
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)
|
1686
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1687
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1688
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1689
|
-
starts only after all sensors finish.
|
1690
|
-
|
1691
|
-
Parameters
|
1692
|
-
----------
|
1693
|
-
timeout : int
|
1694
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1695
|
-
poke_interval : int
|
1696
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1697
|
-
mode : str
|
1698
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1699
|
-
exponential_backoff : bool
|
1700
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1701
|
-
pool : str
|
1702
|
-
the slot pool this task should run in,
|
1703
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1704
|
-
soft_fail : bool
|
1705
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1706
|
-
name : str
|
1707
|
-
Name of the sensor on Airflow
|
1708
|
-
description : str
|
1709
|
-
Description of sensor in the Airflow UI
|
1710
|
-
bucket_key : Union[str, List[str]]
|
1711
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1712
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1713
|
-
bucket_name : str
|
1714
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1715
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1716
|
-
wildcard_match : bool
|
1717
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1718
|
-
aws_conn_id : str
|
1719
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1720
|
-
verify : bool
|
1721
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1722
|
-
"""
|
1723
|
-
...
|
1724
|
-
|
1725
|
-
@typing.overload
|
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]]:
|
1727
|
-
"""
|
1728
|
-
Specifies the flow(s) that this flow depends on.
|
1729
|
-
|
1730
|
-
```
|
1731
|
-
@trigger_on_finish(flow='FooFlow')
|
1732
|
-
```
|
1733
|
-
or
|
1734
|
-
```
|
1735
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1736
|
-
```
|
1737
|
-
This decorator respects the @project decorator and triggers the flow
|
1738
|
-
when upstream runs within the same namespace complete successfully
|
1739
|
-
|
1740
|
-
Additionally, you can specify project aware upstream flow dependencies
|
1741
|
-
by specifying the fully qualified project_flow_name.
|
1742
|
-
```
|
1743
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1744
|
-
```
|
1745
|
-
or
|
1746
|
-
```
|
1747
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1748
|
-
```
|
1749
|
-
|
1750
|
-
You can also specify just the project or project branch (other values will be
|
1751
|
-
inferred from the current project or project branch):
|
1752
|
-
```
|
1753
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1754
|
-
```
|
1755
|
-
|
1756
|
-
Note that `branch` is typically one of:
|
1757
|
-
- `prod`
|
1758
|
-
- `user.bob`
|
1759
|
-
- `test.my_experiment`
|
1760
|
-
- `prod.staging`
|
1761
|
-
|
1762
|
-
Parameters
|
1763
|
-
----------
|
1764
|
-
flow : Union[str, Dict[str, str]], optional, default None
|
1765
|
-
Upstream flow dependency for this flow.
|
1766
|
-
flows : List[Union[str, Dict[str, str]]], default []
|
1767
|
-
Upstream flow dependencies for this flow.
|
1768
|
-
options : Dict[str, Any], default {}
|
1769
|
-
Backend-specific configuration for tuning eventing behavior.
|
1770
|
-
|
1771
|
-
|
1772
|
-
"""
|
1773
|
-
...
|
1774
|
-
|
1775
|
-
@typing.overload
|
1776
|
-
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1777
|
-
...
|
1778
|
-
|
1779
|
-
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
|
1780
|
-
"""
|
1781
|
-
Specifies the flow(s) that this flow depends on.
|
1782
|
-
|
1783
|
-
```
|
1784
|
-
@trigger_on_finish(flow='FooFlow')
|
1785
|
-
```
|
1786
|
-
or
|
1787
|
-
```
|
1788
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1789
|
-
```
|
1790
|
-
This decorator respects the @project decorator and triggers the flow
|
1791
|
-
when upstream runs within the same namespace complete successfully
|
1792
|
-
|
1793
|
-
Additionally, you can specify project aware upstream flow dependencies
|
1794
|
-
by specifying the fully qualified project_flow_name.
|
1795
|
-
```
|
1796
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1797
|
-
```
|
1798
|
-
or
|
1799
|
-
```
|
1800
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1801
|
-
```
|
1802
|
-
|
1803
|
-
You can also specify just the project or project branch (other values will be
|
1804
|
-
inferred from the current project or project branch):
|
1805
|
-
```
|
1806
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1807
|
-
```
|
1808
|
-
|
1809
|
-
Note that `branch` is typically one of:
|
1810
|
-
- `prod`
|
1811
|
-
- `user.bob`
|
1812
|
-
- `test.my_experiment`
|
1813
|
-
- `prod.staging`
|
1814
|
-
|
1815
|
-
Parameters
|
1816
|
-
----------
|
1817
|
-
flow : Union[str, Dict[str, str]], optional, default None
|
1818
|
-
Upstream flow dependency for this flow.
|
1819
|
-
flows : List[Union[str, Dict[str, str]]], default []
|
1820
|
-
Upstream flow dependencies 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.
|
@@ -2775,3 +2775,6 @@ class DataArtifact(metaflow.client.core.MetaflowObject, metaclass=type):
|
|
2775
2775
|
...
|
2776
2776
|
...
|
2777
2777
|
|
2778
|
+
def get_aws_client(module, with_error = False, role_arn = None, session_vars = None, client_params = None):
|
2779
|
+
...
|
2780
|
+
|