ob-metaflow-stubs 2.11.4.1__py2.py3-none-any.whl → 2.11.4.2__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 (131) hide show
  1. metaflow-stubs/__init__.pyi +344 -344
  2. metaflow-stubs/cards.pyi +3 -3
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +2 -2
  5. metaflow-stubs/client/core.pyi +6 -6
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/events.pyi +2 -2
  8. metaflow-stubs/exception.pyi +2 -2
  9. metaflow-stubs/flowspec.pyi +4 -4
  10. metaflow-stubs/generated_for.txt +1 -1
  11. metaflow-stubs/includefile.pyi +3 -3
  12. metaflow-stubs/metadata/metadata.pyi +2 -2
  13. metaflow-stubs/metadata/util.pyi +2 -2
  14. metaflow-stubs/metaflow_config.pyi +2 -2
  15. metaflow-stubs/metaflow_current.pyi +5 -5
  16. metaflow-stubs/mflog/mflog.pyi +2 -2
  17. metaflow-stubs/multicore_utils.pyi +2 -2
  18. metaflow-stubs/parameters.pyi +3 -3
  19. metaflow-stubs/plugins/__init__.pyi +3 -3
  20. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  21. metaflow-stubs/plugins/airflow/airflow.pyi +3 -3
  22. metaflow-stubs/plugins/airflow/airflow_cli.pyi +3 -3
  23. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  24. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  29. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  30. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  31. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  32. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
  34. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +4 -4
  35. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  36. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  37. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  38. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  39. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  44. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  45. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  46. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  47. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +4 -4
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  55. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  56. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  57. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  58. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  59. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  60. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  61. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  62. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  63. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  64. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
  67. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  76. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  80. metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
  81. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  82. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  83. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  84. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  85. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  86. metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
  87. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  88. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  89. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  90. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  91. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  92. metaflow-stubs/plugins/events_decorator.pyi +3 -3
  93. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  94. metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
  95. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  96. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  97. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  98. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  99. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  100. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  102. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +2 -2
  103. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  105. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  106. metaflow-stubs/plugins/package_cli.pyi +2 -2
  107. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/project_decorator.pyi +3 -3
  109. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  110. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  111. metaflow-stubs/plugins/pypi/conda_environment.pyi +2 -2
  112. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
  114. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  115. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  116. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  118. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  119. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  121. metaflow-stubs/plugins/tag_cli.pyi +4 -4
  122. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  123. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  124. metaflow-stubs/procpoll.pyi +2 -2
  125. metaflow-stubs/pylint_wrapper.pyi +2 -2
  126. metaflow-stubs/tagging_util.pyi +2 -2
  127. {ob_metaflow_stubs-2.11.4.1.dist-info → ob_metaflow_stubs-2.11.4.2.dist-info}/METADATA +2 -2
  128. ob_metaflow_stubs-2.11.4.2.dist-info/RECORD +131 -0
  129. ob_metaflow_stubs-2.11.4.1.dist-info/RECORD +0 -131
  130. {ob_metaflow_stubs-2.11.4.1.dist-info → ob_metaflow_stubs-2.11.4.2.dist-info}/WHEEL +0 -0
  131. {ob_metaflow_stubs-2.11.4.1.dist-info → ob_metaflow_stubs-2.11.4.2.dist-info}/top_level.txt +0 -0
@@ -1,23 +1,23 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.11.4.1 #
4
- # Generated on 2024-02-28T05:30:43.887672 #
3
+ # MF version: 2.11.4.2 #
4
+ # Generated on 2024-02-29T18:52:32.414352 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
+ import datetime
12
+ import metaflow.parameters
11
13
  import metaflow.plugins.datatools.s3.s3
12
- import metaflow.metaflow_current
13
- import io
14
14
  import metaflow.client.core
15
- import metaflow.parameters
16
- import metaflow.datastore.inputs
17
15
  import metaflow._vendor.click.types
18
- import datetime
16
+ import metaflow.datastore.inputs
17
+ import io
19
18
  import metaflow.events
