ob-metaflow-stubs 4.5__py2.py3-none-any.whl → 4.6__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 (145) hide show
  1. metaflow-stubs/__init__.pyi +435 -435
  2. metaflow-stubs/cards.pyi +2 -2
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +5 -5
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +1 -1
  8. metaflow-stubs/events.pyi +1 -1
  9. metaflow-stubs/exception.pyi +1 -1
  10. metaflow-stubs/flowspec.pyi +4 -4
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +3 -3
  13. metaflow-stubs/metadata/metadata.pyi +2 -2
  14. metaflow-stubs/metadata/util.pyi +1 -1
  15. metaflow-stubs/metaflow_config.pyi +1 -1
  16. metaflow-stubs/metaflow_current.pyi +17 -17
  17. metaflow-stubs/mflog/mflog.pyi +1 -1
  18. metaflow-stubs/multicore_utils.pyi +1 -1
  19. metaflow-stubs/parameters.pyi +2 -2
  20. metaflow-stubs/plugins/__init__.pyi +1 -1
  21. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  22. metaflow-stubs/plugins/airflow/airflow.pyi +2 -2
  23. metaflow-stubs/plugins/airflow/airflow_cli.pyi +2 -2
  24. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +1 -1
  25. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  26. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  27. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  28. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
  29. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +1 -1
  30. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +1 -1
  31. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  32. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  33. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  34. metaflow-stubs/plugins/argo/argo_workflows.pyi +2 -2
  35. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +3 -3
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  37. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  38. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  39. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  40. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  41. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  42. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +1 -1
  43. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  44. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  45. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  46. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
  47. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  48. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +1 -1
  49. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  50. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +1 -1
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +3 -3
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +1 -1
  56. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  57. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  58. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  59. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  61. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  62. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  63. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  64. metaflow-stubs/plugins/cards/card_cli.pyi +3 -3
  65. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  66. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  67. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  68. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  70. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  71. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  72. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +1 -1
  73. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +1 -1
  74. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +1 -1
  75. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +1 -1
  76. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +1 -1
  77. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  78. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  79. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  80. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  81. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  82. metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
  83. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  84. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  85. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  86. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  87. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  88. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  89. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  90. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  91. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  92. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  93. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  94. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  95. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  96. metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
  97. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  98. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
  99. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  100. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  101. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  102. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  103. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  104. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  105. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +1 -1
  106. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  107. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  109. metaflow-stubs/plugins/logs_cli.pyi +2 -2
  110. metaflow-stubs/plugins/package_cli.pyi +1 -1
  111. metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
  112. metaflow-stubs/plugins/perimeters.pyi +3 -1
  113. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  114. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  115. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  116. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  117. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  118. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  119. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  120. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  121. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  122. metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
  123. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  124. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  125. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  126. metaflow-stubs/plugins/tag_cli.pyi +3 -3
  127. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  128. metaflow-stubs/plugins/timeout_decorator.pyi +1 -1
  129. metaflow-stubs/procpoll.pyi +1 -1
  130. metaflow-stubs/profilers/__init__.pyi +1 -1
  131. metaflow-stubs/pylint_wrapper.pyi +1 -1
  132. metaflow-stubs/runner/__init__.pyi +1 -1
  133. metaflow-stubs/runner/metaflow_runner.pyi +2 -2
  134. metaflow-stubs/runner/nbrun.pyi +1 -1
  135. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  136. metaflow-stubs/system/__init__.pyi +1 -1
  137. metaflow-stubs/system/system_logger.pyi +1 -1
  138. metaflow-stubs/system/system_monitor.pyi +1 -1
  139. metaflow-stubs/tagging_util.pyi +1 -1
  140. metaflow-stubs/tuple_util.pyi +1 -1
  141. {ob_metaflow_stubs-4.5.dist-info → ob_metaflow_stubs-4.6.dist-info}/METADATA +1 -1
  142. ob_metaflow_stubs-4.6.dist-info/RECORD +145 -0
  143. ob_metaflow_stubs-4.5.dist-info/RECORD +0 -145
  144. {ob_metaflow_stubs-4.5.dist-info → ob_metaflow_stubs-4.6.dist-info}/WHEEL +0 -0
  145. {ob_metaflow_stubs-4.5.dist-info → ob_metaflow_stubs-4.6.dist-info}/top_level.txt +0 -0
@@ -1,25 +1,25 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.7.1+ob(v1) #
4
- # Generated on 2024-07-12T00:19:39.735632 #
4
+ # Generated on 2024-07-12T16:22:02.506423 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
+ import metaflow.metaflow_current
11
12
  import metaflow.flowspec
12
- import metaflow.plugins.datatools.s3.s3
13
13
  import typing
14
- import metaflow.events
15
- import metaflow.metaflow_current
16
14
  import metaflow.client.core
