metaflow-stubs 2.11.10__py2.py3-none-any.whl → 2.11.12__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 (132) hide show
  1. metaflow-stubs/__init__.pyi +535 -535
  2. metaflow-stubs/cards.pyi +5 -5
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +4 -4
  5. metaflow-stubs/client/core.pyi +7 -7
  6. metaflow-stubs/client/filecache.pyi +3 -3
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +2 -2
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +4 -4
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +5 -5
  13. metaflow-stubs/metadata/metadata.pyi +2 -2
  14. metaflow-stubs/metadata/util.pyi +2 -2
  15. metaflow-stubs/metaflow_config.pyi +4 -2
  16. metaflow-stubs/metaflow_current.pyi +5 -5
  17. metaflow-stubs/mflog/mflog.pyi +2 -2
  18. metaflow-stubs/multicore_utils.pyi +2 -2
  19. metaflow-stubs/parameters.pyi +3 -3
  20. metaflow-stubs/plugins/__init__.pyi +3 -3
  21. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/airflow.pyi +3 -3
  23. metaflow-stubs/plugins/airflow/airflow_cli.pyi +3 -3
  24. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +3 -3
  29. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  30. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  31. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  32. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  34. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
  35. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +4 -4
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  37. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  38. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  39. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  45. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  46. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
  47. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +4 -4
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  56. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/azure/azure_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 +3 -3
  63. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  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 +2 -2
  67. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_modules/basic.pyi +4 -4
  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 +5 -5
  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 +3 -3
  79. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  80. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  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 +3 -3
  84. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  85. metaflow-stubs/plugins/datatools/s3/__init__.pyi +4 -4
  86. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  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 +2 -2
  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 +3 -3
  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 +2 -2
  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 +4 -4
  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 +5 -5
  122. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  123. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  124. metaflow-stubs/procpoll.pyi +2 -2
  125. metaflow-stubs/pylint_wrapper.pyi +2 -2
  126. metaflow-stubs/tagging_util.pyi +2 -2
  127. metaflow-stubs/version.pyi +2 -2
  128. {metaflow_stubs-2.11.10.dist-info → metaflow_stubs-2.11.12.dist-info}/METADATA +2 -2
  129. metaflow_stubs-2.11.12.dist-info/RECORD +132 -0
  130. metaflow_stubs-2.11.10.dist-info/RECORD +0 -132
  131. {metaflow_stubs-2.11.10.dist-info → metaflow_stubs-2.11.12.dist-info}/WHEEL +0 -0
  132. {metaflow_stubs-2.11.10.dist-info → metaflow_stubs-2.11.12.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.10 #
4
- # Generated on 2024-04-12T11:08:34.072022 #
3
+ # MF version: 2.11.12 #
4
+ # Generated on 2024-05-03T20:23:27.231184 #
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
+ import metaflow.plugins.datatools.s3.s3
12
12
  import io
13
13
  import metaflow.client.core
14
+ import metaflow.events
14
15
  import metaflow.parameters
15
16
  import datetime
16
- import metaflow.events
17
+ import metaflow.metaflow_current
17
18
  import metaflow._vendor.click.types
18
19
  import typing
19
20
  import metaflow.datastore.inputs
20
- import metaflow.plugins.datatools.s3.s3
21
21
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
22
22
  StepFlag = typing.NewType("StepFlag", bool)
23
23
 
@@ -725,140 +725,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
725
725
  """
726
726
  ...
727
727
 
728
- @typing.overload
729
- def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
730
- """
731
- Specifies a timeout for your step.
732
-
733
- This decorator is useful if this step may hang indefinitely.
734
-
735
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
736
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
737
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
738
-
739
- Note that all the values specified in parameters are added together so if you specify
740
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
741
-
742
- Parameters
743
- ----------
744
- seconds : int, default 0
745
- Number of seconds to wait prior to timing out.
746
- minutes : int, default 0
747
- Number of minutes to wait prior to timing out.
748
- hours : int, default 0
749
- Number of hours to wait prior to timing out.
750
- """
751
- ...
752
-
753
- @typing.overload
754
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
755
- ...
756
-
757
- @typing.overload
758
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
759
- ...
760
-
761
- def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
762
- """
763
- Specifies a timeout for your step.
764
-
765
- This decorator is useful if this step may hang indefinitely.
766
-
767
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
768
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
769
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
770
-
771
- Note that all the values specified in parameters are added together so if you specify
772
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
773
-
774
- Parameters
775
- ----------
776
- seconds : int, default 0
777
- Number of seconds to wait prior to timing out.
778
- minutes : int, default 0
779
- Number of minutes to wait prior to timing out.
780
- hours : int, default 0
781
- Number of hours to wait prior to timing out.
782
- """
783
- ...
784
-
785
- @typing.overload
786
- def 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]]]:
787
- """
788
- Specifies the resources needed when executing this step.
789
-
790
- Use `@resources` to specify the resource requirements
791
- independently of the specific compute layer (`@batch`, `@kubernetes`).
792
-
793
- You can choose the compute layer on the command line by executing e.g.
794
- ```
795
- python myflow.py run --with batch
796
- ```
797
- or
798
- ```
799
- python myflow.py run --with kubernetes
800
- ```
801
- which executes the flow on the desired system using the
802
- requirements specified in `@resources`.
803
-
804
- Parameters
805
- ----------
806
- cpu : int, default 1
807
- Number of CPUs required for this step.
808
- gpu : int, default 0
809
- Number of GPUs required for this step.
810
- disk : int, optional, default None
811
- Disk size (in MB) required for this step. Only applies on Kubernetes.
812
- memory : int, default 4096
813
- Memory size (in MB) required for this step.
814
- shared_memory : int, optional, default None
815
- The value for the size (in MiB) of the /dev/shm volume for this step.
816
- This parameter maps to the `--shm-size` option in Docker.
817
- """
818
- ...
819
-
820
- @typing.overload
821
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
822
- ...
823
-
824
- @typing.overload
825
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
826
- ...
827
-
828
- 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):
829
- """
830
- Specifies the resources needed when executing this step.
831
-
832
- Use `@resources` to specify the resource requirements
833
- independently of the specific compute layer (`@batch`, `@kubernetes`).
834
-
835
- You can choose the compute layer on the command line by executing e.g.
836
- ```
837
- python myflow.py run --with batch
838
- ```
839
- or
840
- ```
841
- python myflow.py run --with kubernetes
842
- ```
843
- which executes the flow on the desired system using the
844
- requirements specified in `@resources`.
845
-
846
- Parameters
847
- ----------
848
- cpu : int, default 1
849
- Number of CPUs required for this step.
850
- gpu : int, default 0
851
- Number of GPUs required for this step.
852
- disk : int, optional, default None
853
- Disk size (in MB) required for this step. Only applies on Kubernetes.
854
- memory : int, default 4096
855
- Memory size (in MB) required for this step.
856
- shared_memory : int, optional, default None
857
- The value for the size (in MiB) of the /dev/shm volume for this step.
858
- This parameter maps to the `--shm-size` option in Docker.
859
- """
860
- ...
861
-
862
728
  @typing.overload
863
729
  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
730
  """
@@ -908,6 +774,39 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
908
774
  """
909
775
  ...
910
776
 
777
+ @typing.overload
778
+ 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]]]:
779
+ """
780
+ Specifies secrets to be retrieved and injected as environment variables prior to
781
+ the execution of a step.
782
+
783
+ Parameters
784
+ ----------
785
+ sources : List[Union[str, Dict[str, Any]]], default: []
786
+ List of secret specs, defining how the secrets are to be retrieved
787
+ """
788
+ ...
789
+
790
+ @typing.overload
791
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
792
+ ...
793
+
794
+ @typing.overload
795
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
796
+ ...
797
+
798
+ 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]]] = []):
799
+ """
800
+ Specifies secrets to be retrieved and injected as environment variables prior to
801
+ the execution of a step.
802
+
803
+ Parameters
804
+ ----------
805
+ sources : List[Union[str, Dict[str, Any]]], default: []
806
+ List of secret specs, defining how the secrets are to be retrieved
807
+ """
808
+ ...
809
+
911
810
  @typing.overload
912
811
  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]]]:
913
812
  """
@@ -966,79 +865,274 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
966
865
  ...
967
866
 
968
867
  @typing.overload
969
- 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]]]:
868
+ def card(*, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
970
869
  """
971
- Specifies that the step will success under all circumstances.
870
+ Creates a human-readable report, a Metaflow Card, after this step completes.
972
871
 
973
- The decorator will create an optional artifact, specified by `var`, which
974
- contains the exception raised. You can use it to detect the presence
975
- of errors, indicating that all happy-path artifacts produced by the step
976
- are missing.
872
+ Note that you may add multiple `@card` decorators in a step with different parameters.
977
873
 
978
874
  Parameters
979
875
  ----------
980
- var : str, optional, default None
981
- Name of the artifact in which to store the caught exception.
982
- If not specified, the exception is not stored.
983
- print_exception : bool, default True
984
- Determines whether or not the exception is printed to
985
- stdout when caught.
876
+ type : str, default 'default'
877
+ Card type.
878
+ id : str, optional, default None
879
+ If multiple cards are present, use this id to identify this card.
880
+ options : Dict[str, Any], default {}
881
+ Options passed to the card. The contents depend on the card type.
882
+ timeout : int, default 45
883
+ Interrupt reporting if it takes more than this many seconds.
884
+
885
+
986
886
  """
987
887
  ...
988
888
 
989
889
  @typing.overload
990
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
890
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
991
891
  ...
992
892
 
993
893
  @typing.overload
994
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
894
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
995
895
  ...
996
896
 
997
- 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):
897
+ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
998
898
  """
999
- Specifies that the step will success under all circumstances.
899
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1000
900
 
1001
- The decorator will create an optional artifact, specified by `var`, which
1002
- contains the exception raised. You can use it to detect the presence
1003
- of errors, indicating that all happy-path artifacts produced by the step
1004
- are missing.
901
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1005
902
 
1006
903
  Parameters
1007
904
  ----------
1008
- var : str, optional, default None
1009
- Name of the artifact in which to store the caught exception.
1010
- If not specified, the exception is not stored.
1011
- print_exception : bool, default True
1012
- Determines whether or not the exception is printed to
1013
- stdout when caught.
905
+ type : str, default 'default'
906
+ Card type.
907
+ id : str, optional, default None
908
+ If multiple cards are present, use this id to identify this card.
909
+ options : Dict[str, Any], default {}
910
+ Options passed to the card. The contents depend on the card type.
911
+ timeout : int, default 45
912
+ Interrupt reporting if it takes more than this many seconds.
913
+
914
+
1014
915
  """
