metaflow-stubs 2.12.18__py2.py3-none-any.whl → 2.12.19__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.
Files changed (150) hide show
  1. metaflow-stubs/__init__.pyi +477 -477
  2. metaflow-stubs/cards.pyi +4 -4
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +7 -7
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +2 -2
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +4 -4
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +5 -5
  13. metaflow-stubs/metadata/metadata.pyi +3 -3
  14. metaflow-stubs/metadata/util.pyi +2 -2
  15. metaflow-stubs/metaflow_config.pyi +2 -2
  16. metaflow-stubs/metaflow_current.pyi +6 -6
  17. metaflow-stubs/mflog/mflog.pyi +2 -2
  18. metaflow-stubs/multicore_utils.pyi +2 -2
  19. metaflow-stubs/parameters.pyi +4 -4
  20. metaflow-stubs/plugins/__init__.pyi +2 -2
  21. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/airflow.pyi +4 -4
  23. metaflow-stubs/plugins/airflow/airflow_cli.pyi +3 -3
  24. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +3 -3
  29. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +4 -4
  30. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +4 -4
  31. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  32. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  34. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
  35. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +6 -6
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +5 -5
  37. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
  38. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  39. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  40. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  45. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  46. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  47. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  48. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +4 -4
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  56. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  58. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  61. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  62. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  63. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  64. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  65. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  67. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  68. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  73. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  80. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  81. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  82. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +3 -3
  83. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  84. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  85. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  86. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  87. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  88. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  89. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  90. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  91. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  92. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  93. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  94. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  95. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  96. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  97. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  98. metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
  99. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  100. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  101. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  103. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  104. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  105. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  106. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
  107. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
  108. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  110. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  112. metaflow-stubs/plugins/logs_cli.pyi +2 -2
  113. metaflow-stubs/plugins/package_cli.pyi +2 -2
  114. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  115. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  116. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  117. metaflow-stubs/plugins/pypi/conda_decorator.pyi +6 -2
  118. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  119. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +4 -2
  120. metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
  121. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  122. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  124. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  125. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  126. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  127. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  128. metaflow-stubs/plugins/tag_cli.pyi +4 -4
  129. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  130. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  131. metaflow-stubs/procpoll.pyi +2 -2
  132. metaflow-stubs/pylint_wrapper.pyi +2 -2
  133. metaflow-stubs/runner/__init__.pyi +2 -2
  134. metaflow-stubs/runner/deployer.pyi +2 -2
  135. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  136. metaflow-stubs/runner/nbdeploy.pyi +2 -2
  137. metaflow-stubs/runner/nbrun.pyi +2 -2
  138. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  139. metaflow-stubs/runner/utils.pyi +2 -2
  140. metaflow-stubs/system/__init__.pyi +3 -3
  141. metaflow-stubs/system/system_logger.pyi +3 -3
  142. metaflow-stubs/system/system_monitor.pyi +2 -2
  143. metaflow-stubs/tagging_util.pyi +2 -2
  144. metaflow-stubs/tuple_util.pyi +2 -2
  145. metaflow-stubs/version.pyi +2 -2
  146. {metaflow_stubs-2.12.18.dist-info → metaflow_stubs-2.12.19.dist-info}/METADATA +2 -2
  147. metaflow_stubs-2.12.19.dist-info/RECORD +150 -0
  148. {metaflow_stubs-2.12.18.dist-info → metaflow_stubs-2.12.19.dist-info}/WHEEL +1 -1
  149. metaflow_stubs-2.12.18.dist-info/RECORD +0 -150
  150. {metaflow_stubs-2.12.18.dist-info → metaflow_stubs-2.12.19.dist-info}/top_level.txt +0 -0
@@ -1,25 +1,25 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.18 #
4
- # Generated on 2024-08-28T16:18:32.928126 #
3
+ # MF version: 2.12.19 #
4
+ # Generated on 2024-09-04T23:07:02.410930 #
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.metaflow_current
12
- import metaflow._vendor.click.types
13
- import io
14
- import metaflow.client.core
15
- import metaflow.runner.metaflow_runner
16
11
  import typing
12
+ import metaflow.client.core
17
13
  import metaflow.flowspec
18
- import metaflow.plugins.datatools.s3.s3
14
+ import metaflow.metaflow_current
19
15
  import metaflow.parameters
20
- import metaflow.events
16
+ import io
21
17
  import datetime
18
+ import metaflow.runner.metaflow_runner
19
+ import metaflow.events
20
+ import metaflow.plugins.datatools.s3.s3
22
21
  import metaflow.datastore.inputs
22
+ import metaflow._vendor.click.types
23
23
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
24
24
  StepFlag = typing.NewType("StepFlag", bool)
25
25
 