17
15
  import metaflow.runner.metaflow_runner
18
- import metaflow._vendor.click.types
19
- import metaflow.datastore.inputs
20
- import datetime
21
16
  import io
22
17
  import metaflow.parameters
18
+ import datetime
19
+ import metaflow._vendor.click.types
20
+ import metaflow.plugins.datatools.s3.s3
21
+ import metaflow.events
22
+ import metaflow.datastore.inputs
23
23
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
24
24
  StepFlag = typing.NewType("StepFlag", bool)
25
25
 
@@ -727,86 +727,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
727
727
  """
728
728
  ...
729
729
 
730
- @typing.overload
731
- def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
732
- """
733
- Specifies that the step will success under all circumstances.
734
-
735
- The decorator will create an optional artifact, specified by `var`, which
736
- contains the exception raised. You can use it to detect the presence
737
- of errors, indicating that all happy-path artifacts produced by the step
738
- are missing.
739
-
740
- Parameters
741
- ----------
742
- var : str, optional, default None
743
- Name of the artifact in which to store the caught exception.
744
- If not specified, the exception is not stored.
745
- print_exception : bool, default True
746
- Determines whether or not the exception is printed to
747
- stdout when caught.
748
- """
749
- ...
750
-
751
- @typing.overload
752
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
753
- ...
754
-
755
- @typing.overload
756
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
757
- ...
758
-
759
- def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
760
- """
761
- Specifies that the step will success under all circumstances.
762
-
763
- The decorator will create an optional artifact, specified by `var`, which
764
- contains the exception raised. You can use it to detect the presence
765
- of errors, indicating that all happy-path artifacts produced by the step
766
- are missing.
767
-
768
- Parameters
769
- ----------
770
- var : str, optional, default None
771
- Name of the artifact in which to store the caught exception.
772
- If not specified, the exception is not stored.
773
- print_exception : bool, default True
774
- Determines whether or not the exception is printed to
775
- stdout when caught.
776
- """
777
- ...
778
-
779
- @typing.overload
780
- 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]]]:
781
- """
782
- Specifies environment variables to be set prior to the execution of a step.
783
-
784
- Parameters
785
- ----------
786
- vars : Dict[str, str], default {}
787
- Dictionary of environment variables to set.
788
- """
789
- ...
790
-
791
- @typing.overload
792
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
793
- ...
794
-
795
- @typing.overload
796
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
797
- ...
798
-
799
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
800
- """
801
- Specifies environment variables to be set prior to the execution of a step.
802
-
803
- Parameters
804
- ----------
805
- vars : Dict[str, str], default {}
806
- Dictionary of environment variables to set.
807
- """
808
- ...
809
-
810
730
  @typing.overload
811
731
  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]]]:
812
732
  """
@@ -841,79 +761,51 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
841
761
  ...
842
762
 
843
763
  @typing.overload
844
- 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]]]:
764
+ 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]]]:
845
765
  """
846
- Specifies the resources needed when executing this step.
847
-
848
- Use `@resources` to specify the resource requirements
849
- independently of the specific compute layer (`@batch`, `@kubernetes`).
766
+ Specifies that the step will success under all circumstances.
850
767
 
851
- You can choose the compute layer on the command line by executing e.g.
852
- ```
853
- python myflow.py run --with batch
854
- ```
855
- or
856
- ```
857
- python myflow.py run --with kubernetes
858
- ```
859
- which executes the flow on the desired system using the
860
- requirements specified in `@resources`.
768
+ The decorator will create an optional artifact, specified by `var`, which
769
+ contains the exception raised. You can use it to detect the presence
770
+ of errors, indicating that all happy-path artifacts produced by the step
771
+ are missing.
861
772
 
862
773
  Parameters
863
774
  ----------
864
- cpu : int, default 1
865
- Number of CPUs required for this step.
866
- gpu : int, default 0
867
- Number of GPUs required for this step.
868
- disk : int, optional, default None
869
- Disk size (in MB) required for this step. Only applies on Kubernetes.
870
- memory : int, default 4096
871
- Memory size (in MB) required for this step.
872
- shared_memory : int, optional, default None
873
- The value for the size (in MiB) of the /dev/shm volume for this step.
874
- This parameter maps to the `--shm-size` option in Docker.
775
+ var : str, optional, default None
776
+ Name of the artifact in which to store the caught exception.
777
+ If not specified, the exception is not stored.
778
+ print_exception : bool, default True
779
+ Determines whether or not the exception is printed to
780
+ stdout when caught.
875
781
  """
876
782
  ...
877
783
 
878
784
  @typing.overload
879
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
785
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
880
786
  ...
881
787
 
882
788
  @typing.overload
883
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
789
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
884
790
  ...
885
791
 