1015
916
  ...
1016
917
 
1017
918
  @typing.overload
1018
- 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]]]:
919
+ 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]]]:
1019
920
  """
1020
- Specifies the number of times the task corresponding
1021
- to a step needs to be retried.
921
+ Specifies a timeout for your step.
1022
922
 
1023
- This decorator is useful for handling transient errors, such as networking issues.
1024
- If your task contains operations that can't be retried safely, e.g. database updates,
1025
- it is advisable to annotate it with `@retry(times=0)`.
923
+ This decorator is useful if this step may hang indefinitely.
1026
924
 
1027
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1028
- decorator will execute a no-op task after all retries have been exhausted,
1029
- ensuring that the flow execution can continue.
925
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
926
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
927
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
928
+
929
+ Note that all the values specified in parameters are added together so if you specify
930
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1030
931
 
1031
932
  Parameters
1032
933
  ----------
1033
- times : int, default 3
1034
- Number of times to retry this task.
1035
- minutes_between_retries : int, default 2
1036
- Number of minutes between retries.
934
+ seconds : int, default 0
935
+ Number of seconds to wait prior to timing out.
936
+ minutes : int, default 0
937
+ Number of minutes to wait prior to timing out.
938
+ hours : int, default 0
939
+ Number of hours to wait prior to timing out.
1037
940
  """