@@ -727,6 +727,117 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
727
727
  """
728
728
  ...
729
729
 
730
+ @typing.overload
731
+ 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]]]:
732
+ """
733
+ Specifies that the step will success under all circumstances.
734
+
735
+ The decorator will create an optional artifact, specified by `var`, which
736
+ contains the exception raised. You can use it to detect the presence
737
+ of errors, indicating that all happy-path artifacts produced by the step
738
+ are missing.
739
+
740
+ Parameters
741
+ ----------
742
+ var : str, optional, default None
743
+ Name of the artifact in which to store the caught exception.
744
+ If not specified, the exception is not stored.
745
+ print_exception : bool, default True
746
+ Determines whether or not the exception is printed to
747
+ stdout when caught.
748
+ """
749
+ ...
750
+
751
+ @typing.overload
752
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
753
+ ...
754
+
755
+ @typing.overload
756
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
757
+ ...
758
+
759
+ 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):
760
+ """
761
+ Specifies that the step will success under all circumstances.
762
+
763
+ The decorator will create an optional artifact, specified by `var`, which
764
+ contains the exception raised. You can use it to detect the presence
765
+ of errors, indicating that all happy-path artifacts produced by the step
766
+ are missing.
767
+
768
+ Parameters
769
+ ----------
770
+ var : str, optional, default None
771
+ Name of the artifact in which to store the caught exception.
772
+ If not specified, the exception is not stored.
773
+ print_exception : bool, default True
774
+ Determines whether or not the exception is printed to
775
+ stdout when caught.
776
+ """
777
+ ...
778
+
779
+ 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, compute_pool: 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]]]:
780
+ """
781
+ Specifies that this step should execute on Kubernetes.
782
+
783
+ Parameters
784
+ ----------
785
+ cpu : int, default 1
786
+ Number of CPUs required for this step. If `@resources` is
787
+ also present, the maximum value from all decorators is used.
788
+ memory : int, default 4096
789
+ Memory size (in MB) required for this step. If
790
+ `@resources` is also present, the maximum value from all decorators is
791
+ used.
792
+ disk : int, default 10240
793
+ Disk size (in MB) required for this step. If
794
+ `@resources` is also present, the maximum value from all decorators is
795
+ used.
796
+ image : str, optional, default None
797
+ Docker image to use when launching on Kubernetes. If not specified, and
798
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
799
+ not, a default Docker image mapping to the current version of Python is used.
800
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
801
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
802
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
803
+ Kubernetes service account to use when launching pod in Kubernetes.
804
+ secrets : List[str], optional, default None
805
+ Kubernetes secrets to use when launching pod in Kubernetes. These
806
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
807
+ in Metaflow configuration.
808
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
809
+ Kubernetes namespace to use when launching pod in Kubernetes.
810
+ gpu : int, optional, default None
811
+ Number of GPUs required for this step. A value of zero implies that
812
+ the scheduled node should not have GPUs.
813
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
814
+ The vendor of the GPUs to be used for this step.
815
+ tolerations : List[str], default []
816
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
817
+ Kubernetes tolerations to use when launching pod in Kubernetes.
818
+ use_tmpfs : bool, default False
819
+ This enables an explicit tmpfs mount for this step.
820
+ tmpfs_tempdir : bool, default True
821
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
822
+ tmpfs_size : int, optional, default: None
823
+ The value for the size (in MiB) of the tmpfs mount for this step.
824
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
825
+ memory allocated for this step.
826
+ tmpfs_path : str, optional, default /metaflow_temp
827
+ Path to tmpfs mount for this step.
828
+ persistent_volume_claims : Dict[str, str], optional, default None
829
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
830
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
831
+ shared_memory: int, optional
832
+ Shared memory size (in MiB) required for this step
833
+ port: int, optional
834
+ Port number to specify in the Kubernetes job object
835
+ compute_pool : str, optional, default None
836
+ Compute pool to be used for for this step.
837
+ If not specified, any accessible compute pool within the perimeter is used.
838
+ """
839
+ ...
840
+
730
841
  @typing.overload
731
842
  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]]]:
732
843
  """
