metaflow-stubs 2.12.1__py2.py3-none-any.whl → 2.12.3__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 (142) hide show
  1. metaflow-stubs/__init__.pyi +592 -592
  2. metaflow-stubs/cards.pyi +5 -5
  3. metaflow-stubs/cli.pyi +3 -23
  4. metaflow-stubs/client/__init__.pyi +4 -4
  5. metaflow-stubs/client/core.pyi +6 -6
  6. metaflow-stubs/client/filecache.pyi +3 -3
  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 +2 -2
  14. metaflow-stubs/metadata/util.pyi +2 -2
  15. metaflow-stubs/metaflow_config.pyi +4 -2
  16. metaflow-stubs/metaflow_current.pyi +17 -17
  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 +3 -3
  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 +3 -3
  30. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  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 +4 -4
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  37. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  38. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  39. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  45. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  46. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  47. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +4 -4
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  56. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  58. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
  60. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  61. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  62. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  63. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  64. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  65. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  66. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  71. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  78. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  81. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  82. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  83. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  84. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  85. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  86. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  87. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  88. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  89. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  90. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  91. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  92. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  93. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  94. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  95. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  96. metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
  97. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  98. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
  99. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  100. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  101. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  103. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
  105. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
  106. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  107. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  108. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +3 -3
  110. metaflow-stubs/plugins/logs_cli.pyi +3 -3
  111. metaflow-stubs/plugins/package_cli.pyi +2 -2
  112. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  114. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  115. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  116. metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -5
  117. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
  119. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  120. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  121. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  122. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  123. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  124. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  125. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  126. metaflow-stubs/plugins/tag_cli.pyi +4 -4
  127. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  128. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  129. metaflow-stubs/procpoll.pyi +2 -2
  130. metaflow-stubs/pylint_wrapper.pyi +2 -2
  131. metaflow-stubs/runner/__init__.pyi +2 -2
  132. metaflow-stubs/runner/metaflow_runner.pyi +5 -5
  133. metaflow-stubs/runner/nbrun.pyi +2 -2
  134. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  135. metaflow-stubs/tagging_util.pyi +2 -2
  136. metaflow-stubs/tuple_util.pyi +2 -2
  137. metaflow-stubs/version.pyi +2 -2
  138. {metaflow_stubs-2.12.1.dist-info → metaflow_stubs-2.12.3.dist-info}/METADATA +2 -2
  139. metaflow_stubs-2.12.3.dist-info/RECORD +142 -0
  140. metaflow_stubs-2.12.1.dist-info/RECORD +0 -142
  141. {metaflow_stubs-2.12.1.dist-info → metaflow_stubs-2.12.3.dist-info}/WHEEL +0 -0
  142. {metaflow_stubs-2.12.1.dist-info → metaflow_stubs-2.12.3.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,24 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.1 #
4
- # Generated on 2024-06-03T17:47:01.111972 #
3
+ # MF version: 2.12.3 #
4
+ # Generated on 2024-06-05T23:31:10.405226 #
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.plugins.datatools.s3.s3
12
- import metaflow._vendor.click.types
11
+ import metaflow.parameters
13
12
  import io
13
+ import metaflow.metaflow_current
14
+ import metaflow.datastore.inputs
15
+ import metaflow.plugins.datatools.s3.s3
16
+ import datetime
14
17
  import typing
18
+ import metaflow.runner.metaflow_runner
15
19
  import metaflow.events
16
- import datetime
17
20
  import metaflow.client.core
18
- import metaflow.datastore.inputs
19
- import metaflow.parameters
20
- import metaflow.runner.metaflow_runner
21
- import metaflow.metaflow_current
21
+ import metaflow._vendor.click.types
22
22
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
23
23
  StepFlag = typing.NewType("StepFlag", bool)
24
24
 
@@ -726,145 +726,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
726
726
  """
727
727
  ...
728
728
 
729
- @typing.overload
730
- def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
731
- """
732
- Specifies the PyPI packages for the step.
733
-
734
- Information in this decorator will augment any
735
- attributes set in the `@pyi_base` flow-level decorator. Hence,
736
- you can use `@pypi_base` to set packages required by all
737
- steps and use `@pypi` to specify step-specific overrides.
738
-
739
- Parameters
740
- ----------
741
- packages : Dict[str, str], default: {}
742
- Packages to use for this step. The key is the name of the package
743
- and the value is the version to use.
744
- python : str, optional, default: None
745
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
746
- that the version used will correspond to the version of the Python interpreter used to start the run.
747
- """
748
- ...
749
-
750
- @typing.overload
751
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
752
- ...
753
-
754
- @typing.overload
755
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
756
- ...
757
-
758
- 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):
759
- """
760
- Specifies the PyPI packages for the step.
761
-
762
- Information in this decorator will augment any
763
- attributes set in the `@pyi_base` flow-level decorator. Hence,
764
- you can use `@pypi_base` to set packages required by all
765
- steps and use `@pypi` to specify step-specific overrides.
766
-
767
- Parameters
768
- ----------
769
- packages : Dict[str, str], default: {}
770
- Packages to use for this step. The key is the name of the package
771
- and the value is the version to use.
772
- python : str, optional, default: None
773
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
774
- that the version used will correspond to the version of the Python interpreter used to start the run.
775
- """
776
- ...
777
-
778
- @typing.overload
779
- 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]]]:
780
- """
781
- Specifies environment variables to be set prior to the execution of a step.
782
-
783
- Parameters
784
- ----------
785
- vars : Dict[str, str], default {}
786
- Dictionary of environment variables to set.
787
- """
788
- ...
789
-
790
- @typing.overload
791
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
792
- ...
793
-
794
- @typing.overload
795
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
796
- ...
797
-
798
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
799
- """
800
- Specifies environment variables to be set prior to the execution of a step.
801
-
802
- Parameters
803
- ----------
804
- vars : Dict[str, str], default {}
805
- Dictionary of environment variables to set.
806
- """
807
- ...
808
-
809
- 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]]]:
810
- """
811
- Specifies that this step should execute on Kubernetes.
812
-
813
- Parameters
814
- ----------
815
- cpu : int, default 1
816
- Number of CPUs required for this step. If `@resources` is
817
- also present, the maximum value from all decorators is used.
818
- memory : int, default 4096
819
- Memory size (in MB) required for this step. If
820
- `@resources` is also present, the maximum value from all decorators is
821
- used.
822
- disk : int, default 10240
823
- Disk size (in MB) required for this step. If
824
- `@resources` is also present, the maximum value from all decorators is
825
- used.
826
- image : str, optional, default None
827
- Docker image to use when launching on Kubernetes. If not specified, and
828
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
829
- not, a default Docker image mapping to the current version of Python is used.
830
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
831
- If given, the imagePullPolicy to be applied to the Docker image of the step.
832
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
833
- Kubernetes service account to use when launching pod in Kubernetes.
834
- secrets : List[str], optional, default None
835
- Kubernetes secrets to use when launching pod in Kubernetes. These
836
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
837
- in Metaflow configuration.
838
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
839
- Kubernetes namespace to use when launching pod in Kubernetes.
840
- gpu : int, optional, default None
841
- Number of GPUs required for this step. A value of zero implies that
842
- the scheduled node should not have GPUs.
843
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
844
- The vendor of the GPUs to be used for this step.
845
- tolerations : List[str], default []
846
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
847
- Kubernetes tolerations to use when launching pod in Kubernetes.
848
- use_tmpfs : bool, default False
849
- This enables an explicit tmpfs mount for this step.
850
- tmpfs_tempdir : bool, default True
851
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
852
- tmpfs_size : int, optional, default: None
853
- The value for the size (in MiB) of the tmpfs mount for this step.
854
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
855
- memory allocated for this step.
856
- tmpfs_path : str, optional, default /metaflow_temp
857
- Path to tmpfs mount for this step.
858
- persistent_volume_claims : Dict[str, str], optional, default None
859
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
860
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
861
- shared_memory: int, optional
862
- Shared memory size (in MiB) required for this step
863
- port: int, optional
864
- Port number to specify in the Kubernetes job object
865
- """
866
- ...
867
-
868
729
  @typing.overload
869
730
  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]]]:
870
731
  """
@@ -917,279 +778,100 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
917
778
  ...
918
779
 
919
780
  @typing.overload
920
- 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]]]:
781
+ def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
921
782
  """
922
- Specifies the resources needed when executing this step.
923
-
924
- Use `@resources` to specify the resource requirements
925
- independently of the specific compute layer (`@batch`, `@kubernetes`).
783
+ Specifies that the step will success under all circumstances.
926
784
 
927
- You can choose the compute layer on the command line by executing e.g.
928
- ```
929
- python myflow.py run --with batch
930
- ```
931
- or
932
- ```
933
- python myflow.py run --with kubernetes
934
- ```
935
- which executes the flow on the desired system using the
936
- requirements specified in `@resources`.
785
+ The decorator will create an optional artifact, specified by `var`, which
786
+ contains the exception raised. You can use it to detect the presence
787
+ of errors, indicating that all happy-path artifacts produced by the step
788
+ are missing.
937
789
 
938
790
  Parameters
939
791
  ----------
940
- cpu : int, default 1
941
- Number of CPUs required for this step.
942
- gpu : int, default 0
943
- Number of GPUs required for this step.
944
- disk : int, optional, default None
945
- Disk size (in MB) required for this step. Only applies on Kubernetes.
946
- memory : int, default 4096
947
- Memory size (in MB) required for this step.
948
- shared_memory : int, optional, default None
949
- The value for the size (in MiB) of the /dev/shm volume for this step.
950
- This parameter maps to the `--shm-size` option in Docker.
792
+ var : str, optional, default None
793
+ Name of the artifact in which to store the caught exception.
794
+ If not specified, the exception is not stored.
795
+ print_exception : bool, default True
796
+ Determines whether or not the exception is printed to
797
+ stdout when caught.
951
798
  """