886
- 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):
792
+ 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):
887
793
  """
888
- Specifies the resources needed when executing this step.
889
-
890
- Use `@resources` to specify the resource requirements
891
- independently of the specific compute layer (`@batch`, `@kubernetes`).
794
+ Specifies that the step will success under all circumstances.
892
795
 
893
- You can choose the compute layer on the command line by executing e.g.
894
- ```
895
- python myflow.py run --with batch
896
- ```
897
- or
898
- ```
899
- python myflow.py run --with kubernetes
900
- ```
901
- which executes the flow on the desired system using the
902
- requirements specified in `@resources`.
796
+ The decorator will create an optional artifact, specified by `var`, which
797
+ contains the exception raised. You can use it to detect the presence
798
+ of errors, indicating that all happy-path artifacts produced by the step
799
+ are missing.
903
800
 
904
801
  Parameters
905
802
  ----------
906
- cpu : int, default 1
907
- Number of CPUs required for this step.
908
- gpu : int, default 0
909
- Number of GPUs required for this step.
910
- disk : int, optional, default None
911
- Disk size (in MB) required for this step. Only applies on Kubernetes.
912
- memory : int, default 4096
913
- Memory size (in MB) required for this step.
914
- shared_memory : int, optional, default None
915
- The value for the size (in MiB) of the /dev/shm volume for this step.
916
- This parameter maps to the `--shm-size` option in Docker.
803
+ var : str, optional, default None
804
+ Name of the artifact in which to store the caught exception.
805
+ If not specified, the exception is not stored.
806
+ print_exception : bool, default True
807
+ Determines whether or not the exception is printed to
808
+ stdout when caught.
917
809
  """
918
810
  ...
919
811
 
@@ -969,85 +861,120 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
969
861
  ...
970
862
 
971
863
  @typing.overload
972
- 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]]]:
864
+ 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
865
  """
974
- Specifies the PyPI packages for the step.
866
+ Specifies the number of times the task corresponding
867
+ to a step needs to be retried.
975
868
 
976
- Information in this decorator will augment any
977
- attributes set in the `@pyi_base` flow-level decorator. Hence,
978
- you can use `@pypi_base` to set packages required by all
979
- steps and use `@pypi` to specify step-specific overrides.
869
+ This decorator is useful for handling transient errors, such as networking issues.
870
+ If your task contains operations that can't be retried safely, e.g. database updates,
871
+ it is advisable to annotate it with `@retry(times=0)`.
872
+
873
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
874
+ decorator will execute a no-op task after all retries have been exhausted,
875
+ ensuring that the flow execution can continue.
980
876
 
981
877
  Parameters
982
878
  ----------
983
- packages : Dict[str, str], default: {}
984
- Packages to use for this step. The key is the name of the package
985
- and the value is the version to use.
986
- python : str, optional, default: None
987
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
988
- that the version used will correspond to the version of the Python interpreter used to start the run.
879
+ times : int, default 3
880
+ Number of times to retry this task.
881
+ minutes_between_retries : int, default 2
882
+ Number of minutes between retries.
989
883
  """
990
884
  ...
991
885
 
992
886
  @typing.overload
993
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
887
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
994
888
  ...
995
889
 
996
890
  @typing.overload
997
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
891
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
998
892
  ...
999
893
 
1000
- 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):
894
+ 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
895
  """
1002
- Specifies the PyPI packages for the step.
896
+ Specifies the number of times the task corresponding
897
+ to a step needs to be retried.
1003
898
 
1004
- Information in this decorator will augment any
1005
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1006
- you can use `@pypi_base` to set packages required by all
1007
- steps and use `@pypi` to specify step-specific overrides.
899
+ This decorator is useful for handling transient errors, such as networking issues.
900
+ If your task contains operations that can't be retried safely, e.g. database updates,
901
+ it is advisable to annotate it with `@retry(times=0)`.
902
+
903
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
904
+ decorator will execute a no-op task after all retries have been exhausted,
905
+ ensuring that the flow execution can continue.
1008
906
 
1009
907
  Parameters
1010
908
  ----------
1011
- packages : Dict[str, str], default: {}
1012
- Packages to use for this step. The key is the name of the package
1013
- and the value is the version to use.
1014
- python : str, optional, default: None
1015
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1016
- that the version used will correspond to the version of the Python interpreter used to start the run.
909
+ times : int, default 3
910
+ Number of times to retry this task.
911
+ minutes_between_retries : int, default 2
912
+ Number of minutes between retries.
1017
913
  """
1018
914
  ...
1019
915
 
1020
916
  @typing.overload