@@ -784,6 +895,63 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
784
895
  """
785
896
  ...
786
897
 
898
+ @typing.overload
899
+ 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]]]:
900
+ """
901
+ Specifies the Conda environment for the step.
902
+
903
+ Information in this decorator will augment any
904
+ attributes set in the `@conda_base` flow-level decorator. Hence,
905
+ you can use `@conda_base` to set packages required by all
906
+ steps and use `@conda` to specify step-specific overrides.
907
+
908
+ Parameters
909
+ ----------
910
+ packages : Dict[str, str], default {}
911
+ Packages to use for this step. The key is the name of the package
912
+ and the value is the version to use.
913
+ libraries : Dict[str, str], default {}
914
+ Supported for backward compatibility. When used with packages, packages will take precedence.
915
+ python : str, optional, default None
916
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
917
+ that the version used will correspond to the version of the Python interpreter used to start the run.
918
+ disabled : bool, default False
919
+ If set to True, disables @conda.
920
+ """
921
+ ...
922
+
923
+ @typing.overload
924
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
925
+ ...
926
+
927
+ @typing.overload
928
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
929
+ ...
930
+
931
+ 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):
932
+ """
933
+ Specifies the Conda environment for the step.
934
+
935
+ Information in this decorator will augment any
936
+ attributes set in the `@conda_base` flow-level decorator. Hence,
937
+ you can use `@conda_base` to set packages required by all
938
+ steps and use `@conda` to specify step-specific overrides.
939
+
940
+ Parameters
941
+ ----------
942
+ packages : Dict[str, str], default {}
943
+ Packages to use for this step. The key is the name of the package
944
+ and the value is the version to use.
945
+ libraries : Dict[str, str], default {}
946
+ Supported for backward compatibility. When used with packages, packages will take precedence.
947
+ python : str, optional, default None
948
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
949
+ that the version used will correspond to the version of the Python interpreter used to start the run.
950
+ disabled : bool, default False
951
+ If set to True, disables @conda.
952
+ """
953
+ ...
954
+
787
955
  @typing.overload
788
956
  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]]]:
789
957
  """
@@ -836,142 +1004,59 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
836
1004
  ...
837
1005
 
838
1006
  @typing.overload
839
- 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]]]:
1007
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
840
1008
  """
841
- Specifies that the step will success under all circumstances.
842
-
843
- The decorator will create an optional artifact, specified by `var`, which
844
- contains the exception raised. You can use it to detect the presence
845
- of errors, indicating that all happy-path artifacts produced by the step
846
- are missing.
847
-
848
- Parameters
849
- ----------
850
- var : str, optional, default None
851
- Name of the artifact in which to store the caught exception.
852
- If not specified, the exception is not stored.
853
- print_exception : bool, default True
854
- Determines whether or not the exception is printed to
855
- stdout when caught.
1009
+ Decorator prototype for all step decorators. This function gets specialized
1010
+ and imported for all decorators types by _import_plugin_decorators().
856
1011
  """
857
1012
  ...
858
1013
 
859
1014
  @typing.overload
860
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
861
- ...
862
-
863
- @typing.overload
864
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1015
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
865
1016
  ...
866
1017
 
867
- 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):
1018
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
868
1019
  """
869
- Specifies that the step will success under all circumstances.
870
-
871
- The decorator will create an optional artifact, specified by `var`, which
872
- contains the exception raised. You can use it to detect the presence
873
- of errors, indicating that all happy-path artifacts produced by the step
874
- are missing.
875
-
876
- Parameters
877
- ----------
878
- var : str, optional, default None
879
- Name of the artifact in which to store the caught exception.
880
- If not specified, the exception is not stored.
881
- print_exception : bool, default True
882
- Determines whether or not the exception is printed to
883
- stdout when caught.
1020
+ Decorator prototype for all step decorators. This function gets specialized
1021
+ and imported for all decorators types by _import_plugin_decorators().
884
1022
  """
885
1023
  ...
886
1024
 
887
1025
  @typing.overload
888
- 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]]]:
1026
+ def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
889
1027
  """
890
- Specifies environment variables to be set prior to the execution of a step.
1028
+ Specifies the number of times the task corresponding
1029
+ to a step needs to be retried.
1030
+
1031
+ This decorator is useful for handling transient errors, such as networking issues.
1032
+ If your task contains operations that can't be retried safely, e.g. database updates,
1033
+ it is advisable to annotate it with `@retry(times=0)`.
1034
+
1035
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1036
+ decorator will execute a no-op task after all retries have been exhausted,
1037
+ ensuring that the flow execution can continue.
891
1038
 
892
1039
  Parameters
893
1040
  ----------
894
- vars : Dict[str, str], default {}
895
- Dictionary of environment variables to set.
1041
+ times : int, default 3
1042
+ Number of times to retry this task.
1043
+ minutes_between_retries : int, default 2
1044
+ Number of minutes between retries.
896
1045
  """
897
1046
  ...
898
1047
 
899
1048
  @typing.overload
900
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1049
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
901
1050
  ...
902
1051
 
903
1052
  @typing.overload
904
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1053
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
905
1054
  ...
906
1055
 