1038
941
  ...
1039
942
 
1040
943
  @typing.overload
1041
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
944
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
945
+ ...
946
+
947
+ @typing.overload
948
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
949
+ ...
950
+
951
+ 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):
952
+ """
953
+ Specifies a timeout for your step.
954
+
955
+ This decorator is useful if this step may hang indefinitely.
956
+
957
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
958
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
959
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
960
+
961
+ Note that all the values specified in parameters are added together so if you specify
962
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
963
+
964
+ Parameters
965
+ ----------
966
+ seconds : int, default 0
967
+ Number of seconds to wait prior to timing out.
968
+ minutes : int, default 0
969
+ Number of minutes to wait prior to timing out.
970
+ hours : int, default 0
971
+ Number of hours to wait prior to timing out.
972
+ """
973
+ ...
974
+
975
+ @typing.overload
976
+ 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]]]:
977
+ """
978
+ Specifies the resources needed when executing this step.
979
+
980
+ Use `@resources` to specify the resource requirements
981
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
982
+
983
+ You can choose the compute layer on the command line by executing e.g.
984
+ ```
985
+ python myflow.py run --with batch
986
+ ```
987
+ or
988
+ ```
989
+ python myflow.py run --with kubernetes
990
+ ```
991
+ which executes the flow on the desired system using the
992
+ requirements specified in `@resources`.
993
+
994
+ Parameters
995
+ ----------
996
+ cpu : int, default 1
997
+ Number of CPUs required for this step.
998
+ gpu : int, default 0
999
+ Number of GPUs required for this step.
1000
+ disk : int, optional, default None
1001
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1002
+ memory : int, default 4096
1003
+ Memory size (in MB) required for this step.
1004
+ shared_memory : int, optional, default None
1005
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1006
+ This parameter maps to the `--shm-size` option in Docker.
1007
+ """
1008
+ ...
1009
+
1010
+ @typing.overload
1011
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1012
+ ...
1013
+
1014
+ @typing.overload
1015
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1016
+ ...
1017
+
1018
+ 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):
1019
+ """
1020
+ Specifies the resources needed when executing this step.
1021
+
1022
+ Use `@resources` to specify the resource requirements
1023
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
1024
+
1025
+ You can choose the compute layer on the command line by executing e.g.
1026
+ ```
1027
+ python myflow.py run --with batch
1028
+ ```
1029
+ or
1030
+ ```
1031
+ python myflow.py run --with kubernetes
1032
+ ```
1033
+ which executes the flow on the desired system using the
1034
+ requirements specified in `@resources`.
1035
+
1036
+ Parameters
1037
+ ----------
1038
+ cpu : int, default 1
1039
+ Number of CPUs required for this step.
1040
+ gpu : int, default 0
1041
+ Number of GPUs required for this step.
1042
+ disk : int, optional, default None
1043
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
1044
+ memory : int, default 4096
1045
+ Memory size (in MB) required for this step.
1046
+ shared_memory : int, optional, default None
1047
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1048
+ This parameter maps to the `--shm-size` option in Docker.
1049
+ """
1050
+ ...
1051
+
1052
+ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = "KUBERNETES_IMAGE_PULL_POLICY", service_account: str = "METAFLOW_KUBERNETES_SERVICE_ACCOUNT", secrets: typing.Optional[typing.List[str]] = None, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = "/metaflow_temp", persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1053
+ """
1054
+ Specifies that this step should execute on Kubernetes.
1055
+
1056
+ Parameters
1057
+ ----------
1058
+ cpu : int, default 1
1059
+ Number of CPUs required for this step. If `@resources` is
1060
+ also present, the maximum value from all decorators is used.
1061
+ memory : int, default 4096
1062
+ Memory size (in MB) required for this step. If
1063
+ `@resources` is also present, the maximum value from all decorators is
1064
+ used.
1065
+ disk : int, default 10240
1066
+ Disk size (in MB) required for this step. If
1067
+ `@resources` is also present, the maximum value from all decorators is
1068
+ used.
1069
+ image : str, optional, default None
1070
+ Docker image to use when launching on Kubernetes. If not specified, and
1071
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1072
+ not, a default Docker image mapping to the current version of Python is used.
1073
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1074
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
1075
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1076
+ Kubernetes service account to use when launching pod in Kubernetes.
1077
+ secrets : List[str], optional, default None
1078
+ Kubernetes secrets to use when launching pod in Kubernetes. These
1079
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1080
+ in Metaflow configuration.
1081
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1082
+ Kubernetes namespace to use when launching pod in Kubernetes.
1083
+ gpu : int, optional, default None
1084
+ Number of GPUs required for this step. A value of zero implies that
1085
+ the scheduled node should not have GPUs.
1086
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1087
+ The vendor of the GPUs to be used for this step.
1088
+ tolerations : List[str], default []
1089
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1090
+ Kubernetes tolerations to use when launching pod in Kubernetes.
1091
+ use_tmpfs : bool, default False
1092
+ This enables an explicit tmpfs mount for this step.
1093
+ tmpfs_tempdir : bool, default True
1094
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1095
+ tmpfs_size : int, optional, default: None
1096
+ The value for the size (in MiB) of the tmpfs mount for this step.
1097
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1098
+ memory allocated for this step.
1099
+ tmpfs_path : str, optional, default /metaflow_temp
1100
+ Path to tmpfs mount for this step.
1101
+ persistent_volume_claims : Dict[str, str], optional, default None
1102
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1103
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1104
+ shared_memory: int, optional
1105
+ Shared memory size (in MiB) required for this step
1106
+ port: int, optional
1107
+ Port number to specify in the Kubernetes job object
1108
+ """
1109
+ ...
1110
+
1111
+ @typing.overload
1112
+ def 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]]]:
1113
+ """
1114
+ Specifies the number of times the task corresponding
1115
+ to a step needs to be retried.
1116
+
1117
+ This decorator is useful for handling transient errors, such as networking issues.
1118
+ If your task contains operations that can't be retried safely, e.g. database updates,
1119
+ it is advisable to annotate it with `@retry(times=0)`.
1120
+
1121
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1122
+ decorator will execute a no-op task after all retries have been exhausted,
1123
+ ensuring that the flow execution can continue.
1124
+
1125
+ Parameters
1126
+ ----------
1127
+ times : int, default 3
1128
+ Number of times to retry this task.
1129
+ minutes_between_retries : int, default 2
1130
+ Number of minutes between retries.
1131
+ """
1132
+ ...
1133
+
1134
+ @typing.overload
1135
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1042
1136
  ...