952
799
  ...
953
800
 
954
801
  @typing.overload
955
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
802
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
956
803
  ...
957
804
 
958
805
  @typing.overload
959
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
806
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
960
807
  ...
961
808
 
962
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
809
+ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
963
810
  """
964
- Specifies the resources needed when executing this step.
965
-
966
- Use `@resources` to specify the resource requirements
967
- independently of the specific compute layer (`@batch`, `@kubernetes`).
811
+ Specifies that the step will success under all circumstances.
968
812
 
969
- You can choose the compute layer on the command line by executing e.g.
970
- ```
971
- python myflow.py run --with batch
972
- ```
973
- or
974
- ```
975
- python myflow.py run --with kubernetes
976
- ```
977
- which executes the flow on the desired system using the
978
- requirements specified in `@resources`.
813
+ The decorator will create an optional artifact, specified by `var`, which
814
+ contains the exception raised. You can use it to detect the presence
815
+ of errors, indicating that all happy-path artifacts produced by the step
816
+ are missing.
979
817
 
980
818
  Parameters
981
819
  ----------
982
- cpu : int, default 1
983
- Number of CPUs required for this step.
984
- gpu : int, default 0
985
- Number of GPUs required for this step.
986
- disk : int, optional, default None
987
- Disk size (in MB) required for this step. Only applies on Kubernetes.
988
- memory : int, default 4096
989
- Memory size (in MB) required for this step.
990
- shared_memory : int, optional, default None
991
- The value for the size (in MiB) of the /dev/shm volume for this step.
992
- This parameter maps to the `--shm-size` option in Docker.
820
+ var : str, optional, default None
821
+ Name of the artifact in which to store the caught exception.
822
+ If not specified, the exception is not stored.
823
+ print_exception : bool, default True
824
+ Determines whether or not the exception is printed to
825
+ stdout when caught.
993
826
  """