20
19
  import typing
20
+ import metaflow.metaflow_current
21
21
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
22
22
  StepFlag = typing.NewType("StepFlag", bool)
23
23
 
@@ -726,194 +726,172 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
726
726
  ...
727
727
 
728
728
  @typing.overload
729
- 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]]]:
729
+ 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]]]:
730
730
  """
731
- Specifies environment variables to be set prior to the execution of a step.
731
+ Specifies secrets to be retrieved and injected as environment variables prior to
732
+ the execution of a step.
732
733
 
733
734
  Parameters
734
735
  ----------
735
- vars : Dict[str, str], default {}
736
- Dictionary of environment variables to set.
736
+ sources : List[Union[str, Dict[str, Any]]], default: []
737
+ List of secret specs, defining how the secrets are to be retrieved
737
738
  """
738
739
  ...
739
740
 
740
741
  @typing.overload
741
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
742
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
742
743
  ...
743
744
 
744
745
  @typing.overload
745
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
746
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
746
747
  ...
747
748
 
748
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
749
+ 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]]] = []):
749
750
  """
750
- Specifies environment variables to be set prior to the execution of a step.
751
+ Specifies secrets to be retrieved and injected as environment variables prior to
752
+ the execution of a step.
751
753
 
752
754
  Parameters
753
755
  ----------
754
- vars : Dict[str, str], default {}
755
- Dictionary of environment variables to set.
756
+ sources : List[Union[str, Dict[str, Any]]], default: []
757
+ List of secret specs, defining how the secrets are to be retrieved
756
758
  """
757
759
  ...
758
760
 
759
- def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, port: typing.Optional[int] = None, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
761
+ @typing.overload
762
+ 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]]]:
760
763
  """
761
- Specifies that this step should execute on Kubernetes.
764
+ Specifies the PyPI packages for the step.
765
+
766
+ Information in this decorator will augment any
767
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
768
+ you can use `@pypi_base` to set packages required by all
769
+ steps and use `@pypi` to specify step-specific overrides.
762
770
 
763
771
  Parameters
764
772
  ----------
765
- cpu : int, default 1
766
- Number of CPUs required for this step. If `@resources` is
767
- also present, the maximum value from all decorators is used.
768
- memory : int, default 4096
769
- Memory size (in MB) required for this step. If
770
- `@resources` is also present, the maximum value from all decorators is
771
- used.
772
- disk : int, default 10240
773
- Disk size (in MB) required for this step. If
774
- `@resources` is also present, the maximum value from all decorators is
775
- used.
776
- image : str, optional, default None
777
- Docker image to use when launching on Kubernetes. If not specified, and
778
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
779
- not, a default Docker image mapping to the current version of Python is used.
780
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
781
- If given, the imagePullPolicy to be applied to the Docker image of the step.
782
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
783
- Kubernetes service account to use when launching pod in Kubernetes.
784
- secrets : List[str], optional, default None
785
- Kubernetes secrets to use when launching pod in Kubernetes. These
786
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
787
- in Metaflow configuration.
788
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
789
- Kubernetes namespace to use when launching pod in Kubernetes.
790
- gpu : int, optional, default None
791
- Number of GPUs required for this step. A value of zero implies that
792
- the scheduled node should not have GPUs.
793
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
794
- The vendor of the GPUs to be used for this step.
795
- tolerations : List[str], default []
796
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
797
- Kubernetes tolerations to use when launching pod in Kubernetes.
798
- use_tmpfs : bool, default False
799
- This enables an explicit tmpfs mount for this step.
800
- tmpfs_tempdir : bool, default True
801
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
802
- tmpfs_size : int, optional, default: None
803
- The value for the size (in MiB) of the tmpfs mount for this step.
804
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
805
- memory allocated for this step.
806
- tmpfs_path : str, optional, default /metaflow_temp
807
- Path to tmpfs mount for this step.
808
- persistent_volume_claims : Dict[str, str], optional, default None
809
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
810
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
811
- port: int, optional
812
- Number of the port to specify in the Kubernetes job object
813
- shared_memory: int, optional
814
- Shared memory size (in MiB) required for this steps
773
+ packages : Dict[str, str], default: {}
774
+ Packages to use for this step. The key is the name of the package
775
+ and the value is the version to use.
776
+ python : str, optional, default: None
777
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
778
+ that the version used will correspond to the version of the Python interpreter used to start the run.
815
779
  """