1043
1137
 
1044
1138
  @typing.overload
@@ -1067,6 +1161,37 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1067
1161
  """
1068
1162
  ...
1069
1163
 
1164
+ @typing.overload
1165
+ 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]]]:
1166
+ """
1167
+ Specifies environment variables to be set prior to the execution of a step.
1168
+
1169
+ Parameters
1170
+ ----------
1171
+ vars : Dict[str, str], default {}
1172
+ Dictionary of environment variables to set.
1173
+ """
1174
+ ...
1175
+
1176
+ @typing.overload
1177
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1178
+ ...
1179
+
1180
+ @typing.overload
1181
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1182
+ ...
1183
+
1184
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1185
+ """
1186
+ Specifies environment variables to be set prior to the execution of a step.
1187
+
1188
+ Parameters
1189
+ ----------
1190
+ vars : Dict[str, str], default {}
1191
+ Dictionary of environment variables to set.
1192
+ """
1193
+ ...
1194
+
1070
1195
  @typing.overload
1071
1196
  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]]]:
1072
1197
  """
@@ -1215,176 +1340,154 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1215
1340
  ...
1216
1341
 
1217
1342
  @typing.overload
1218
- 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]]]:
1343
+ 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]]]:
1219
1344
  """
1220
- Specifies secrets to be retrieved and injected as environment variables prior to
1221
- the execution of a step.
1345
+ Specifies that the step will success under all circumstances.
1346
+
1347
+ The decorator will create an optional artifact, specified by `var`, which
1348
+ contains the exception raised. You can use it to detect the presence
1349
+ of errors, indicating that all happy-path artifacts produced by the step
1350
+ are missing.
1222
1351
 
1223
1352
  Parameters
1224
1353
  ----------
1225
- sources : List[Union[str, Dict[str, Any]]], default: []
1226
- List of secret specs, defining how the secrets are to be retrieved
1354
+ var : str, optional, default None
1355
+ Name of the artifact in which to store the caught exception.
1356
+ If not specified, the exception is not stored.
1357
+ print_exception : bool, default True
1358
+ Determines whether or not the exception is printed to
1359
+ stdout when caught.
1227
1360
  """