994
827
  ...
995
828
 
996
829
  @typing.overload
997
- 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]]]:
830
+ def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
998
831
  """
999
- Specifies the Conda environment for the step.
832
+ Specifies the PyPI packages for the step.
1000
833
 
1001
834
  Information in this decorator will augment any
1002
- attributes set in the `@conda_base` flow-level decorator. Hence,
1003
- you can use `@conda_base` to set packages required by all
1004
- steps and use `@conda` to specify step-specific overrides.
835
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
836
+ you can use `@pypi_base` to set packages required by all
837
+ steps and use `@pypi` to specify step-specific overrides.
1005
838
 
1006
839
  Parameters
1007
840
  ----------
1008
- packages : Dict[str, str], default {}
841
+ packages : Dict[str, str], default: {}
1009
842
  Packages to use for this step. The key is the name of the package
1010
843
  and the value is the version to use.
1011
- libraries : Dict[str, str], default {}
1012
- Supported for backward compatibility. When used with packages, packages will take precedence.
1013
- python : str, optional, default None
844
+ python : str, optional, default: None
1014
845
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1015
846
  that the version used will correspond to the version of the Python interpreter used to start the run.
1016
- disabled : bool, default False
1017
- If set to True, disables @conda.
1018
847
  """
1019
848
  ...
1020
849
 
1021
850
  @typing.overload
1022
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
851
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1023
852
  ...
1024
853
 
1025
854
  @typing.overload
1026
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
855
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1027
856
  ...
1028
857
 