1021
- def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = "METAFLOW_BATCH_JOB_QUEUE", iam_role: str = "METAFLOW_ECS_S3_ACCESS_IAM_ROLE", execution_role: str = "METAFLOW_ECS_FARGATE_EXECUTION_ROLE", shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
917
+ 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]]]:
1022
918
  """
1023
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
919
+ Specifies environment variables to be set prior to the execution of a step.
1024
920
 
1025
921
  Parameters
1026
922
  ----------
1027
- cpu : int, default 1
1028
- Number of CPUs required for this step. If `@resources` is
1029
- also present, the maximum value from all decorators is used.
1030
- gpu : int, default 0
1031
- Number of GPUs required for this step. If `@resources` is
1032
- also present, the maximum value from all decorators is used.
1033
- memory : int, default 4096
1034
- Memory size (in MB) required for this step. If
1035
- `@resources` is also present, the maximum value from all decorators is
1036
- used.
1037
- image : str, optional, default None
1038
- Docker image to use when launching on AWS Batch. If not specified, and
1039
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
1040
- not, a default Docker image mapping to the current version of Python is used.
1041
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
1042
- AWS Batch Job Queue to submit the job to.
1043
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
1044
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
1045
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
1046
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
1047
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
1048
- shared_memory : int, optional, default None
1049
- The value for the size (in MiB) of the /dev/shm volume for this step.
1050
- This parameter maps to the `--shm-size` option in Docker.
923
+ vars : Dict[str, str], default {}
924
+ Dictionary of environment variables to set.
925
+ """
926
+ ...
927
+
928
+ @typing.overload
929
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
930
+ ...
931
+
932
+ @typing.overload
933
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
934
+ ...
935
+
936
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
937
+ """
938
+ Specifies environment variables to be set prior to the execution of a step.
939
+
940
+ Parameters
941
+ ----------
942
+ vars : Dict[str, str], default {}
943
+ Dictionary of environment variables to set.
944
+ """
945
+ ...
946
+
947
+ @typing.overload
948
+ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optional[str] = None, queue: str = "METAFLOW_BATCH_JOB_QUEUE", iam_role: str = "METAFLOW_ECS_S3_ACCESS_IAM_ROLE", execution_role: str = "METAFLOW_ECS_FARGATE_EXECUTION_ROLE", shared_memory: typing.Optional[int] = None, max_swap: typing.Optional[int] = None, swappiness: typing.Optional[int] = None, use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = None, inferentia: int = 0, trainium: int = None, efa: int = 0, ephemeral_storage: int = None, log_driver: typing.Optional[str] = None, log_options: typing.Optional[typing.List[str]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
949
+ """
950
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
951
+
952
+ Parameters
953
+ ----------
954
+ cpu : int, default 1
955
+ Number of CPUs required for this step. If `@resources` is
956
+ also present, the maximum value from all decorators is used.
957
+ gpu : int, default 0
958
+ Number of GPUs required for this step. If `@resources` is
959
+ also present, the maximum value from all decorators is used.
960
+ memory : int, default 4096
961
+ Memory size (in MB) required for this step. If
962
+ `@resources` is also present, the maximum value from all decorators is
963
+ used.
964
+ image : str, optional, default None
965
+ Docker image to use when launching on AWS Batch. If not specified, and
966
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
967
+ not, a default Docker image mapping to the current version of Python is used.
968
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
969
+ AWS Batch Job Queue to submit the job to.
970
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
971
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
972
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
973
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
974
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
975
+ shared_memory : int, optional, default None
976
+ The value for the size (in MiB) of the /dev/shm volume for this step.
977
+ This parameter maps to the `--shm-size` option in Docker.
1051
978
  max_swap : int, optional, default None
1052
979
  The total amount of swap memory (in MiB) a container can use for this
1053
980
  step. This parameter is translated to the `--memory-swap` option in
@@ -1164,6 +1091,120 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1164
1091
  """
1165
1092
  ...
1166
1093
 
1094
+ @typing.overload
1095
+ 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]]]:
1096
+ """
1097
+ Specifies the Conda environment for the step.
1098
+
1099
+ Information in this decorator will augment any
1100
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1101
+ you can use `@conda_base` to set packages required by all
1102
+ steps and use `@conda` to specify step-specific overrides.
1103
+
1104
+ Parameters
1105
+ ----------
1106
+ packages : Dict[str, str], default {}
1107
+ Packages to use for this step. The key is the name of the package
1108
+ and the value is the version to use.
1109
+ libraries : Dict[str, str], default {}
1110
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1111
+ python : str, optional, default None
1112
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1113
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1114
+ disabled : bool, default False
1115
+ If set to True, disables @conda.
1116
+ """
1117
+ ...
1118
+
1119
+ @typing.overload
1120
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1121
+ ...
1122
+
1123
+ @typing.overload
1124
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1125
+ ...
1126
+
1127
+ 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):
1128
+ """
1129
+ Specifies the Conda environment for the step.
1130
+
1131
+ Information in this decorator will augment any
1132
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1133
+ you can use `@conda_base` to set packages required by all
1134
+ steps and use `@conda` to specify step-specific overrides.
1135
+
1136
+ Parameters
1137
+ ----------
1138
+ packages : Dict[str, str], default {}
1139
+ Packages to use for this step. The key is the name of the package
1140
+ and the value is the version to use.
1141
+ libraries : Dict[str, str], default {}
1142
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1143
+ python : str, optional, default None
1144
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1145
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1146
+ disabled : bool, default False
1147
+ If set to True, disables @conda.
1148
+ """
1149
+ ...
1150
+
1151
+ @typing.overload
1152
+ 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]]]:
1153
+ """
1154
+ Specifies a timeout for your step.
1155
+
1156
+ This decorator is useful if this step may hang indefinitely.
1157
+
1158
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1159
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1160
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1161
+
1162
+ Note that all the values specified in parameters are added together so if you specify
1163
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1164
+
1165
+ Parameters
1166
+ ----------
1167
+ seconds : int, default 0
1168
+ Number of seconds to wait prior to timing out.
1169
+ minutes : int, default 0
1170
+ Number of minutes to wait prior to timing out.
1171
+ hours : int, default 0
1172
+ Number of hours to wait prior to timing out.
1173
+ """
1174
+ ...
1175
+
1176
+ @typing.overload
1177
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1178
+ ...
1179
+
1180
+ @typing.overload
1181
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1182
+ ...
1183
+
1184
+ 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):
1185
+ """
1186
+ Specifies a timeout for your step.
1187
+
1188
+ This decorator is useful if this step may hang indefinitely.
1189
+
1190
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1191
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1192
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1193
+
1194
+ Note that all the values specified in parameters are added together so if you specify
1195
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1196
+
1197
+ Parameters
1198
+ ----------
1199
+ seconds : int, default 0
1200
+ Number of seconds to wait prior to timing out.
1201
+ minutes : int, default 0
1202
+ Number of minutes to wait prior to timing out.
1203
+ hours : int, default 0
1204
+ Number of hours to wait prior to timing out.
1205
+ """
1206
+ ...
1207
+
1167
1208
  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]]]:
1168
1209
  """
1169
1210
  Specifies that this step should execute on Kubernetes.
@@ -1224,169 +1265,177 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
1224
1265
  ...
1225
1266
 
1226
1267
  @typing.overload
1227
- 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]]]:
1268
+ 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]]]:
1228
1269
  """
1229
- Specifies a timeout for your step.
1230
-
1231
- This decorator is useful if this step may hang indefinitely.
1232
-
1233
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1234
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1235
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1270
+ Specifies the PyPI packages for the step.
1236
1271
 
1237
- Note that all the values specified in parameters are added together so if you specify
1238
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1272
+ Information in this decorator will augment any
1273
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1274
+ you can use `@pypi_base` to set packages required by all
1275
+ steps and use `@pypi` to specify step-specific overrides.
1239
1276
 
1240
1277
  Parameters
1241
1278
  ----------
1242
- seconds : int, default 0
1243
- Number of seconds to wait prior to timing out.
1244
- minutes : int, default 0
1245
- Number of minutes to wait prior to timing out.
1246
- hours : int, default 0
1247
- Number of hours to wait prior to timing out.
1279
+ packages : Dict[str, str], default: {}
1280
+ Packages to use for this step. The key is the name of the package
1281
+ and the value is the version to use.
1282
+ python : str, optional, default: None
1283
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1284
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1248
1285
  """
1249
1286
  ...
1250
1287
 
1251
1288
  @typing.overload
1252
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1289
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1253
1290
  ...
1254
1291
 
1255
1292
  @typing.overload
1256
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1293
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1257
1294
  ...
1258
1295
 
1259
- 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):
1296
+ 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):
1260
1297
  """
1261
- Specifies a timeout for your step.
1262
-
1263
- This decorator is useful if this step may hang indefinitely.
1264
-
1265
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1266
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1267
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1298
+ Specifies the PyPI packages for the step.
1268
1299
 
1269
- Note that all the values specified in parameters are added together so if you specify
1270
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1300
+ Information in this decorator will augment any
1301
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1302
+ you can use `@pypi_base` to set packages required by all
1303
+ steps and use `@pypi` to specify step-specific overrides.
1271
1304
 
1272
1305
  Parameters
1273
1306
  ----------
1274
- seconds : int, default 0
1275
- Number of seconds to wait prior to timing out.
1276
- minutes : int, default 0
1277
- Number of minutes to wait prior to timing out.
1278
- hours : int, default 0
1279
- Number of hours to wait prior to timing out.
1307
+ packages : Dict[str, str], default: {}
1308
+ Packages to use for this step. The key is the name of the package
1309
+ and the value is the version to use.
1310
+ python : str, optional, default: None
1311
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1312
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1280
1313
  """
1281
1314
  ...
1282
1315
 
1283
1316
  @typing.overload
1284
- 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]]]:
1317
+ 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]]]:
1285
1318
  """