1228
1361
  ...
1229
1362
 
1230
1363
  @typing.overload
1231
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1364
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1232
1365
  ...
1233
1366
 
1234
1367
  @typing.overload
1235
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1368
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1236
1369
  ...
1237
1370
 
1238
- 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]]] = []):
1371
+ 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):
1239
1372
  """
1240
- Specifies secrets to be retrieved and injected as environment variables prior to
1241
- the execution of a step.
1373
+ Specifies that the step will success under all circumstances.
1374
+
1375
+ The decorator will create an optional artifact, specified by `var`, which
1376
+ contains the exception raised. You can use it to detect the presence
1377
+ of errors, indicating that all happy-path artifacts produced by the step
1378
+ are missing.
1242
1379
 
1243
1380
  Parameters
1244
1381
  ----------
1245
- sources : List[Union[str, Dict[str, Any]]], default: []
1246
- List of secret specs, defining how the secrets are to be retrieved
1382
+ var : str, optional, default None
1383
+ Name of the artifact in which to store the caught exception.
1384
+ If not specified, the exception is not stored.
1385
+ print_exception : bool, default True
1386
+ Determines whether or not the exception is printed to
1387
+ stdout when caught.
1247
1388
  """
1248
1389
  ...
1249
1390
 
1250
1391
  @typing.overload