1029
- 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):
858
+ 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):
1030
859
  """
1031
- Specifies the Conda environment for the step.
860
+ Specifies the PyPI packages for the step.
1032
861
 
1033
862
  Information in this decorator will augment any
1034
- attributes set in the `@conda_base` flow-level decorator. Hence,
1035
- you can use `@conda_base` to set packages required by all
1036
- steps and use `@conda` to specify step-specific overrides.
863
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
864
+ you can use `@pypi_base` to set packages required by all
865
+ steps and use `@pypi` to specify step-specific overrides.
1037
866
 
1038
867
  Parameters
1039
868
  ----------
1040
- packages : Dict[str, str], default {}
869
+ packages : Dict[str, str], default: {}
1041
870
  Packages to use for this step. The key is the name of the package
1042
871
  and the value is the version to use.
1043
- libraries : Dict[str, str], default {}
1044
- Supported for backward compatibility. When used with packages, packages will take precedence.
1045
- python : str, optional, default None
872
+ python : str, optional, default: None
1046
873
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1047
874
  that the version used will correspond to the version of the Python interpreter used to start the run.
1048
- disabled : bool, default False
1049
- If set to True, disables @conda.
1050
- """
1051
- ...
1052
-
1053
- @typing.overload
1054
- 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]]]:
1055
- """
1056
- Specifies the number of times the task corresponding
1057
- to a step needs to be retried.
1058
-
1059
- This decorator is useful for handling transient errors, such as networking issues.
1060
- If your task contains operations that can't be retried safely, e.g. database updates,
1061
- it is advisable to annotate it with `@retry(times=0)`.
1062
-
1063
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1064
- decorator will execute a no-op task after all retries have been exhausted,
1065
- ensuring that the flow execution can continue.
1066
-
1067
- Parameters
1068
- ----------
1069
- times : int, default 3
1070
- Number of times to retry this task.
1071
- minutes_between_retries : int, default 2
1072
- Number of minutes between retries.
1073
- """
1074
- ...
1075
-
1076
- @typing.overload
1077
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1078
- ...
1079
-
1080
- @typing.overload
1081
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1082
- ...
1083
-
1084
- 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):
1085
- """
1086
- Specifies the number of times the task corresponding
1087
- to a step needs to be retried.
1088
-
1089
- This decorator is useful for handling transient errors, such as networking issues.
1090
- If your task contains operations that can't be retried safely, e.g. database updates,
1091
- it is advisable to annotate it with `@retry(times=0)`.
1092
-
1093
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1094
- decorator will execute a no-op task after all retries have been exhausted,
1095
- ensuring that the flow execution can continue.
1096
-
1097
- Parameters
1098
- ----------
1099
- times : int, default 3
1100
- Number of times to retry this task.
1101
- minutes_between_retries : int, default 2
1102
- Number of minutes between retries.
1103
- """
1104
- ...
1105
-
1106
- @typing.overload
1107
- 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]]]:
1108
- """
1109
- Specifies secrets to be retrieved and injected as environment variables prior to
1110
- the execution of a step.
1111
-
1112
- Parameters
1113
- ----------
1114
- sources : List[Union[str, Dict[str, Any]]], default: []
1115
- List of secret specs, defining how the secrets are to be retrieved
1116
- """
1117
- ...
1118
-
1119
- @typing.overload
1120
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1121
- ...
1122
-
1123
- @typing.overload
1124
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1125
- ...
1126
-
1127
- 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]]] = []):
1128
- """
1129
- Specifies secrets to be retrieved and injected as environment variables prior to
1130
- the execution of a step.
1131
-
1132
- Parameters
1133
- ----------
1134
- sources : List[Union[str, Dict[str, Any]]], default: []
1135
- List of secret specs, defining how the secrets are to be retrieved
1136
- """
1137
- ...
1138
-
1139
- @typing.overload
1140
- 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]]]:
1141
- """
1142
- Specifies a timeout for your step.
1143
-
1144
- This decorator is useful if this step may hang indefinitely.
1145
-
1146
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1147
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1148
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1149
-
1150
- Note that all the values specified in parameters are added together so if you specify
1151
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1152
-
1153
- Parameters
1154
- ----------
1155
- seconds : int, default 0
1156
- Number of seconds to wait prior to timing out.
1157
- minutes : int, default 0
1158
- Number of minutes to wait prior to timing out.
1159
- hours : int, default 0
1160
- Number of hours to wait prior to timing out.
1161
- """
1162
- ...
1163
-
1164
- @typing.overload
1165
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1166
- ...
1167
-
1168
- @typing.overload
1169
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1170
- ...
1171
-
1172
- 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):
1173
- """
1174
- Specifies a timeout for your step.
1175
-
1176
- This decorator is useful if this step may hang indefinitely.
1177
-
1178
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1179
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1180
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1181
-
1182
- Note that all the values specified in parameters are added together so if you specify
1183
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1184
-
1185
- Parameters
1186
- ----------
1187
- seconds : int, default 0
1188
- Number of seconds to wait prior to timing out.
1189
- minutes : int, default 0
1190
- Number of minutes to wait prior to timing out.
1191
- hours : int, default 0
1192
- Number of hours to wait prior to timing out.
1193
875
  """
1194
876
  ...
1195
877
 
@@ -1341,51 +1023,527 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1341
1023
  ...
1342
1024
 
1343
1025
  @typing.overload
1344
- 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]]]:
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]]]:
1345
1027
  """
1346
- Specifies that the step will success under all circumstances.
1028
+ Specifies the number of times the task corresponding
1029
+ to a step needs to be retried.
1347
1030
 
1348
- The decorator will create an optional artifact, specified by `var`, which
1349
- contains the exception raised. You can use it to detect the presence
1350
- of errors, indicating that all happy-path artifacts produced by the step
1351
- are missing.
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.
1352
1038
 
1353
1039
  Parameters
1354
1040
  ----------
1355
- var : str, optional, default None
1356
- Name of the artifact in which to store the caught exception.
1357
- If not specified, the exception is not stored.
1358
- print_exception : bool, default True
1359
- Determines whether or not the exception is printed to
1360
- stdout when caught.
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.
1361
1045
  """
1362
1046
  ...
1363
1047
 
1364
1048
  @typing.overload
1365
- def catch(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]:
1366
1050
  ...
1367
1051
 
1368
1052
  @typing.overload
1369
- def catch(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]:
1370
1054
  ...
1371
1055
 