816
780
  ...
817
781
 
818
782
  @typing.overload
819
- 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]]]:
783
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
784
+ ...
785
+
786
+ @typing.overload
787
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
788
+ ...
789
+
790
+ 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):
820
791
  """
821
- Specifies the number of times the task corresponding
822
- to a step needs to be retried.
792
+ Specifies the PyPI packages for the step.
823
793
 
824
- This decorator is useful for handling transient errors, such as networking issues.
825
- If your task contains operations that can't be retried safely, e.g. database updates,
826
- it is advisable to annotate it with `@retry(times=0)`.
794
+ Information in this decorator will augment any
795
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
796
+ you can use `@pypi_base` to set packages required by all
797
+ steps and use `@pypi` to specify step-specific overrides.
827
798
 
828
- This can be used in conjunction with the `@catch` decorator. The `@catch`
829
- decorator will execute a no-op task after all retries have been exhausted,
830
- ensuring that the flow execution can continue.
799
+ Parameters
800
+ ----------
801
+ packages : Dict[str, str], default: {}
802
+ Packages to use for this step. The key is the name of the package
803
+ and the value is the version to use.
804
+ python : str, optional, default: None
805
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
806
+ that the version used will correspond to the version of the Python interpreter used to start the run.
807
+ """
808
+ ...
809
+
810
+ @typing.overload
811
+ 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]]]:
812
+ """
813
+ Specifies environment variables to be set prior to the execution of a step.
831
814
 
832
815
  Parameters
833
816
  ----------
834
- times : int, default 3
835
- Number of times to retry this task.
836
- minutes_between_retries : int, default 2
837
- Number of minutes between retries.
817
+ vars : Dict[str, str], default {}
818
+ Dictionary of environment variables to set.
838
819
  """
839
820
  ...
840
821
 
841
822
  @typing.overload
842
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
823
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
843
824
  ...
844
825
 
845
826
  @typing.overload
846
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
827
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
847
828
  ...
848
829
 
849
- 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):
830
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
850
831
  """
851
- Specifies the number of times the task corresponding
852
- to a step needs to be retried.
853
-
854
- This decorator is useful for handling transient errors, such as networking issues.
855
- If your task contains operations that can't be retried safely, e.g. database updates,
856
- it is advisable to annotate it with `@retry(times=0)`.
857
-
858
- This can be used in conjunction with the `@catch` decorator. The `@catch`
859
- decorator will execute a no-op task after all retries have been exhausted,
860
- ensuring that the flow execution can continue.
832
+ Specifies environment variables to be set prior to the execution of a step.
861
833
 
862
834
  Parameters
863
835
  ----------
864
- times : int, default 3
865
- Number of times to retry this task.
866
- minutes_between_retries : int, default 2
867
- Number of minutes between retries.
836
+ vars : Dict[str, str], default {}
837
+ Dictionary of environment variables to set.
868
838
  """
869
839
  ...
870
840
 
871
841
  @typing.overload