1251
- def card(*, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1392
+ def trigger_on_finish(*, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1252
1393
  """
1253
- Creates a human-readable report, a Metaflow Card, after this step completes.
1394
+ Specifies the flow(s) that this flow depends on.
1254
1395
 
1255
- Note that you may add multiple `@card` decorators in a step with different parameters.
1396
+ ```
1397
+ @trigger_on_finish(flow='FooFlow')
1398
+ ```
1399
+ or
1400
+ ```
1401
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1402
+ ```
1403
+ This decorator respects the @project decorator and triggers the flow
1404
+ when upstream runs within the same namespace complete successfully
1405
+
1406
+ Additionally, you can specify project aware upstream flow dependencies
1407
+ by specifying the fully qualified project_flow_name.
1408
+ ```
1409
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1410
+ ```
1411
+ or
1412
+ ```
1413
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1414
+ ```
1415
+
1416
+ You can also specify just the project or project branch (other values will be
1417
+ inferred from the current project or project branch):
1418
+ ```
1419
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1420
+ ```
1421
+
1422
+ Note that `branch` is typically one of:
1423
+ - `prod`
1424
+ - `user.bob`
1425
+ - `test.my_experiment`
1426
+ - `prod.staging`
1256
1427
 
1257
1428
  Parameters
1258
1429
  ----------
1259
- type : str, default 'default'
1260
- Card type.
1261
- id : str, optional, default None
1262
- If multiple cards are present, use this id to identify this card.
1430
+ flow : Union[str, Dict[str, str]], optional, default None
1431
+ Upstream flow dependency for this flow.
1432
+ flows : List[Union[str, Dict[str, str]]], default []
1433
+ Upstream flow dependencies for this flow.
1263
1434
  options : Dict[str, Any], default {}
1264
- Options passed to the card. The contents depend on the card type.
1265
- timeout : int, default 45
1266
- Interrupt reporting if it takes more than this many seconds.
1435
+ Backend-specific configuration for tuning eventing behavior.
1267
1436
 
1268
1437
 
1269
1438
  """
1270
1439
  ...
1271
1440
 
1272
1441
  @typing.overload
1273
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1274
- ...
1275
-
1276
- @typing.overload
1277
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1442
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1278
1443
  ...
1279
1444
 
1280
- def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
1445
+ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1281
1446
  """
1282
- Creates a human-readable report, a Metaflow Card, after this step completes.
1447
+ Specifies the flow(s) that this flow depends on.
1283
1448
 
1284
- Note that you may add multiple `@card` decorators in a step with different parameters.
1449
+ ```
1450
+ @trigger_on_finish(flow='FooFlow')
1451
+ ```
1452
+ or
1453
+ ```
1454
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1455
+ ```
1456
+ This decorator respects the @project decorator and triggers the flow
1457
+ when upstream runs within the same namespace complete successfully
1285
1458
 
1286
- Parameters
1287
- ----------
1288
- type : str, default 'default'
1289
- Card type.
1290
- id : str, optional, default None
1291
- If multiple cards are present, use this id to identify this card.
1292
- options : Dict[str, Any], default {}
1293
- Options passed to the card. The contents depend on the card type.
1294
- timeout : int, default 45
1295
- Interrupt reporting if it takes more than this many seconds.
1459
+ Additionally, you can specify project aware upstream flow dependencies
1460
+ by specifying the fully qualified project_flow_name.
1461
+ ```
1462
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1463
+ ```
1464
+ or
1465
+ ```
1466
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1467
+ ```
1296
1468
 
1469
+ You can also specify just the project or project branch (other values will be
1470
+ inferred from the current project or project branch):
1471
+ ```
1472
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1473
+ ```
1297
1474
 
1298
- """
1299
- ...
1300
-
1301
- 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]]]:
1302
- """
1303
- Specifies that this step should execute on Kubernetes.
1475
+ Note that `branch` is typically one of:
1476
+ - `prod`
1477
+ - `user.bob`
1478
+ - `test.my_experiment`
1479
+ - `prod.staging`
1304
1480
 
1305
1481
  Parameters
1306
1482
  ----------
1307
- cpu : int, default 1
1308
- Number of CPUs required for this step. If `@resources` is
1309
- also present, the maximum value from all decorators is used.
1310
- memory : int, default 4096
1311
- Memory size (in MB) required for this step. If
1312
- `@resources` is also present, the maximum value from all decorators is
1313
- used.
1314
- disk : int, default 10240
1315
- Disk size (in MB) required for this step. If
1316
- `@resources` is also present, the maximum value from all decorators is
1317
- used.
1318
- image : str, optional, default None
1319
- Docker image to use when launching on Kubernetes. If not specified, and
1320
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1321
- not, a default Docker image mapping to the current version of Python is used.
1322
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1323
- If given, the imagePullPolicy to be applied to the Docker image of the step.
1324
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1325
- Kubernetes service account to use when launching pod in Kubernetes.
1326
- secrets : List[str], optional, default None
1327
- Kubernetes secrets to use when launching pod in Kubernetes. These
1328
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1329
- in Metaflow configuration.
1330
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1331
- Kubernetes namespace to use when launching pod in Kubernetes.
1332
- gpu : int, optional, default None
1333
- Number of GPUs required for this step. A value of zero implies that
1334
- the scheduled node should not have GPUs.
1335
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1336
- The vendor of the GPUs to be used for this step.
1337
- tolerations : List[str], default []
1338
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1339
- Kubernetes tolerations to use when launching pod in Kubernetes.
1340
- use_tmpfs : bool, default False
1341
- This enables an explicit tmpfs mount for this step.
1342
- tmpfs_tempdir : bool, default True
1343
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1344
- tmpfs_size : int, optional, default: None
1345
- The value for the size (in MiB) of the tmpfs mount for this step.
1346
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1347
- memory allocated for this step.
1348
- tmpfs_path : str, optional, default /metaflow_temp
1349
- Path to tmpfs mount for this step.
1350
- persistent_volume_claims : Dict[str, str], optional, default None
1351
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1352
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1353
- shared_memory: int, optional
1354
- Shared memory size (in MiB) required for this step
1355
- port: int, optional
1356
- Port number to specify in the Kubernetes job object
1357
- """
1358
- ...
1359
-
1360
- @typing.overload
1361
- def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1362
- """
1363
- Specifies environment variables to be set prior to the execution of a step.
1483
+ flow : Union[str, Dict[str, str]], optional, default None
1484
+ Upstream flow dependency for this flow.
1485
+ flows : List[Union[str, Dict[str, str]]], default []
1486
+ Upstream flow dependencies for this flow.
1487
+ options : Dict[str, Any], default {}
1488
+ Backend-specific configuration for tuning eventing behavior.
1364
1489
 
1365
- Parameters
1366
- ----------
1367
- vars : Dict[str, str], default {}
1368
- Dictionary of environment variables to set.
1369
- """
1370
- ...
1371
-
1372
- @typing.overload
1373
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1374
- ...
1375
-
1376
- @typing.overload
1377
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1378
- ...
1379
-
1380
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1381
- """
1382
- Specifies environment variables to be set prior to the execution of a step.
1383
1490
 
1384
- Parameters
1385
- ----------
1386
- vars : Dict[str, str], default {}
1387
- Dictionary of environment variables to set.
1388
1491
  """
1389
1492
  ...
1390
1493
 
@@ -1483,6 +1586,48 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1483
1586
  """
1484
1587
  ...
1485
1588
 
1589
+ 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]]:
1590
+ """
1591
+ 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)
1592
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1593
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1594
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1595
+ starts only after all sensors finish.
1596
+
1597
+ Parameters
1598
+ ----------
1599
+ timeout : int
1600
+ Time, in seconds before the task times out and fails. (Default: 3600)
1601
+ poke_interval : int
1602
+ Time in seconds that the job should wait in between each try. (Default: 60)
1603
+ mode : str
1604
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1605
+ exponential_backoff : bool
1606
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1607
+ pool : str
1608
+ the slot pool this task should run in,
1609
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1610
+ soft_fail : bool
1611
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1612
+ name : str
1613
+ Name of the sensor on Airflow
1614
+ description : str
1615
+ Description of sensor in the Airflow UI
1616
+ bucket_key : Union[str, List[str]]
1617
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1618
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1619
+ bucket_name : str
1620
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1621
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1622
+ wildcard_match : bool
1623
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1624
+ aws_conn_id : str
1625
+ a reference to the s3 connection on Airflow. (Default: None)
1626
+ verify : bool
1627
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1628
+ """
1629
+ ...
1630
+
1486
1631
  def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1487
1632
  """