907
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1056
+ 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):
908
1057
  """
909
- Specifies environment variables to be set prior to the execution of a step.
910
-
911
- Parameters
912
- ----------
913
- vars : Dict[str, str], default {}
914
- Dictionary of environment variables to set.
915
- """
916
- ...
917
-
918
- @typing.overload
919
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
920
- """
921
- Decorator prototype for all step decorators. This function gets specialized
922
- and imported for all decorators types by _import_plugin_decorators().
923
- """
924
- ...
925
-
926
- @typing.overload
927
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
928
- ...
929
-
930
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
931
- """
932
- Decorator prototype for all step decorators. This function gets specialized
933
- and imported for all decorators types by _import_plugin_decorators().
934
- """
935
- ...
936
-
937
- @typing.overload
938
- 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]]]:
939
- """
940
- Specifies secrets to be retrieved and injected as environment variables prior to
941
- the execution of a step.
942
-
943
- Parameters
944
- ----------
945
- sources : List[Union[str, Dict[str, Any]]], default: []
946
- List of secret specs, defining how the secrets are to be retrieved
947
- """
948
- ...
949
-
950
- @typing.overload
951
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
952
- ...
953
-
954
- @typing.overload
955
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
956
- ...
957
-
958
- 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]]] = []):
959
- """
960
- Specifies secrets to be retrieved and injected as environment variables prior to
961
- the execution of a step.
962
-
963
- Parameters
964
- ----------
965
- sources : List[Union[str, Dict[str, Any]]], default: []
966
- List of secret specs, defining how the secrets are to be retrieved
967
- """
968
- ...
969
-
970
- @typing.overload
971
- 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]]]:
972
- """
973
- Specifies the number of times the task corresponding
974
- to a step needs to be retried.
1058
+ Specifies the number of times the task corresponding
1059
+ to a step needs to be retried.
975
1060
 
976
1061
  This decorator is useful for handling transient errors, such as networking issues.
977
1062
  If your task contains operations that can't be retried safely, e.g. database updates,
@@ -991,32 +1076,33 @@ def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callabl
991
1076
  ...
992
1077
 
993
1078
  @typing.overload
994
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1079
+ 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]]]:
1080
+ """
1081
+ Specifies environment variables to be set prior to the execution of a step.
1082
+
1083
+ Parameters
1084
+ ----------
1085
+ vars : Dict[str, str], default {}
1086
+ Dictionary of environment variables to set.
1087
+ """
995
1088
  ...
996
1089
 
997
1090
  @typing.overload
998
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1091
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
999
1092
  ...
1000
1093
 
1001
- 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):
1094
+ @typing.overload
1095
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1096
+ ...
1097
+
1098
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1002
1099
  """
1003
- Specifies the number of times the task corresponding
1004
- to a step needs to be retried.
1005
-
1006
- This decorator is useful for handling transient errors, such as networking issues.
1007
- If your task contains operations that can't be retried safely, e.g. database updates,
1008
- it is advisable to annotate it with `@retry(times=0)`.
1009
-
1010
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1011
- decorator will execute a no-op task after all retries have been exhausted,
1012
- ensuring that the flow execution can continue.
1100
+ Specifies environment variables to be set prior to the execution of a step.
1013
1101
 
1014
1102
  Parameters
1015
1103
  ----------
1016
- times : int, default 3
1017
- Number of times to retry this task.
1018
- minutes_between_retries : int, default 2
1019
- Number of minutes between retries.
1104
+ vars : Dict[str, str], default {}
1105
+ Dictionary of environment variables to set.
1020
1106
  """
1021
1107
  ...
1022
1108
 
@@ -1097,125 +1183,6 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1097
1183
  """
1098
1184
  ...
1099
1185
 