872
- 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]]]:
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]]]:
873
843
  """
874
- Specifies the PyPI packages for the step.
844
+ Specifies a timeout for your step.
875
845
 
876
- Information in this decorator will augment any
877
- attributes set in the `@pyi_base` flow-level decorator. Hence,
878
- you can use `@pypi_base` to set packages required by all
879
- steps and use `@pypi` to specify step-specific overrides.
846
+ This decorator is useful if this step may hang indefinitely.
847
+
848
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
849
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
850
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
851
+
852
+ Note that all the values specified in parameters are added together so if you specify
853
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
880
854
 
881
855
  Parameters
882
856
  ----------
883
- packages : Dict[str, str], default: {}
884
- Packages to use for this step. The key is the name of the package
885
- and the value is the version to use.
886
- python : str, optional, default: None
887
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
888
- that the version used will correspond to the version of the Python interpreter used to start the run.
857
+ seconds : int, default 0
858
+ Number of seconds to wait prior to timing out.
859
+ minutes : int, default 0
860
+ Number of minutes to wait prior to timing out.
861
+ hours : int, default 0
862
+ Number of hours to wait prior to timing out.
889
863
  """
890
864
  ...
891
865
 
892
866
  @typing.overload
893
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
867
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
894
868
  ...
895
869
 
896
870
  @typing.overload
897
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
871
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
898
872
  ...
899
873
 
900
- 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):
874
+ 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):
901
875
  """
902
- Specifies the PyPI packages for the step.
876
+ Specifies a timeout for your step.
903
877
 
904
- Information in this decorator will augment any
905
- attributes set in the `@pyi_base` flow-level decorator. Hence,
906
- you can use `@pypi_base` to set packages required by all
907
- steps and use `@pypi` to specify step-specific overrides.
878
+ This decorator is useful if this step may hang indefinitely.
879
+
880
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
881
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
882
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
883
+
884
+ Note that all the values specified in parameters are added together so if you specify
885
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
908
886
 
909
887
  Parameters
910
888
  ----------
911
- packages : Dict[str, str], default: {}
912
- Packages to use for this step. The key is the name of the package
913
- and the value is the version to use.
914
- python : str, optional, default: None
915
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
916
- that the version used will correspond to the version of the Python interpreter used to start the run.
889
+ seconds : int, default 0
890
+ Number of seconds to wait prior to timing out.
891
+ minutes : int, default 0
892
+ Number of minutes to wait prior to timing out.
893
+ hours : int, default 0
894
+ Number of hours to wait prior to timing out.
917
895
  """
918
896
  ...
919
897
 
@@ -969,51 +947,55 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
969
947
  ...
970
948
 
971
949
  @typing.overload
972
- 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]]]:
950
+ 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]]]:
973
951
  """
974
- Specifies that the step will success under all circumstances.
952
+ Specifies the number of times the task corresponding
953
+ to a step needs to be retried.
975
954
 
976
- The decorator will create an optional artifact, specified by `var`, which
977
- contains the exception raised. You can use it to detect the presence
978
- of errors, indicating that all happy-path artifacts produced by the step
979
- are missing.
955
+ This decorator is useful for handling transient errors, such as networking issues.
956
+ If your task contains operations that can't be retried safely, e.g. database updates,
957
+ it is advisable to annotate it with `@retry(times=0)`.
958
+
959
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
960
+ decorator will execute a no-op task after all retries have been exhausted,
961
+ ensuring that the flow execution can continue.
980
962
 
981
963
  Parameters
982
964
  ----------
983
- var : str, optional, default None
984
- Name of the artifact in which to store the caught exception.
985
- If not specified, the exception is not stored.
986
- print_exception : bool, default True
987
- Determines whether or not the exception is printed to
988
- stdout when caught.
965
+ times : int, default 3
966
+ Number of times to retry this task.
967
+ minutes_between_retries : int, default 2
968
+ Number of minutes between retries.
989
969
  """
990
970
  ...
991
971
 
992
972
  @typing.overload
993
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
973
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
994
974
  ...
995
975
 
996
976
  @typing.overload
997
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
977
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
998
978
  ...
999
979
 