1488
1633
  Specifies what flows belong to the same project.
@@ -1502,164 +1647,12 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
1502
1647
  ...
1503
1648
 
1504
1649
  @typing.overload
1505
- 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]]:
1650
+ 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]]:
1506
1651
  """
1507
- Specifies the times when the flow should be run when running on a
1508
- production scheduler.
1509
-
1510
- Parameters
1511
- ----------
1512
- hourly : bool, default False
1513
- Run the workflow hourly.
1514
- daily : bool, default True
1515
- Run the workflow daily.
1516
- weekly : bool, default False
1517
- Run the workflow weekly.
1518
- cron : str, optional, default None
1519
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1520
- specified by this expression.
1521
- timezone : str, optional, default None
1522
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1523
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1524
- """
1525
- ...
1526
-
1527
- @typing.overload
1528
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1529
- ...
1530
-
1531
- 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):
1532
- """
1533
- Specifies the times when the flow should be run when running on a
1534
- production scheduler.
1535
-
1536
- Parameters
1537
- ----------
1538
- hourly : bool, default False
1539
- Run the workflow hourly.
1540
- daily : bool, default True
1541
- Run the workflow daily.
1542
- weekly : bool, default False
1543
- Run the workflow weekly.
1544
- cron : str, optional, default None
1545
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1546
- specified by this expression.
1547
- timezone : str, optional, default None
1548
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1549
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1550
- """
1551
- ...
1552
-
1553
- @typing.overload
1554
- def trigger_on_finish(*, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1555
- """
1556
- Specifies the flow(s) that this flow depends on.
1557
-
1558
- ```
1559
- @trigger_on_finish(flow='FooFlow')
1560
- ```
1561
- or
1562
- ```
1563
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1564
- ```
1565
- This decorator respects the @project decorator and triggers the flow
1566
- when upstream runs within the same namespace complete successfully
1567
-
1568
- Additionally, you can specify project aware upstream flow dependencies
1569
- by specifying the fully qualified project_flow_name.
1570
- ```
1571
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1572
- ```
1573
- or
1574
- ```
1575
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1576
- ```
1577
-
1578
- You can also specify just the project or project branch (other values will be
1579
- inferred from the current project or project branch):
1580
- ```
1581
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1582
- ```
1583
-
1584
- Note that `branch` is typically one of:
1585
- - `prod`
1586
- - `user.bob`
1587
- - `test.my_experiment`
1588
- - `prod.staging`
1589
-
1590
- Parameters
1591
- ----------
1592
- flow : Union[str, Dict[str, str]], optional, default None
1593
- Upstream flow dependency for this flow.
1594
- flows : List[Union[str, Dict[str, str]]], default []
1595
- Upstream flow dependencies for this flow.
1596
- options : Dict[str, Any], default {}
1597
- Backend-specific configuration for tuning eventing behavior.
1598
-
1599
-
1600
- """
1601
- ...
1602
-
1603
- @typing.overload
1604
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1605
- ...
1606
-
1607
- def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[str, typing.Dict[str, str], None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1608
- """
1609
- Specifies the flow(s) that this flow depends on.
1610
-
1611
- ```
1612
- @trigger_on_finish(flow='FooFlow')
1613
- ```
1614
- or
1615
- ```
1616
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1617
- ```
1618
- This decorator respects the @project decorator and triggers the flow
1619
- when upstream runs within the same namespace complete successfully
1620
-
1621
- Additionally, you can specify project aware upstream flow dependencies
1622
- by specifying the fully qualified project_flow_name.
1623
- ```
1624
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1625
- ```
1626
- or
1627
- ```
1628
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1629
- ```
1630
-
1631
- You can also specify just the project or project branch (other values will be
1632
- inferred from the current project or project branch):
1633
- ```
1634
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1635
- ```
1636
-
1637
- Note that `branch` is typically one of:
1638
- - `prod`
1639
- - `user.bob`
1640
- - `test.my_experiment`
1641
- - `prod.staging`
1642
-
1643
- Parameters
1644
- ----------
1645
- flow : Union[str, Dict[str, str]], optional, default None
1646
- Upstream flow dependency for this flow.
1647
- flows : List[Union[str, Dict[str, str]]], default []
1648
- Upstream flow dependencies for this flow.
1649
- options : Dict[str, Any], default {}
1650
- Backend-specific configuration for tuning eventing behavior.
1651
-
1652
-
1653
- """
1654
- ...
1655
-
1656
- @typing.overload
1657
- 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]]:
1658
- """
1659
- Specifies the Conda environment for all steps of the flow.
1660
-
1661
- Use `@conda_base` to set common libraries required by all
1662
- steps and use `@conda` to specify step-specific additions.
1652
+ Specifies the Conda environment for all steps of the flow.
1653
+
1654
+ Use `@conda_base` to set common libraries required by all
1655
+ steps and use `@conda` to specify step-specific additions.
1663
1656
 
1664
1657
  Parameters
1665
1658
  ----------
@@ -1702,45 +1695,6 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1702
1695
  """