1100
- 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, compute_pool: 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]]]:
1101
- """
1102
- Specifies that this step should execute on Kubernetes.
1103
-
1104
- Parameters
1105
- ----------
1106
- cpu : int, default 1
1107
- Number of CPUs required for this step. If `@resources` is
1108
- also present, the maximum value from all decorators is used.
1109
- memory : int, default 4096
1110
- Memory size (in MB) required for this step. If
1111
- `@resources` is also present, the maximum value from all decorators is
1112
- used.
1113
- disk : int, default 10240
1114
- Disk size (in MB) required for this step. If
1115
- `@resources` is also present, the maximum value from all decorators is
1116
- used.
1117
- image : str, optional, default None
1118
- Docker image to use when launching on Kubernetes. If not specified, and
1119
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1120
- not, a default Docker image mapping to the current version of Python is used.
1121
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1122
- If given, the imagePullPolicy to be applied to the Docker image of the step.
1123
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1124
- Kubernetes service account to use when launching pod in Kubernetes.
1125
- secrets : List[str], optional, default None
1126
- Kubernetes secrets to use when launching pod in Kubernetes. These
1127
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1128
- in Metaflow configuration.
1129
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1130
- Kubernetes namespace to use when launching pod in Kubernetes.
1131
- gpu : int, optional, default None
1132
- Number of GPUs required for this step. A value of zero implies that
1133
- the scheduled node should not have GPUs.
1134
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1135
- The vendor of the GPUs to be used for this step.
1136
- tolerations : List[str], default []
1137
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1138
- Kubernetes tolerations to use when launching pod in Kubernetes.
1139
- use_tmpfs : bool, default False
1140
- This enables an explicit tmpfs mount for this step.
1141
- tmpfs_tempdir : bool, default True
1142
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1143
- tmpfs_size : int, optional, default: None
1144
- The value for the size (in MiB) of the tmpfs mount for this step.
1145
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1146
- memory allocated for this step.
1147
- tmpfs_path : str, optional, default /metaflow_temp
1148
- Path to tmpfs mount for this step.
1149
- persistent_volume_claims : Dict[str, str], optional, default None
1150
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1151
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1152
- shared_memory: int, optional
1153
- Shared memory size (in MiB) required for this step
1154
- port: int, optional
1155
- Port number to specify in the Kubernetes job object
1156
- compute_pool : str, optional, default None
1157
- Compute pool to be used for for this step.
1158
- If not specified, any accessible compute pool within the perimeter is used.
1159
- """
1160
- ...
1161
-
1162
- @typing.overload
1163
- 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]]]:
1164
- """
1165
- Specifies the Conda environment for the step.
1166
-
1167
- Information in this decorator will augment any
1168
- attributes set in the `@conda_base` flow-level decorator. Hence,
1169
- you can use `@conda_base` to set packages required by all
1170
- steps and use `@conda` to specify step-specific overrides.
1171
-
1172
- Parameters
1173
- ----------
1174
- packages : Dict[str, str], default {}
1175
- Packages to use for this step. The key is the name of the package
1176
- and the value is the version to use.
1177
- libraries : Dict[str, str], default {}
1178
- Supported for backward compatibility. When used with packages, packages will take precedence.
1179
- python : str, optional, default None
1180
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1181
- that the version used will correspond to the version of the Python interpreter used to start the run.
1182
- disabled : bool, default False
1183
- If set to True, disables @conda.
1184
- """
1185
- ...
1186
-
1187
- @typing.overload
1188
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1189
- ...
1190
-
1191
- @typing.overload
1192
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1193
- ...
1194
-
1195
- 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):
1196
- """
1197
- Specifies the Conda environment for the step.
1198
-
1199
- Information in this decorator will augment any
1200
- attributes set in the `@conda_base` flow-level decorator. Hence,
1201
- you can use `@conda_base` to set packages required by all
1202
- steps and use `@conda` to specify step-specific overrides.
1203
-
1204
- Parameters
1205
- ----------
1206
- packages : Dict[str, str], default {}
1207
- Packages to use for this step. The key is the name of the package
1208
- and the value is the version to use.
1209
- libraries : Dict[str, str], default {}
1210
- Supported for backward compatibility. When used with packages, packages will take precedence.
1211
- python : str, optional, default None
1212
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1213
- that the version used will correspond to the version of the Python interpreter used to start the run.
1214
- disabled : bool, default False
1215
- If set to True, disables @conda.
1216
- """
1217
- ...
1218
-
1219
1186
  @typing.overload
1220
1187
  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]]]:
1221
1188
  """
@@ -1363,6 +1330,39 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1363
1330
  """
1364
1331
  ...
1365
1332
 
1333
+ @typing.overload
1334
+ 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]]]:
1335
+ """
1336
+ Specifies secrets to be retrieved and injected as environment variables prior to
1337
+ the execution of a step.
1338
+
1339
+ Parameters
1340
+ ----------
1341
+ sources : List[Union[str, Dict[str, Any]]], default: []
1342
+ List of secret specs, defining how the secrets are to be retrieved
1343
+ """
1344
+ ...
1345
+
1346
+ @typing.overload
1347
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1348
+ ...
1349
+
1350
+ @typing.overload
1351
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1352
+ ...
1353
+
1354
+ 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]]] = []):
1355
+ """
1356
+ Specifies secrets to be retrieved and injected as environment variables prior to
1357
+ the execution of a step.
1358
+
1359
+ Parameters
1360
+ ----------
1361
+ sources : List[Union[str, Dict[str, Any]]], default: []
1362
+ List of secret specs, defining how the secrets are to be retrieved
1363
+ """
1364
+ ...
1365
+
1366
1366
  @typing.overload
1367
1367
  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]]]:
1368
1368
  """
@@ -1412,12 +1412,206 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
1412
1412
  """
1413
1413
  ...
1414
1414
 