1372
- 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):
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):
1057
+ """
1058
+ Specifies the number of times the task corresponding
1059
+ to a step needs to be retried.
1060
+
1061
+ This decorator is useful for handling transient errors, such as networking issues.
1062
+ If your task contains operations that can't be retried safely, e.g. database updates,
1063
+ it is advisable to annotate it with `@retry(times=0)`.
1064
+
1065
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1066
+ decorator will execute a no-op task after all retries have been exhausted,
1067
+ ensuring that the flow execution can continue.
1068
+
1069
+ Parameters
1070
+ ----------
1071
+ times : int, default 3
1072
+ Number of times to retry this task.
1073
+ minutes_between_retries : int, default 2
1074
+ Number of minutes between retries.
1075
+ """
1076
+ ...
1077
+
1078
+ @typing.overload
1079
+ def resources(*, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1080
+ """
1081
+ Specifies the resources needed when executing this step.
1082
+
1083
+ Use `@resources` to specify the resource requirements
1084
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1085
+
1086
+ You can choose the compute layer on the command line by executing e.g.
1087
+ ```
1088
+ python myflow.py run --with batch
1089
+ ```
1090
+ or
1091
+ ```
1092
+ python myflow.py run --with kubernetes
1093
+ ```
1094
+ which executes the flow on the desired system using the
1095
+ requirements specified in `@resources`.
1096
+
1097
+ Parameters
1098
+ ----------
1099
+ cpu : int, default 1
1100
+ Number of CPUs required for this step.
1101
+ gpu : int, default 0
1102
+ Number of GPUs required for this step.
1103
+ disk : int, optional, default None
1104
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1105
+ memory : int, default 4096
1106
+ Memory size (in MB) required for this step.
1107
+ shared_memory : int, optional, default None
1108
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1109
+ This parameter maps to the `--shm-size` option in Docker.
1110
+ """
1111
+ ...
1112
+
1113
+ @typing.overload
1114
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1115
+ ...
1116
+
1117
+ @typing.overload
1118
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1119
+ ...
1120
+
1121
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
1122
+ """
1123
+ Specifies the resources needed when executing this step.
1124
+
1125
+ Use `@resources` to specify the resource requirements
1126
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1127
+
1128
+ You can choose the compute layer on the command line by executing e.g.
1129
+ ```
1130
+ python myflow.py run --with batch
1131
+ ```
1132
+ or
1133
+ ```
1134
+ python myflow.py run --with kubernetes
1135
+ ```
1136
+ which executes the flow on the desired system using the
1137
+ requirements specified in `@resources`.
1138
+
1139
+ Parameters
1140
+ ----------
1141
+ cpu : int, default 1
1142
+ Number of CPUs required for this step.
1143
+ gpu : int, default 0
1144
+ Number of GPUs required for this step.
1145
+ disk : int, optional, default None
1146
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1147
+ memory : int, default 4096
1148
+ Memory size (in MB) required for this step.
1149
+ shared_memory : int, optional, default None
1150
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1151
+ This parameter maps to the `--shm-size` option in Docker.
1152
+ """
1153
+ ...
1154
+
1155
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1156
+ """
1157
+ Specifies that this step should execute on Kubernetes.
1158
+
1159
+ Parameters
1160
+ ----------
1161
+ cpu : int, default 1
1162
+ Number of CPUs required for this step. If `@resources` is
1163
+ also present, the maximum value from all decorators is used.
1164
+ memory : int, default 4096
1165
+ Memory size (in MB) required for this step. If
1166
+ `@resources` is also present, the maximum value from all decorators is
1167
+ used.
1168
+ disk : int, default 10240
1169
+ Disk size (in MB) required for this step. If
1170
+ `@resources` is also present, the maximum value from all decorators is
1171
+ used.
1172
+ image : str, optional, default None
1173
+ Docker image to use when launching on Kubernetes. If not specified, and
1174
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1175
+ not, a default Docker image mapping to the current version of Python is used.
1176
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1177
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
1178
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1179
+ Kubernetes service account to use when launching pod in Kubernetes.
1180
+ secrets : List[str], optional, default None
1181
+ Kubernetes secrets to use when launching pod in Kubernetes. These
1182
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1183
+ in Metaflow configuration.
1184
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1185
+ Kubernetes namespace to use when launching pod in Kubernetes.
1186
+ gpu : int, optional, default None
1187
+ Number of GPUs required for this step. A value of zero implies that
1188
+ the scheduled node should not have GPUs.
1189
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1190
+ The vendor of the GPUs to be used for this step.
1191
+ tolerations : List[str], default []
1192
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1193
+ Kubernetes tolerations to use when launching pod in Kubernetes.
1194
+ use_tmpfs : bool, default False
1195
+ This enables an explicit tmpfs mount for this step.
1196
+ tmpfs_tempdir : bool, default True
1197
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1198
+ tmpfs_size : int, optional, default: None
1199
+ The value for the size (in MiB) of the tmpfs mount for this step.
1200
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1201
+ memory allocated for this step.
1202
+ tmpfs_path : str, optional, default /metaflow_temp
1203
+ Path to tmpfs mount for this step.
1204
+ persistent_volume_claims : Dict[str, str], optional, default None
1205
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1206
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1207
+ shared_memory: int, optional
1208
+ Shared memory size (in MiB) required for this step
1209
+ port: int, optional
1210
+ Port number to specify in the Kubernetes job object
1211
+ """
1212
+ ...
1213
+
1214
+ @typing.overload
1215
+ def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1216
+ """
1217
+ Specifies secrets to be retrieved and injected as environment variables prior to
1218
+ the execution of a step.
1219
+
1220
+ Parameters
1221
+ ----------
1222
+ sources : List[Union[str, Dict[str, Any]]], default: []
1223
+ List of secret specs, defining how the secrets are to be retrieved
1224
+ """
1225
+ ...
1226
+
1227
+ @typing.overload
1228
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1229
+ ...
1230
+
1231
+ @typing.overload
1232
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1233
+ ...
1234
+
1235
+ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []):
1236
+ """
1237
+ Specifies secrets to be retrieved and injected as environment variables prior to
1238
+ the execution of a step.
1239
+
1240
+ Parameters
1241
+ ----------
1242
+ sources : List[Union[str, Dict[str, Any]]], default: []
1243
+ List of secret specs, defining how the secrets are to be retrieved
1244
+ """
1245
+ ...
1246
+
1247
+ @typing.overload
1248
+ def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1249
+ """
1250
+ Specifies a timeout for your step.
1251
+
1252
+ This decorator is useful if this step may hang indefinitely.
1253
+
1254
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1255
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1256
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1257
+
1258
+ Note that all the values specified in parameters are added together so if you specify
1259
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1260
+
1261
+ Parameters
1262
+ ----------
1263
+ seconds : int, default 0
1264
+ Number of seconds to wait prior to timing out.
1265
+ minutes : int, default 0
1266
+ Number of minutes to wait prior to timing out.
1267
+ hours : int, default 0
1268
+ Number of hours to wait prior to timing out.
1269
+ """
1270
+ ...
1271
+
1272
+ @typing.overload
1273
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1274
+ ...
1275
+
1276
+ @typing.overload
1277
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1278
+ ...
1279
+
1280
+ 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):
1281
+ """
1282
+ Specifies a timeout for your step.
1283
+
1284
+ This decorator is useful if this step may hang indefinitely.
1285
+
1286
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1287
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1288
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1289
+
1290
+ Note that all the values specified in parameters are added together so if you specify
1291
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1292
+
1293
+ Parameters
1294
+ ----------
1295
+ seconds : int, default 0
1296
+ Number of seconds to wait prior to timing out.
1297
+ minutes : int, default 0
1298
+ Number of minutes to wait prior to timing out.
1299
+ hours : int, default 0
1300
+ Number of hours to wait prior to timing out.
1301
+ """
1302
+ ...
1303
+
1304
+ @typing.overload
1305
+ 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]]]:
1306
+ """
1307
+ Specifies the Conda environment for the step.
1308
+
1309
+ Information in this decorator will augment any
1310
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1311
+ you can use `@conda_base` to set packages required by all
1312
+ steps and use `@conda` to specify step-specific overrides.
1313
+
1314
+ Parameters
1315
+ ----------
1316
+ packages : Dict[str, str], default {}
1317
+ Packages to use for this step. The key is the name of the package
1318
+ and the value is the version to use.
1319
+ libraries : Dict[str, str], default {}
1320
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1321
+ python : str, optional, default None
1322
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1323
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1324
+ disabled : bool, default False
1325
+ If set to True, disables @conda.
1326
+ """
1327
+ ...
1328
+
1329
+ @typing.overload
1330
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1331
+ ...
1332
+
1333
+ @typing.overload
1334
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1335
+ ...
1336
+
1337
+ 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):
1338
+ """
1339
+ Specifies the Conda environment for the step.
1340
+
1341
+ Information in this decorator will augment any
1342
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1343
+ you can use `@conda_base` to set packages required by all
1344
+ steps and use `@conda` to specify step-specific overrides.
1345
+
1346
+ Parameters
1347
+ ----------
1348
+ packages : Dict[str, str], default {}
1349
+ Packages to use for this step. The key is the name of the package
1350
+ and the value is the version to use.
1351
+ libraries : Dict[str, str], default {}
1352
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1353
+ python : str, optional, default None
1354
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1355
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1356
+ disabled : bool, default False
1357
+ If set to True, disables @conda.
1358
+ """
1359
+ ...
1360
+
1361
+ @typing.overload
1362
+ def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1363
+ """
1364
+ Specifies environment variables to be set prior to the execution of a step.
1365
+
1366
+ Parameters
1367
+ ----------
1368
+ vars : Dict[str, str], default {}
1369
+ Dictionary of environment variables to set.
1370
+ """
1371
+ ...
1372
+
1373
+ @typing.overload
1374
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1375
+ ...
1376
+
1377
+ @typing.overload
1378
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1379
+ ...
1380
+
1381
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1382
+ """
1383
+ Specifies environment variables to be set prior to the execution of a step.
1384
+
1385
+ Parameters
1386
+ ----------
1387
+ vars : Dict[str, str], default {}
1388
+ Dictionary of environment variables to set.
1389
+ """
1390
+ ...
1391
+
1392
+ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1393
+ """
1394
+ The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
1395
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1396
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1397
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1398
+ starts only after all sensors finish.
1399
+
1400
+ Parameters
1401
+ ----------
1402
+ timeout : int
1403
+ Time, in seconds before the task times out and fails. (Default: 3600)
1404
+ poke_interval : int
1405
+ Time in seconds that the job should wait in between each try. (Default: 60)
1406
+ mode : str
1407
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1408
+ exponential_backoff : bool
1409
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1410
+ pool : str
1411
+ the slot pool this task should run in,
1412
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1413
+ soft_fail : bool
1414
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1415
+ name : str
1416
+ Name of the sensor on Airflow
1417
+ description : str
1418
+ Description of sensor in the Airflow UI
1419
+ bucket_key : Union[str, List[str]]
1420
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1421
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1422
+ bucket_name : str
1423
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1424
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1425
+ wildcard_match : bool
1426
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1427
+ aws_conn_id : str
1428
+ a reference to the s3 connection on Airflow. (Default: None)
1429
+ verify : bool
1430
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1431
+ """
1432
+ ...
1433
+
1434
+ @typing.overload
1435
+ 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]]:
1436
+ """
1437
+ Specifies the times when the flow should be run when running on a
1438
+ production scheduler.
1439
+
1440
+ Parameters
1441
+ ----------
1442
+ hourly : bool, default False
1443
+ Run the workflow hourly.
1444
+ daily : bool, default True
1445
+ Run the workflow daily.
1446
+ weekly : bool, default False
1447
+ Run the workflow weekly.
1448
+ cron : str, optional, default None
1449
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1450
+ specified by this expression.
1451
+ timezone : str, optional, default None
1452
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1453
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1454
+ """
1455
+ ...
1456
+
1457
+ @typing.overload
1458
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1459
+ ...
1460
+
1461
+ 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):
1462
+ """
1463
+ Specifies the times when the flow should be run when running on a
1464
+ production scheduler.
1465
+
1466
+ Parameters
1467
+ ----------
1468
+ hourly : bool, default False
1469
+ Run the workflow hourly.
1470
+ daily : bool, default True
1471
+ Run the workflow daily.
1472
+ weekly : bool, default False
1473
+ Run the workflow weekly.
1474
+ cron : str, optional, default None
1475
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1476
+ specified by this expression.
1477
+ timezone : str, optional, default None
1478
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1479
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1480
+ """
1481
+ ...
1482
+
1483
+ @typing.overload
1484
+ def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1485
+ """
1486
+ Specifies the Conda environment for all steps of the flow.
1487
+
1488
+ Use `@conda_base` to set common libraries required by all
1489
+ steps and use `@conda` to specify step-specific additions.
1490
+
1491
+ Parameters
1492
+ ----------
1493
+ packages : Dict[str, str], default {}
1494
+ Packages to use for this flow. The key is the name of the package
1495
+ and the value is the version to use.
1496
+ libraries : Dict[str, str], default {}
1497
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1498
+ python : str, optional, default None
1499
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1500
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1501
+ disabled : bool, default False
1502
+ If set to True, disables Conda.
1503
+ """
1504
+ ...
1505
+
1506
+ @typing.overload
1507
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1508
+ ...
1509
+
1510
+ 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):
1511
+ """
1512
+ Specifies the Conda environment for all steps of the flow.
1513
+
1514
+ Use `@conda_base` to set common libraries required by all
1515
+ steps and use `@conda` to specify step-specific additions.
1516
+
1517
+ Parameters
1518
+ ----------
1519
+ packages : Dict[str, str], default {}
1520
+ Packages to use for this flow. The key is the name of the package
1521
+ and the value is the version to use.
1522
+ libraries : Dict[str, str], default {}
1523
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1524
+ python : str, optional, default None
1525
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1526
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1527
+ disabled : bool, default False
1528
+ If set to True, disables Conda.
1529
+ """
1530
+ ...
1531
+
1532
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1373
1533
  """
1374
- Specifies that the step will success under all circumstances.
1534
+ Specifies what flows belong to the same project.
1375
1535
 
1376
- The decorator will create an optional artifact, specified by `var`, which
1377
- contains the exception raised. You can use it to detect the presence
1378
- of errors, indicating that all happy-path artifacts produced by the step
1379
- are missing.
1536
+ A project-specific namespace is created for all flows that
1537
+ use the same `@project(name)`.
1380
1538
 
1381
1539
  Parameters
1382
1540
  ----------
1383
- var : str, optional, default None
1384
- Name of the artifact in which to store the caught exception.
1385
- If not specified, the exception is not stored.
1386
- print_exception : bool, default True
1387
- Determines whether or not the exception is printed to
1388
- stdout when caught.
1541
+ name : str
1542
+ Project name. Make sure that the name is unique amongst all
1543
+ projects that use the same production scheduler. The name may
1544
+ contain only lowercase alphanumeric characters and underscores.
1545
+
1546
+
1389
1547
  """