1286
- Specifies the number of times the task corresponding
1287
- to a step needs to be retried.
1319
+ Specifies the resources needed when executing this step.
1288
1320
 
1289
- This decorator is useful for handling transient errors, such as networking issues.
1290
- If your task contains operations that can't be retried safely, e.g. database updates,
1291
- it is advisable to annotate it with `@retry(times=0)`.
1321
+ Use `@resources` to specify the resource requirements
1322
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1292
1323
 
1293
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1294
- decorator will execute a no-op task after all retries have been exhausted,
1295
- ensuring that the flow execution can continue.
1324
+ You can choose the compute layer on the command line by executing e.g.
1325
+ ```
1326
+ python myflow.py run --with batch
1327
+ ```
1328
+ or
1329
+ ```
1330
+ python myflow.py run --with kubernetes
1331
+ ```
1332
+ which executes the flow on the desired system using the
1333
+ requirements specified in `@resources`.
1296
1334
 
1297
1335
  Parameters
1298
1336
  ----------
1299
- times : int, default 3
1300
- Number of times to retry this task.
1301
- minutes_between_retries : int, default 2
1302
- Number of minutes between retries.
1337
+ cpu : int, default 1
1338
+ Number of CPUs required for this step.
1339
+ gpu : int, default 0
1340
+ Number of GPUs required for this step.
1341
+ disk : int, optional, default None
1342
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1343
+ memory : int, default 4096
1344
+ Memory size (in MB) required for this step.
1345
+ shared_memory : int, optional, default None
1346
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1347
+ This parameter maps to the `--shm-size` option in Docker.
1303
1348
  """
1304
1349
  ...
1305
1350
 
1306
1351
  @typing.overload
1307
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1352
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1308
1353
  ...
1309
1354
 
1310
1355
  @typing.overload
1311
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1356
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1312
1357
  ...
1313
1358
 
1314
- 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):
1359
+ 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):
1315
1360
  """
1316
- Specifies the number of times the task corresponding
1317
- to a step needs to be retried.
1361
+ Specifies the resources needed when executing this step.
1318
1362
 
1319
- This decorator is useful for handling transient errors, such as networking issues.
1320
- If your task contains operations that can't be retried safely, e.g. database updates,
1321
- it is advisable to annotate it with `@retry(times=0)`.
1363
+ Use `@resources` to specify the resource requirements
1364
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1322
1365
 
1323
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1324
- decorator will execute a no-op task after all retries have been exhausted,
1325
- ensuring that the flow execution can continue.
1366
+ You can choose the compute layer on the command line by executing e.g.
1367
+ ```
1368
+ python myflow.py run --with batch
1369
+ ```
1370
+ or
1371
+ ```
1372
+ python myflow.py run --with kubernetes
1373
+ ```
1374
+ which executes the flow on the desired system using the
1375
+ requirements specified in `@resources`.
1326
1376
 
1327
1377
  Parameters
1328
1378
  ----------
1329
- times : int, default 3
1330
- Number of times to retry this task.
1331
- minutes_between_retries : int, default 2
1332
- Number of minutes between retries.
1379
+ cpu : int, default 1
1380
+ Number of CPUs required for this step.
1381
+ gpu : int, default 0
1382
+ Number of GPUs required for this step.
1383
+ disk : int, optional, default None
1384
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1385
+ memory : int, default 4096
1386
+ Memory size (in MB) required for this step.
1387
+ shared_memory : int, optional, default None
1388
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1389
+ This parameter maps to the `--shm-size` option in Docker.
1333
1390
  """
1334
1391
  ...
1335
1392
 
1336
1393
  @typing.overload
1337
- 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]]]:
1394
+ 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]]:
1338
1395
  """
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.
1396
+ Specifies the times when the flow should be run when running on a
1397
+ production scheduler.
1345
1398
 
1346
1399
  Parameters
1347
1400
  ----------
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.
1401
+ hourly : bool, default False
1402
+ Run the workflow hourly.
1403
+ daily : bool, default True
1404
+ Run the workflow daily.
1405
+ weekly : bool, default False
1406
+ Run the workflow weekly.
1407
+ cron : str, optional, default None
1408
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1409
+ specified by this expression.
1410
+ timezone : str, optional, default None
1411
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1412
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1358
1413
  """
1359
1414
  ...
1360
1415
 
1361
1416
  @typing.overload
1362
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1363
- ...
1364
-
1365
- @typing.overload
1366
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1417
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1367
1418
  ...
1368
1419
 
1369
- 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):
1420
+ 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):
1370
1421
  """