1415
- @typing.overload
1416
- 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]]:
1415
+ 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]]:
1417
1416
  """
1418
- Specifies the flow(s) that this flow depends on.
1419
-
1420
- ```
1417
+ 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)
1418
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1419
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1420
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1421
+ starts only after all sensors finish.
1422
+
1423
+ Parameters
1424
+ ----------
1425
+ timeout : int
1426
+ Time, in seconds before the task times out and fails. (Default: 3600)
1427
+ poke_interval : int
1428
+ Time in seconds that the job should wait in between each try. (Default: 60)
1429
+ mode : str
1430
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1431
+ exponential_backoff : bool
1432
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1433
+ pool : str
1434
+ the slot pool this task should run in,
1435
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1436
+ soft_fail : bool
1437
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1438
+ name : str
1439
+ Name of the sensor on Airflow
1440
+ description : str
1441
+ Description of sensor in the Airflow UI
1442
+ bucket_key : Union[str, List[str]]
1443
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1444
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1445
+ bucket_name : str
1446
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1447
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1448
+ wildcard_match : bool
1449
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1450
+ aws_conn_id : str
1451
+ a reference to the s3 connection on Airflow. (Default: None)
1452
+ verify : bool
1453
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1454
+ """
1455
+ ...
1456
+
1457
+ @typing.overload
1458
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1459
+ """
1460
+ Specifies the PyPI packages for all steps of the flow.
1461
+
1462
+ Use `@pypi_base` to set common packages required by all
1463
+ steps and use `@pypi` to specify step-specific overrides.
1464
+ Parameters
1465
+ ----------
1466
+ packages : Dict[str, str], default: {}
1467
+ Packages to use for this flow. The key is the name of the package
1468
+ and the value is the version to use.
1469
+ python : str, optional, default: None
1470
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1471
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1472
+ """
1473
+ ...
1474
+
1475
+ @typing.overload
1476
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1477
+ ...
1478
+
1479
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1480
+ """
1481
+ Specifies the PyPI packages for all steps of the flow.
1482
+
1483
+ Use `@pypi_base` to set common packages required by all
1484
+ steps and use `@pypi` to specify step-specific overrides.
1485
+ Parameters
1486
+ ----------
1487
+ packages : Dict[str, str], default: {}
1488
+ Packages to use for this flow. The key is the name of the package
1489
+ and the value is the version to use.
1490
+ python : str, optional, default: None
1491
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1492
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1493
+ """
1494
+ ...
1495
+
1496
+ @typing.overload
1497
+ 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]]:
1498
+ """
1499
+ Specifies the event(s) that this flow depends on.
1500
+
1501
+ ```
1502
+ @trigger(event='foo')
1503
+ ```
1504
+ or
1505
+ ```
1506
+ @trigger(events=['foo', 'bar'])
1507
+ ```
1508
+
1509
+ Additionally, you can specify the parameter mappings
1510
+ to map event payload to Metaflow parameters for the flow.
1511
+ ```
1512
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1513
+ ```
1514
+ or
1515
+ ```
1516
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1517
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1518
+ ```
1519
+
1520
+ 'parameters' can also be a list of strings and tuples like so:
1521
+ ```
1522
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1523
+ ```
1524
+ This is equivalent to:
1525
+ ```
1526
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1527
+ ```
1528
+
1529
+ Parameters
1530
+ ----------
1531
+ event : Union[str, Dict[str, Any]], optional, default None
1532
+ Event dependency for this flow.
1533
+ events : List[Union[str, Dict[str, Any]]], default []
1534
+ Events dependency for this flow.
1535
+ options : Dict[str, Any], default {}
1536
+ Backend-specific configuration for tuning eventing behavior.
1537
+
1538
+
1539
+ """
1540
+ ...
1541
+
1542
+ @typing.overload
1543
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1544
+ ...
1545
+
1546
+ 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] = {}):
1547
+ """
1548
+ Specifies the event(s) that this flow depends on.
1549
+
1550
+ ```
1551
+ @trigger(event='foo')
1552
+ ```
1553
+ or
1554
+ ```
1555
+ @trigger(events=['foo', 'bar'])
1556
+ ```
1557
+
1558
+ Additionally, you can specify the parameter mappings
1559
+ to map event payload to Metaflow parameters for the flow.
1560
+ ```
1561
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1562
+ ```
1563
+ or
1564
+ ```
1565
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1566
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1567
+ ```
1568
+
1569
+ 'parameters' can also be a list of strings and tuples like so:
1570
+ ```
1571
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1572
+ ```
1573
+ This is equivalent to:
1574
+ ```
1575
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1576
+ ```
1577
+
1578
+ Parameters
1579
+ ----------
1580
+ event : Union[str, Dict[str, Any]], optional, default None
1581
+ Event dependency for this flow.
1582
+ events : List[Union[str, Dict[str, Any]]], default []
1583
+ Events dependency for this flow.
1584
+ options : Dict[str, Any], default {}
1585
+ Backend-specific configuration for tuning eventing behavior.
1586
+
1587
+
1588
+ """
1589
+ ...
1590
+
1591
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1592
+ """
1593
+ Specifies what flows belong to the same project.
1594
+
1595
+ A project-specific namespace is created for all flows that
1596
+ use the same `@project(name)`.
1597
+
1598
+ Parameters
1599
+ ----------
1600
+ name : str
1601
+ Project name. Make sure that the name is unique amongst all
1602
+ projects that use the same production scheduler. The name may
1603
+ contain only lowercase alphanumeric characters and underscores.
1604
+
1605
+
1606
+ """
1607
+ ...
1608
+
1609
+ @typing.overload
1610
+ 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]]:
1611
+ """
1612
+ Specifies the flow(s) that this flow depends on.
1613
+
1614
+ ```
1421
1615
  @trigger_on_finish(flow='FooFlow')
1422
1616
  ```
1423
1617
  or
@@ -1557,84 +1751,52 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1557
1751
  """