1390
1548
  ...
1391
1549
 
@@ -1526,6 +1684,45 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1526
1684
  """
1527
1685
  ...
1528
1686
 
1687
+ @typing.overload
1688
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1689
+ """
1690
+ Specifies the PyPI packages for all steps of the flow.
1691
+
1692
+ Use `@pypi_base` to set common packages required by all
1693
+ steps and use `@pypi` to specify step-specific overrides.
1694
+ Parameters
1695
+ ----------
1696
+ packages : Dict[str, str], default: {}
1697
+ Packages to use for this flow. The key is the name of the package
1698
+ and the value is the version to use.
1699
+ python : str, optional, default: None
1700
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1701
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1702
+ """
1703
+ ...
1704
+
1705
+ @typing.overload
1706
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1707
+ ...
1708
+
1709
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1710
+ """
1711
+ Specifies the PyPI packages for all steps of the flow.
1712
+
1713
+ Use `@pypi_base` to set common packages required by all
1714
+ steps and use `@pypi` to specify step-specific overrides.
1715
+ Parameters
1716
+ ----------
1717
+ packages : Dict[str, str], default: {}
1718
+ Packages to use for this flow. The key is the name of the package
1719
+ and the value is the version to use.
1720
+ python : str, optional, default: None
1721
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1722
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1723
+ """
1724
+ ...
1725
+
1529
1726
  @typing.overload
1530
1727
  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]]:
1531
1728
  """