1371
- Specifies the Conda environment for the step.
1372
-
1373
- Information in this decorator will augment any
1374
- attributes set in the `@conda_base` flow-level decorator. Hence,
1375
- you can use `@conda_base` to set packages required by all
1376
- steps and use `@conda` to specify step-specific overrides.
1422
+ Specifies the times when the flow should be run when running on a
1423
+ production scheduler.
1377
1424
 
1378
1425
  Parameters
1379
1426
  ----------
1380
- packages : Dict[str, str], default {}
1381
- Packages to use for this step. The key is the name of the package
1382
- and the value is the version to use.
1383
- libraries : Dict[str, str], default {}
1384
- Supported for backward compatibility. When used with packages, packages will take precedence.
1385
- python : str, optional, default None
1386
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1387
- that the version used will correspond to the version of the Python interpreter used to start the run.
1388
- disabled : bool, default False
1389
- If set to True, disables @conda.
1427
+ hourly : bool, default False
1428
+ Run the workflow hourly.
1429
+ daily : bool, default True
1430
+ Run the workflow daily.
1431
+ weekly : bool, default False
1432
+ Run the workflow weekly.
1433
+ cron : str, optional, default None
1434
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1435
+ specified by this expression.
1436
+ timezone : str, optional, default None
1437
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1438
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1390
1439
  """
1391
1440
  ...
1392
1441
 
@@ -1432,63 +1481,42 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1432
1481
  """
1433
1482
  ...
1434
1483
 
1435
- 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]]:
1484
+ @typing.overload
1485
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1436
1486
  """
1437
- 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)
1438
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1439
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1440
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1441
- starts only after all sensors finish.
1487
+ Specifies the PyPI packages for all steps of the flow.
1442
1488
 
1489
+ Use `@pypi_base` to set common packages required by all
1490
+ steps and use `@pypi` to specify step-specific overrides.
1443
1491
  Parameters
1444
1492
  ----------
1445
- timeout : int
1446
- Time, in seconds before the task times out and fails. (Default: 3600)
1447
- poke_interval : int
1448
- Time in seconds that the job should wait in between each try. (Default: 60)
1449
- mode : str
1450
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1451
- exponential_backoff : bool
1452
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1453
- pool : str
1454
- the slot pool this task should run in,
1455
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1456
- soft_fail : bool
1457
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1458
- name : str
1459
- Name of the sensor on Airflow
1460
- description : str
1461
- Description of sensor in the Airflow UI
1462
- bucket_key : Union[str, List[str]]
1463
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1464
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1465
- bucket_name : str
1466
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1467
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1468
- wildcard_match : bool
1469
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1470
- aws_conn_id : str
1471
- a reference to the s3 connection on Airflow. (Default: None)
1472
- verify : bool
1473
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
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
+ python : str, optional, default: None
1497
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1498
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1474
1499
  """
1475
1500
  ...
1476
1501
 
1477
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1502
+ @typing.overload
1503
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1504
+ ...
1505
+
1506
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1478
1507
  """
1479
- Specifies what flows belong to the same project.
1480
-
1481
- A project-specific namespace is created for all flows that
1482
- use the same `@project(name)`.
1508
+ Specifies the PyPI packages for all steps of the flow.
1483
1509
 
1510
+ Use `@pypi_base` to set common packages required by all
1511
+ steps and use `@pypi` to specify step-specific overrides.
1484
1512
  Parameters
1485
1513
  ----------
1486
- name : str
1487
- Project name. Make sure that the name is unique amongst all
1488
- projects that use the same production scheduler. The name may
1489
- contain only lowercase alphanumeric characters and underscores.
1490
-
1491
-
1514
+ packages : Dict[str, str], default: {}
1515
+ Packages to use for this flow. The key is the name of the package
1516
+ and the value is the version to use.
1517
+ python : str, optional, default: None
1518
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1519
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1492
1520
  """
1493
1521
  ...
1494
1522
 
@@ -1587,52 +1615,34 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1587
1615
  """
1588
1616
  ...
1589
1617
 
1590
- @typing.overload
1591
- 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]]:
1618
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1592
1619
  """
1593
- Specifies the times when the flow should be run when running on a
1594
- production scheduler.
1620
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1595
1621
 
1596
- Parameters
1597
- ----------
1598
- hourly : bool, default False
1599
- Run the workflow hourly.
1600
- daily : bool, default True
1601
- Run the workflow daily.
1602
- weekly : bool, default False
1603
- Run the workflow weekly.
1604
- cron : str, optional, default None
1605
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1606
- specified by this expression.
1607
- timezone : str, optional, default None
1608
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1609
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1610
- """
1611
- ...
1612
-
1613
- @typing.overload
1614
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1615
- ...
1616
-
1617
- 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):
1618
- """
1619
- Specifies the times when the flow should be run when running on a
1620
- production scheduler.
1622
+ User code call
1623
+ -----------
1624
+ @nim(
1625
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1626
+ backend='managed'
1627
+ )
1628
+
1629
+ Valid backend options
1630
+ ---------------------
1631
+ - 'managed': Outerbounds selects a compute provider based on the model.
1632
+ - 🚧 'dataplane': Run in your account.
1633
+
1634
+ Valid model options
1635
+ ----------------
1636
+ - 'meta/llama3-8b-instruct': 8B parameter model
1637
+ - 'meta/llama3-70b-instruct': 70B parameter model
1638
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1621
1639
 