1703
1696
  ...
1704
1697
 
1705
- @typing.overload
1706
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1707
- """
1708
- Specifies the PyPI packages for all steps of the flow.
1709
-
1710
- Use `@pypi_base` to set common packages required by all
1711
- steps and use `@pypi` to specify step-specific overrides.
1712
- Parameters
1713
- ----------
1714
- packages : Dict[str, str], default: {}
1715
- Packages to use for this flow. The key is the name of the package
1716
- and the value is the version to use.
1717
- python : str, optional, default: None
1718
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1719
- that the version used will correspond to the version of the Python interpreter used to start the run.
1720
- """
1721
- ...
1722
-
1723
- @typing.overload
1724
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1725
- ...
1726
-
1727
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1728
- """
1729
- Specifies the PyPI packages for all steps of the flow.
1730
-
1731
- Use `@pypi_base` to set common packages required by all
1732
- steps and use `@pypi` to specify step-specific overrides.
1733
- Parameters
1734
- ----------
1735
- packages : Dict[str, str], default: {}
1736
- Packages to use for this flow. The key is the name of the package
1737
- and the value is the version to use.
1738
- python : str, optional, default: None
1739
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1740
- that the version used will correspond to the version of the Python interpreter used to start the run.
1741
- """
1742
- ...
1743
-
1744
1698
  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]]:
1745
1699
  """
1746
1700
  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.
@@ -1783,45 +1737,91 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1783
1737
  """
1784
1738
  ...
1785
1739
 
1786
- 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]]:
1740
+ @typing.overload
1741
+ 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]]:
1787
1742
  """
1788
- 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)
1789
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1790
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1791
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1792
- starts only after all sensors finish.
1743
+ Specifies the times when the flow should be run when running on a
1744
+ production scheduler.
1793
1745
 
1794
1746
  Parameters
1795
1747
  ----------
1796
- timeout : int
1797
- Time, in seconds before the task times out and fails. (Default: 3600)
1798
- poke_interval : int
1799
- Time in seconds that the job should wait in between each try. (Default: 60)
1800
- mode : str
1801
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1802
- exponential_backoff : bool
1803
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1804
- pool : str
1805
- the slot pool this task should run in,
1806
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1807
- soft_fail : bool
1808
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1809
- name : str
1810
- Name of the sensor on Airflow
1811
- description : str
1812
- Description of sensor in the Airflow UI
1813
- bucket_key : Union[str, List[str]]
1814
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1815
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1816
- bucket_name : str
1817
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1818
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1819
- wildcard_match : bool
1820
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1821
- aws_conn_id : str
1822
- a reference to the s3 connection on Airflow. (Default: None)
1823
- verify : bool
1824
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1748
+ hourly : bool, default False
1749
+ Run the workflow hourly.
1750
+ daily : bool, default True
1751
+ Run the workflow daily.
1752
+ weekly : bool, default False
1753
+ Run the workflow weekly.
1754
+ cron : str, optional, default None
1755
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1756
+ specified by this expression.
1757
+ timezone : str, optional, default None
1758
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1759
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1760
+ """
1761
+ ...
1762
+
1763
+ @typing.overload
1764
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1765
+ ...
1766
+
1767
+ 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):
1768
+ """
1769
+ Specifies the times when the flow should be run when running on a
1770
+ production scheduler.
1771
+
1772
+ Parameters
1773
+ ----------
1774
+ hourly : bool, default False
1775
+ Run the workflow hourly.
1776
+ daily : bool, default True
1777
+ Run the workflow daily.
1778
+ weekly : bool, default False
1779
+ Run the workflow weekly.
1780
+ cron : str, optional, default None
1781
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1782
+ specified by this expression.
1783
+ timezone : str, optional, default None
1784
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1785
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1786
+ """
1787
+ ...
1788
+
1789
+ @typing.overload
1790
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1791
+ """
1792
+ Specifies the PyPI packages for all steps of the flow.
1793
+
1794
+ Use `@pypi_base` to set common packages required by all
1795
+ steps and use `@pypi` to specify step-specific overrides.
1796
+ Parameters
1797
+ ----------
1798
+ packages : Dict[str, str], default: {}
1799
+ Packages to use for this flow. The key is the name of the package
1800
+ and the value is the version to use.
1801
+ python : str, optional, default: None
1802
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1803
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1804
+ """
1805
+ ...
1806
+
1807
+ @typing.overload
1808
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1809
+ ...
1810
+
1811
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1812
+ """
1813
+ Specifies the PyPI packages for all steps of the flow.
1814
+
1815
+ Use `@pypi_base` to set common packages required by all
1816
+ steps and use `@pypi` to specify step-specific overrides.
1817
+ Parameters
1818
+ ----------
1819
+ packages : Dict[str, str], default: {}
1820
+ Packages to use for this flow. The key is the name of the package
1821
+ and the value is the version to use.
1822
+ python : str, optional, default: None
1823
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1824
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1825
1825
  """
1826
1826
  ...
1827
1827