1000
- 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):
980
+ 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):
1001
981
  """
1002
- Specifies that the step will success under all circumstances.
982
+ Specifies the number of times the task corresponding
983
+ to a step needs to be retried.
1003
984
 
1004
- The decorator will create an optional artifact, specified by `var`, which
1005
- contains the exception raised. You can use it to detect the presence
1006
- of errors, indicating that all happy-path artifacts produced by the step
1007
- are missing.
985
+ This decorator is useful for handling transient errors, such as networking issues.
986
+ If your task contains operations that can't be retried safely, e.g. database updates,
987
+ it is advisable to annotate it with `@retry(times=0)`.
988
+
989
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
990
+ decorator will execute a no-op task after all retries have been exhausted,
991
+ ensuring that the flow execution can continue.
1008
992
 
1009
993
  Parameters
1010
994
  ----------
1011
- var : str, optional, default None
1012
- Name of the artifact in which to store the caught exception.
1013
- If not specified, the exception is not stored.
1014
- print_exception : bool, default True
1015
- Determines whether or not the exception is printed to
1016
- stdout when caught.
995
+ times : int, default 3
996
+ Number of times to retry this task.
997
+ minutes_between_retries : int, default 2
998
+ Number of minutes between retries.
1017
999
  """
1018
1000
  ...
1019
1001
 
@@ -1094,60 +1076,62 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1094
1076
  """
1095
1077
  ...
1096
1078
 
1097
- @typing.overload
1098
- 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]]]:
1099
- """
1100
- Specifies a timeout for your step.
1101
-
1102
- This decorator is useful if this step may hang indefinitely.
1103
-
1104
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1105
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1106
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1107
-
1108
- Note that all the values specified in parameters are added together so if you specify
1109
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1110
-
1111
- Parameters
1112
- ----------
1113
- seconds : int, default 0
1114
- Number of seconds to wait prior to timing out.
1115
- minutes : int, default 0
1116
- Number of minutes to wait prior to timing out.
1117
- hours : int, default 0
1118
- Number of hours to wait prior to timing out.
1119
- """
1120
- ...
1121
-
1122
- @typing.overload
1123
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1124
- ...
1125
-
1126
- @typing.overload
1127
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1128
- ...
1129
-
1130
- 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):
1079
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, port: typing.Optional[int] = None, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1131
1080
  """
1132
- Specifies a timeout for your step.
1133
-
1134
- This decorator is useful if this step may hang indefinitely.
1135
-
1136
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1137
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1138
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1139
-
1140
- Note that all the values specified in parameters are added together so if you specify
1141
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1081
+ Specifies that this step should execute on Kubernetes.
1142
1082
 
1143
1083
  Parameters
1144
1084
  ----------
1145
- seconds : int, default 0
1146
- Number of seconds to wait prior to timing out.
1147
- minutes : int, default 0
1148
- Number of minutes to wait prior to timing out.
1149
- hours : int, default 0
1150
- Number of hours to wait prior to timing out.
1085
+ cpu : int, default 1
1086
+ Number of CPUs required for this step. If `@resources` is
1087
+ also present, the maximum value from all decorators is used.
1088
+ memory : int, default 4096
1089
+ Memory size (in MB) required for this step. If
1090
+ `@resources` is also present, the maximum value from all decorators is
1091
+ used.
1092
+ disk : int, default 10240
1093
+ Disk size (in MB) required for this step. If
1094
+ `@resources` is also present, the maximum value from all decorators is
1095
+ used.
1096
+ image : str, optional, default None
1097
+ Docker image to use when launching on Kubernetes. If not specified, and
1098
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1099
+ not, a default Docker image mapping to the current version of Python is used.
1100
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1101
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
1102
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1103
+ Kubernetes service account to use when launching pod in Kubernetes.
1104
+ secrets : List[str], optional, default None
1105
+ Kubernetes secrets to use when launching pod in Kubernetes. These
1106
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1107
+ in Metaflow configuration.
1108
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1109
+ Kubernetes namespace to use when launching pod in Kubernetes.
1110
+ gpu : int, optional, default None
1111
+ Number of GPUs required for this step. A value of zero implies that
1112
+ the scheduled node should not have GPUs.
1113
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1114
+ The vendor of the GPUs to be used for this step.
1115
+ tolerations : List[str], default []
1116
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1117
+ Kubernetes tolerations to use when launching pod in Kubernetes.
1118
+ use_tmpfs : bool, default False
1119
+ This enables an explicit tmpfs mount for this step.
1120
+ tmpfs_tempdir : bool, default True
1121
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1122
+ tmpfs_size : int, optional, default: None
1123
+ The value for the size (in MiB) of the tmpfs mount for this step.
1124
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1125
+ memory allocated for this step.
1126
+ tmpfs_path : str, optional, default /metaflow_temp
1127
+ Path to tmpfs mount for this step.
1128
+ persistent_volume_claims : Dict[str, str], optional, default None
1129
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1130
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1131
+ port: int, optional
1132
+ Number of the port to specify in the Kubernetes job object
1133
+ shared_memory: int, optional
1134
+ Shared memory size (in MiB) required for this steps
1151
1135
  """
1152
1136
  ...
1153
1137
 
@@ -1208,6 +1192,55 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1208
1192
  """