1622
1640
  Parameters
1623
1641
  ----------
1624
- hourly : bool, default False
1625
- Run the workflow hourly.
1626
- daily : bool, default True
1627
- Run the workflow daily.
1628
- weekly : bool, default False
1629
- Run the workflow weekly.
1630
- cron : str, optional, default None
1631
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1632
- specified by this expression.
1633
- timezone : str, optional, default None
1634
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1635
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1642
+ models: list[NIM]
1643
+ List of NIM containers running models in sidecars.
1644
+ backend: str
1645
+ Compute provider to run the NIM container.
1636
1646
  """
1637
1647
  ...
1638
1648
 
@@ -1685,73 +1695,63 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1685
1695
  """
1686
1696
  ...
1687
1697
 
1688
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1698
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1689
1699
  """
1690
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1691
-
1692
- User code call
1693
- -----------
1694
- @nim(
1695
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1696
- backend='managed'
1697
- )
1698
-
1699
- Valid backend options
1700
- ---------------------
1701
- - 'managed': Outerbounds selects a compute provider based on the model.
1702
- - 🚧 'dataplane': Run in your account.
1700
+ Specifies what flows belong to the same project.
1703
1701
 
1704
- Valid model options
1705
- ----------------
1706
- - 'meta/llama3-8b-instruct': 8B parameter model
1707
- - 'meta/llama3-70b-instruct': 70B parameter model
1708
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1702
+ A project-specific namespace is created for all flows that
1703
+ use the same `@project(name)`.
1709
1704
 
1710
1705
  Parameters
1711
1706
  ----------
1712
- models: list[NIM]
1713
- List of NIM containers running models in sidecars.
1714
- backend: str
1715
- Compute provider to run the NIM container.
1716
- """
1717
- ...
1718
-
1719
- @typing.overload
1720
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1721
- """
1722
- Specifies the PyPI packages for all steps of the flow.
1707
+ name : str
1708
+ Project name. Make sure that the name is unique amongst all
1709
+ projects that use the same production scheduler. The name may
1710
+ contain only lowercase alphanumeric characters and underscores.
1711
+
1723
1712
 
1724
- Use `@pypi_base` to set common packages required by all
1725
- steps and use `@pypi` to specify step-specific overrides.
1726
- Parameters
1727
- ----------
1728
- packages : Dict[str, str], default: {}
1729
- Packages to use for this flow. The key is the name of the package
1730
- and the value is the version to use.
1731
- python : str, optional, default: None
1732
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1733
- that the version used will correspond to the version of the Python interpreter used to start the run.
1734
1713
  """
1735
1714
  ...
1736
1715
 
1737
- @typing.overload
1738
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1739
- ...
1740
-
1741
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1716
+ 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]]:
1742
1717
  """
1743
- Specifies the PyPI packages for all steps of the flow.
1718
+ 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)
1719
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1720
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1721
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1722
+ starts only after all sensors finish.
1744
1723
 
1745
- Use `@pypi_base` to set common packages required by all
1746
- steps and use `@pypi` to specify step-specific overrides.
1747
1724
  Parameters
1748
1725
  ----------
1749
- packages : Dict[str, str], default: {}
1750
- Packages to use for this flow. The key is the name of the package
1751
- and the value is the version to use.
1752
- python : str, optional, default: None
1753
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1754
- that the version used will correspond to the version of the Python interpreter used to start the run.
1726
+ timeout : int
1727
+ Time, in seconds before the task times out and fails. (Default: 3600)
1728
+ poke_interval : int
1729
+ Time in seconds that the job should wait in between each try. (Default: 60)
1730
+ mode : str
1731
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1732
+ exponential_backoff : bool
1733
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1734
+ pool : str
1735
+ the slot pool this task should run in,
1736
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1737
+ soft_fail : bool
1738
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1739
+ name : str
1740
+ Name of the sensor on Airflow
1741
+ description : str
1742
+ Description of sensor in the Airflow UI
1743
+ bucket_key : Union[str, List[str]]
1744
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1745
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1746
+ bucket_name : str
1747
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1748
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1749
+ wildcard_match : bool
1750
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1751
+ aws_conn_id : str
1752
+ a reference to the s3 connection on Airflow. (Default: None)
1753
+ verify : bool
1754
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1755
1755
  """
1756
1756
  ...
1757
1757