@@ -1629,203 +1826,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1629
1826
  """
1630
1827
  ...
1631
1828
 
1632
- 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]]:
1633
- """
1634
- 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)
1635
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1636
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1637
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1638
- starts only after all sensors finish.
1639
-
1640
- Parameters
1641
- ----------
1642
- timeout : int
1643
- Time, in seconds before the task times out and fails. (Default: 3600)
1644
- poke_interval : int
1645
- Time in seconds that the job should wait in between each try. (Default: 60)
1646
- mode : str
1647
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1648
- exponential_backoff : bool
1649
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1650
- pool : str
1651
- the slot pool this task should run in,
1652
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1653
- soft_fail : bool
1654
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1655
- name : str
1656
- Name of the sensor on Airflow
1657
- description : str
1658
- Description of sensor in the Airflow UI
1659
- bucket_key : Union[str, List[str]]
1660
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1661
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1662
- bucket_name : str
1663
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1664
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1665
- wildcard_match : bool
1666
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1667
- aws_conn_id : str
1668
- a reference to the s3 connection on Airflow. (Default: None)
1669
- verify : bool
1670
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1671
- """
1672
- ...
1673
-
1674
- @typing.overload
1675
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1676
- """
1677
- Specifies the PyPI packages for all steps of the flow.
1678
-
1679
- Use `@pypi_base` to set common packages required by all
1680
- steps and use `@pypi` to specify step-specific overrides.
1681
- Parameters
1682
- ----------
1683
- packages : Dict[str, str], default: {}
1684
- Packages to use for this flow. The key is the name of the package
1685
- and the value is the version to use.
1686
- python : str, optional, default: None
1687
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1688
- that the version used will correspond to the version of the Python interpreter used to start the run.
1689
- """
1690
- ...
1691
-
1692
- @typing.overload
1693
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1694
- ...
1695
-
1696
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1697
- """
1698
- Specifies the PyPI packages for all steps of the flow.
1699
-
1700
- Use `@pypi_base` to set common packages required by all
1701
- steps and use `@pypi` to specify step-specific overrides.
1702
- Parameters
1703
- ----------
1704
- packages : Dict[str, str], default: {}
1705
- Packages to use for this flow. The key is the name of the package
1706
- and the value is the version to use.
1707
- python : str, optional, default: None
1708
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1709
- that the version used will correspond to the version of the Python interpreter used to start the run.
1710
- """
1711
- ...
1712
-
1713
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1714
- """
1715
- Specifies what flows belong to the same project.
1716
-
1717
- A project-specific namespace is created for all flows that
1718
- use the same `@project(name)`.
1719
-
1720
- Parameters
1721
- ----------
1722
- name : str
1723
- Project name. Make sure that the name is unique amongst all
1724
- projects that use the same production scheduler. The name may
1725
- contain only lowercase alphanumeric characters and underscores.
1726
-
1727
-
1728
- """
1729
- ...
1730
-
1731
- @typing.overload
1732
- 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]]:
1733
- """
1734
- Specifies the Conda environment for all steps of the flow.
1735
-
1736
- Use `@conda_base` to set common libraries required by all
1737
- steps and use `@conda` to specify step-specific additions.
1738
-
1739
- Parameters
1740
- ----------
1741
- packages : Dict[str, str], default {}
1742
- Packages to use for this flow. The key is the name of the package
1743
- and the value is the version to use.
1744
- libraries : Dict[str, str], default {}
1745
- Supported for backward compatibility. When used with packages, packages will take precedence.
1746
- python : str, optional, default None
1747
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1748
- that the version used will correspond to the version of the Python interpreter used to start the run.
1749
- disabled : bool, default False
1750
- If set to True, disables Conda.
1751
- """
1752
- ...
1753
-
1754
- @typing.overload
1755
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1756
- ...
1757
-
1758
- 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):
1759
- """
1760
- Specifies the Conda environment for all steps of the flow.
1761
-
1762
- Use `@conda_base` to set common libraries required by all
1763
- steps and use `@conda` to specify step-specific additions.
1764
-
1765
- Parameters
1766
- ----------
1767
- packages : Dict[str, str], default {}
1768
- Packages to use for this flow. The key is the name of the package
1769
- and the value is the version to use.
1770
- libraries : Dict[str, str], default {}
1771
- Supported for backward compatibility. When used with packages, packages will take precedence.
1772
- python : str, optional, default None
1773
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1774
- that the version used will correspond to the version of the Python interpreter used to start the run.
1775
- disabled : bool, default False
1776
- If set to True, disables Conda.
1777
- """
1778
- ...
1779
-
1780
- @typing.overload
1781
- 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]]:
1782
- """
1783
- Specifies the times when the flow should be run when running on a
1784
- production scheduler.
1785
-
1786
- Parameters
1787
- ----------
1788
- hourly : bool, default False
1789
- Run the workflow hourly.
1790
- daily : bool, default True
1791
- Run the workflow daily.
1792
- weekly : bool, default False
1793
- Run the workflow weekly.
1794
- cron : str, optional, default None
1795
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1796
- specified by this expression.
1797
- timezone : str, optional, default None
1798
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1799
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1800
- """
1801
- ...
1802
-
1803
- @typing.overload
1804
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1805
- ...
1806
-
1807
- 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):
1808
- """
1809
- Specifies the times when the flow should be run when running on a
1810
- production scheduler.
1811
-
1812
- Parameters
1813
- ----------
1814
- hourly : bool, default False
1815
- Run the workflow hourly.
1816
- daily : bool, default True
1817
- Run the workflow daily.
1818
- weekly : bool, default False
1819
- Run the workflow weekly.
1820
- cron : str, optional, default None
1821
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1822
- specified by this expression.
1823
- timezone : str, optional, default None
1824
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1825
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1826
- """
1827
- ...
1828
-
1829
1829
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1830
1830
  """
1831
1831
  Switch namespace to the one provided.