1209
1193
  ...
1210
1194
 
1195
+ @typing.overload
1196
+ 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]]]:
1197
+ """
1198
+ Specifies that the step will success under all circumstances.
1199
+
1200
+ The decorator will create an optional artifact, specified by `var`, which
1201
+ contains the exception raised. You can use it to detect the presence
1202
+ of errors, indicating that all happy-path artifacts produced by the step
1203
+ are missing.
1204
+
1205
+ Parameters
1206
+ ----------
1207
+ var : str, optional, default None
1208
+ Name of the artifact in which to store the caught exception.
1209
+ If not specified, the exception is not stored.
1210
+ print_exception : bool, default True
1211
+ Determines whether or not the exception is printed to
1212
+ stdout when caught.
1213
+ """
1214
+ ...
1215
+
1216
+ @typing.overload
1217
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1218
+ ...
1219
+
1220
+ @typing.overload
1221
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1222
+ ...
1223
+
1224
+ 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):
1225
+ """
1226
+ Specifies that the step will success under all circumstances.
1227
+
1228
+ The decorator will create an optional artifact, specified by `var`, which
1229
+ contains the exception raised. You can use it to detect the presence
1230
+ of errors, indicating that all happy-path artifacts produced by the step
1231
+ are missing.
1232
+
1233
+ Parameters
1234
+ ----------
1235
+ var : str, optional, default None
1236
+ Name of the artifact in which to store the caught exception.
1237
+ If not specified, the exception is not stored.
1238
+ print_exception : bool, default True
1239
+ Determines whether or not the exception is printed to
1240
+ stdout when caught.
1241
+ """
1242
+ ...
1243
+
1211
1244
  @typing.overload
1212
1245
  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, efa: 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]]]:
1213
1246
  """
@@ -1332,35 +1365,93 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1332
1365
  ...
1333
1366
 
1334
1367
  @typing.overload
1335
- 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]]]:
1368
+ 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]]:
1336
1369
  """
1337
- Specifies secrets to be retrieved and injected as environment variables prior to
1338
- the execution of a step.
1370
+ Specifies the Conda environment for all steps of the flow.
1371
+
1372
+ Use `@conda_base` to set common libraries required by all
1373
+ steps and use `@conda` to specify step-specific additions.
1339
1374
 
1340
1375
  Parameters
1341
1376
  ----------