1558
1752
  ...
1559
1753
 
1560
- 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]]:
1561
- """
1562
- 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)
1563
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1564
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1565
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1566
- starts only after all sensors finish.
1567
-
1568
- Parameters
1569
- ----------
1570
- timeout : int
1571
- Time, in seconds before the task times out and fails. (Default: 3600)
1572
- poke_interval : int
1573
- Time in seconds that the job should wait in between each try. (Default: 60)
1574
- mode : str
1575
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1576
- exponential_backoff : bool
1577
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1578
- pool : str
1579
- the slot pool this task should run in,
1580
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1581
- soft_fail : bool
1582
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1583
- name : str
1584
- Name of the sensor on Airflow
1585
- description : str
1586
- Description of sensor in the Airflow UI
1587
- bucket_key : Union[str, List[str]]
1588
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1589
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1590
- bucket_name : str
1591
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1592
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1593
- wildcard_match : bool
1594
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1595
- aws_conn_id : str
1596
- a reference to the s3 connection on Airflow. (Default: None)
1597
- verify : bool
1598
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1599
- """
1600
- ...
1601
-
1602
1754
  @typing.overload
1603
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1755
+ 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]]:
1604
1756
  """
1605
- Specifies the PyPI packages for all steps of the flow.
1757
+ Specifies the Conda environment for all steps of the flow.
1758
+
1759
+ Use `@conda_base` to set common libraries required by all
1760
+ steps and use `@conda` to specify step-specific additions.
1606
1761
 
1607
- Use `@pypi_base` to set common packages required by all
1608
- steps and use `@pypi` to specify step-specific overrides.
1609
1762
  Parameters
1610
1763
  ----------
1611
- packages : Dict[str, str], default: {}
1764
+ packages : Dict[str, str], default {}
1612
1765
  Packages to use for this flow. The key is the name of the package
1613
1766
  and the value is the version to use.
1614
- python : str, optional, default: None
1767
+ libraries : Dict[str, str], default {}
1768
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1769
+ python : str, optional, default None
1615
1770
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1616
1771
  that the version used will correspond to the version of the Python interpreter used to start the run.
1772
+ disabled : bool, default False
1773
+ If set to True, disables Conda.
1617
1774
  """
1618
1775
  ...
1619
1776
 
1620
1777
  @typing.overload
1621
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1778
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1622
1779
  ...
1623
1780
 
1624
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1781
+ 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):
1625
1782
  """
1626
- Specifies the PyPI packages for all steps of the flow.
1783
+ Specifies the Conda environment for all steps of the flow.
1784
+
1785
+ Use `@conda_base` to set common libraries required by all
1786
+ steps and use `@conda` to specify step-specific additions.
1627
1787
 
1628
- Use `@pypi_base` to set common packages required by all
1629
- steps and use `@pypi` to specify step-specific overrides.
1630
1788
  Parameters
1631
1789
  ----------
1632
- packages : Dict[str, str], default: {}
1790
+ packages : Dict[str, str], default {}
1633
1791
  Packages to use for this flow. The key is the name of the package
1634
1792
  and the value is the version to use.
1635
- python : str, optional, default: None
1793
+ libraries : Dict[str, str], default {}
1794
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1795
+ python : str, optional, default None
1636
1796
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1637
1797
  that the version used will correspond to the version of the Python interpreter used to start the run.
1798
+ disabled : bool, default False
1799
+ If set to True, disables Conda.
1638
1800
  """
1639
1801
  ...
1640
1802
 