1342
- sources : List[Union[str, Dict[str, Any]]], default: []
1343
- List of secret specs, defining how the secrets are to be retrieved
1377
+ packages : Dict[str, str], default {}
1378
+ Packages to use for this flow. The key is the name of the package
1379
+ and the value is the version to use.
1380
+ libraries : Dict[str, str], default {}
1381
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1382
+ python : str, optional, default None
1383
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1384
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1385
+ disabled : bool, default False
1386
+ If set to True, disables Conda.
1344
1387
  """
1345
1388
  ...
1346
1389
 
1347
1390
  @typing.overload
1348
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1391
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1349
1392
  ...
1350
1393
 
1351
- @typing.overload
1352
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1394
+ 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):
1395
+ """
1396
+ Specifies the Conda environment for all steps of the flow.
1397
+
1398
+ Use `@conda_base` to set common libraries required by all
1399
+ steps and use `@conda` to specify step-specific additions.
1400
+
1401
+ Parameters
1402
+ ----------
1403
+ packages : Dict[str, str], default {}
1404
+ Packages to use for this flow. The key is the name of the package
1405
+ and the value is the version to use.
1406
+ libraries : Dict[str, str], default {}
1407
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1408
+ python : str, optional, default None
1409
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1410
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1411
+ disabled : bool, default False
1412
+ If set to True, disables Conda.
1413
+ """
1353
1414
  ...
1354
1415
 
1355
- 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]]] = []):
1416
+ 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]]:
1356
1417
  """
1357
- Specifies secrets to be retrieved and injected as environment variables prior to
1358
- the execution of a step.
1418
+ 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)
1419
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1420
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1421
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1422
+ starts only after all sensors finish.
1359
1423
 
1360
1424
  Parameters
1361
1425
  ----------
1362
- sources : List[Union[str, Dict[str, Any]]], default: []
1363
- List of secret specs, defining how the secrets are to be retrieved
1426
+ timeout : int
1427
+ Time, in seconds before the task times out and fails. (Default: 3600)
1428
+ poke_interval : int
1429
+ Time in seconds that the job should wait in between each try. (Default: 60)
1430
+ mode : str
1431
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1432
+ exponential_backoff : bool
1433
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1434
+ pool : str
1435
+ the slot pool this task should run in,
1436
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1437
+ soft_fail : bool
1438
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1439
+ name : str
1440
+ Name of the sensor on Airflow
1441
+ description : str
1442
+ Description of sensor in the Airflow UI
1443
+ bucket_key : Union[str, List[str]]
1444
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1445
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1446
+ bucket_name : str
1447
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1448
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1449
+ wildcard_match : bool
1450
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1451
+ aws_conn_id : str
1452
+ a reference to the s3 connection on Airflow. (Default: None)
1453
+ verify : bool
1454
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1364
1455
  """
1365
1456
  ...
1366
1457
 
@@ -1459,6 +1550,45 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1459
1550
  """
1460
1551
  ...
1461
1552
 
1553
+ @typing.overload
1554
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1555
+ """
1556
+ Specifies the PyPI packages for all steps of the flow.
1557
+
1558
+ Use `@pypi_base` to set common packages required by all
1559
+ steps and use `@pypi` to specify step-specific overrides.
1560
+ Parameters
1561
+ ----------
1562
+ packages : Dict[str, str], default: {}
1563
+ Packages to use for this flow. The key is the name of the package
1564
+ and the value is the version to use.
1565
+ python : str, optional, default: None
1566
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1567
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1568
+ """
1569
+ ...
1570
+
1571
+ @typing.overload
1572
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1573
+ ...
1574
+
1575
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1576
+ """
1577
+ Specifies the PyPI packages for all steps of the flow.
1578
+
1579
+ Use `@pypi_base` to set common packages required by all
1580
+ steps and use `@pypi` to specify step-specific overrides.
1581
+ Parameters
1582
+ ----------
1583
+ packages : Dict[str, str], default: {}
1584
+ Packages to use for this flow. The key is the name of the package
1585
+ and the value is the version to use.
1586
+ python : str, optional, default: None
1587
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1588
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1589
+ """
1590
+ ...
1591
+
1462
1592
  def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1463
1593
  """
1464
1594
  The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
@@ -1622,97 +1752,6 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
1622
1752
  """
1623
1753
  ...
1624
1754
 