@@ -1687,168 +1849,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1687
1849
  """
1688
1850
  ...
1689
1851
 
1690
- @typing.overload
1691
- 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]]:
1692
- """
1693
- Specifies the Conda environment for all steps of the flow.
1694
-
1695
- Use `@conda_base` to set common libraries required by all
1696
- steps and use `@conda` to specify step-specific additions.
1697
-
1698
- Parameters
1699
- ----------
1700
- packages : Dict[str, str], default {}
1701
- Packages to use for this flow. The key is the name of the package
1702
- and the value is the version to use.
1703
- libraries : Dict[str, str], default {}
1704
- Supported for backward compatibility. When used with packages, packages will take precedence.
1705
- python : str, optional, default None
1706
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1707
- that the version used will correspond to the version of the Python interpreter used to start the run.
1708
- disabled : bool, default False
1709
- If set to True, disables Conda.
1710
- """
1711
- ...
1712
-
1713
- @typing.overload
1714
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1715
- ...
1716
-
1717
- 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):
1718
- """
1719
- Specifies the Conda environment for all steps of the flow.
1720
-
1721
- Use `@conda_base` to set common libraries required by all
1722
- steps and use `@conda` to specify step-specific additions.
1723
-
1724
- Parameters
1725
- ----------
1726
- packages : Dict[str, str], default {}
1727
- Packages to use for this flow. The key is the name of the package
1728
- and the value is the version to use.
1729
- libraries : Dict[str, str], default {}
1730
- Supported for backward compatibility. When used with packages, packages will take precedence.
1731
- python : str, optional, default None
1732
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1733
- that the version used will correspond to the version of the Python interpreter used to start the run.
1734
- disabled : bool, default False
1735
- If set to True, disables Conda.
1736
- """
1737
- ...
1738
-
1739
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1740
- """
1741
- Specifies what flows belong to the same project.
1742
-
1743
- A project-specific namespace is created for all flows that
1744
- use the same `@project(name)`.
1745
-
1746
- Parameters
1747
- ----------
1748
- name : str
1749
- Project name. Make sure that the name is unique amongst all
1750
- projects that use the same production scheduler. The name may
1751
- contain only lowercase alphanumeric characters and underscores.
1752
-
1753
-
1754
- """
1755
- ...
1756
-
1757
- @typing.overload
1758
- 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]]:
1759
- """
1760
- Specifies the event(s) that this flow depends on.
1761
-
1762
- ```
1763
- @trigger(event='foo')
1764
- ```
1765
- or
1766
- ```
1767
- @trigger(events=['foo', 'bar'])
1768
- ```
1769
-
1770
- Additionally, you can specify the parameter mappings
1771
- to map event payload to Metaflow parameters for the flow.
1772
- ```
1773
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1774
- ```
1775
- or
1776
- ```
1777
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1778
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1779
- ```
1780
-
1781
- 'parameters' can also be a list of strings and tuples like so:
1782
- ```
1783
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1784
- ```
1785
- This is equivalent to:
1786
- ```
1787
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1788
- ```
1789
-
1790
- Parameters
1791
- ----------
1792
- event : Union[str, Dict[str, Any]], optional, default None
1793
- Event dependency for this flow.
1794
- events : List[Union[str, Dict[str, Any]]], default []
1795
- Events dependency for this flow.
1796
- options : Dict[str, Any], default {}
1797
- Backend-specific configuration for tuning eventing behavior.
1798
-
1799
-
1800
- """
1801
- ...
1802
-
1803
- @typing.overload
1804
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1805
- ...
1806
-
1807
- 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] = {}):
1808
- """
1809
- Specifies the event(s) that this flow depends on.
1810
-
1811
- ```
1812
- @trigger(event='foo')
1813
- ```
1814
- or
1815
- ```
1816
- @trigger(events=['foo', 'bar'])
1817
- ```
1818
-
1819
- Additionally, you can specify the parameter mappings
1820
- to map event payload to Metaflow parameters for the flow.
1821
- ```
1822
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1823
- ```
1824
- or
1825
- ```
1826
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1827
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1828
- ```
1829
-
1830
- 'parameters' can also be a list of strings and tuples like so:
1831
- ```
1832
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1833
- ```
1834
- This is equivalent to:
1835
- ```
1836
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1837
- ```
1838
-
1839
- Parameters
1840
- ----------
1841
- event : Union[str, Dict[str, Any]], optional, default None
1842
- Event dependency for this flow.
1843
- events : List[Union[str, Dict[str, Any]]], default []
1844
- Events dependency for this flow.
1845
- options : Dict[str, Any], default {}
1846
- Backend-specific configuration for tuning eventing behavior.
1847
-
1848
-
1849
- """
1850
- ...
1851
-
1852
1852
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1853
1853
  """
1854
1854
  Switch namespace to the one provided.