1625
- 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]]:
1626
- """
1627
- 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)
1628
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1629
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1630
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1631
- starts only after all sensors finish.
1632
-
1633
- Parameters
1634
- ----------
1635
- timeout : int
1636
- Time, in seconds before the task times out and fails. (Default: 3600)
1637
- poke_interval : int
1638
- Time in seconds that the job should wait in between each try. (Default: 60)
1639
- mode : str
1640
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1641
- exponential_backoff : bool
1642
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1643
- pool : str
1644
- the slot pool this task should run in,
1645
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1646
- soft_fail : bool
1647
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1648
- name : str
1649
- Name of the sensor on Airflow
1650
- description : str
1651
- Description of sensor in the Airflow UI
1652
- bucket_key : Union[str, List[str]]
1653
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1654
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1655
- bucket_name : str
1656
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1657
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1658
- wildcard_match : bool
1659
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1660
- aws_conn_id : str
1661
- a reference to the s3 connection on Airflow. (Default: None)
1662
- verify : bool
1663
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1664
- """
1665
- ...
1666
-
1667
- @typing.overload
1668
- 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]]:
1669
- """
1670
- Specifies the Conda environment for all steps of the flow.
1671
-
1672
- Use `@conda_base` to set common libraries required by all
1673
- steps and use `@conda` to specify step-specific additions.
1674
-
1675
- Parameters
1676
- ----------
1677
- packages : Dict[str, str], default {}
1678
- Packages to use for this flow. The key is the name of the package
1679
- and the value is the version to use.
1680
- libraries : Dict[str, str], default {}
1681
- Supported for backward compatibility. When used with packages, packages will take precedence.
1682
- python : str, optional, default None
1683
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1684
- that the version used will correspond to the version of the Python interpreter used to start the run.
1685
- disabled : bool, default False
1686
- If set to True, disables Conda.
1687
- """
1688
- ...
1689
-
1690
- @typing.overload
1691
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1692
- ...
1693
-
1694
- 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):
1695
- """
1696
- Specifies the Conda environment for all steps of the flow.
1697
-
1698
- Use `@conda_base` to set common libraries required by all
1699
- steps and use `@conda` to specify step-specific additions.
1700
-
1701
- Parameters
1702
- ----------
1703
- packages : Dict[str, str], default {}
1704
- Packages to use for this flow. The key is the name of the package
1705
- and the value is the version to use.
1706
- libraries : Dict[str, str], default {}
1707
- Supported for backward compatibility. When used with packages, packages will take precedence.
1708
- python : str, optional, default None
1709
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1710
- that the version used will correspond to the version of the Python interpreter used to start the run.
1711
- disabled : bool, default False
1712
- If set to True, disables Conda.
1713
- """
1714
- ...
1715
-
1716
1755
  @typing.overload
1717
1756
  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]]:
1718
1757
  """
@@ -1762,45 +1801,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1762
1801
  """
1763
1802
  ...
1764
1803
 
1765
- @typing.overload
1766
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1767
- """
1768
- Specifies the PyPI packages for all steps of the flow.
1769
-
1770
- Use `@pypi_base` to set common packages required by all
1771
- steps and use `@pypi` to specify step-specific overrides.
1772
- Parameters
1773
- ----------
1774
- packages : Dict[str, str], default: {}
1775
- Packages to use for this flow. The key is the name of the package
1776
- and the value is the version to use.
1777
- python : str, optional, default: None
1778
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1779
- that the version used will correspond to the version of the Python interpreter used to start the run.
1780
- """
1781
- ...
1782
-
1783
- @typing.overload
1784
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1785
- ...
1786
-
1787
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1788
- """
1789
- Specifies the PyPI packages for all steps of the flow.
1790
-
1791
- Use `@pypi_base` to set common packages required by all
1792
- steps and use `@pypi` to specify step-specific overrides.
1793
- Parameters
1794
- ----------
1795
- packages : Dict[str, str], default: {}
1796
- Packages to use for this flow. The key is the name of the package
1797
- and the value is the version to use.
1798
- python : str, optional, default: None
1799
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1800
- that the version used will correspond to the version of the Python interpreter used to start the run.
1801
- """
1802
- ...
1803
-
1804
1804
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1805
1805
  """
1806
1806
  Switch namespace to the one provided.