metaflow-stubs 2.11.8__py2.py3-none-any.whl → 2.11.10__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 +486 -484
  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 +2 -2
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +3 -3
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +5 -5
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +5 -5
  13. metaflow-stubs/metadata/metadata.pyi +3 -3
  14. metaflow-stubs/metadata/util.pyi +2 -2
  15. metaflow-stubs/metaflow_config.pyi +4 -2
  16. metaflow-stubs/metaflow_current.pyi +6 -6
  17. metaflow-stubs/mflog/mflog.pyi +2 -2
  18. metaflow-stubs/multicore_utils.pyi +2 -2
  19. metaflow-stubs/parameters.pyi +4 -4
  20. metaflow-stubs/plugins/__init__.pyi +2 -2
  21. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/airflow.pyi +4 -4
  23. metaflow-stubs/plugins/airflow/airflow_cli.pyi +3 -3
  24. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  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 +4 -4
  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 +3 -3
  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 +4 -4
  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 +3 -3
  67. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  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 +4 -4
  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 +3 -3
  81. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  82. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  83. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  84. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  85. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  86. metaflow-stubs/plugins/datatools/s3/s3.pyi +7 -7
  87. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  88. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  89. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  90. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  91. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  92. metaflow-stubs/plugins/events_decorator.pyi +3 -3
  93. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  94. metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
  95. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  96. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  97. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  98. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  99. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  100. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
  102. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +4 -4
  103. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +5 -3
  105. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  106. metaflow-stubs/plugins/package_cli.pyi +2 -2
  107. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/project_decorator.pyi +3 -3
  109. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  110. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  111. metaflow-stubs/plugins/pypi/conda_environment.pyi +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 +4 -4
  122. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  123. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  124. metaflow-stubs/procpoll.pyi +2 -2
  125. metaflow-stubs/pylint_wrapper.pyi +2 -2
  126. metaflow-stubs/tagging_util.pyi +2 -2
  127. metaflow-stubs/version.pyi +2 -2
  128. {metaflow_stubs-2.11.8.dist-info → metaflow_stubs-2.11.10.dist-info}/METADATA +2 -2
  129. metaflow_stubs-2.11.10.dist-info/RECORD +132 -0
  130. metaflow_stubs-2.11.8.dist-info/RECORD +0 -132
  131. {metaflow_stubs-2.11.8.dist-info → metaflow_stubs-2.11.10.dist-info}/WHEEL +0 -0
  132. {metaflow_stubs-2.11.8.dist-info → metaflow_stubs-2.11.10.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.8 #
4
- # Generated on 2024-03-29T12:37:59.184463 #
3
+ # MF version: 2.11.10 #
4
+ # Generated on 2024-04-12T11:08:34.072022 #
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.events
12
- import metaflow.plugins.datatools.s3.s3
13
- import metaflow._vendor.click.types
11
+ import metaflow.metaflow_current
12
+ import io
14
13
  import metaflow.client.core
15
- import metaflow.datastore.inputs
16
- import typing
17
14
  import metaflow.parameters
18
15
  import datetime
19
- import io
20
- import metaflow.metaflow_current
16
+ import metaflow.events
17
+ import metaflow._vendor.click.types
18
+ import typing
19
+ 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
 
@@ -726,86 +726,59 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
726
726
  ...
727
727
 
728
728
  @typing.overload
729
- def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
730
- """
731
- Specifies environment variables to be set prior to the execution of a step.
732
-
733
- Parameters
734
- ----------
735
- vars : Dict[str, str], default {}
736
- Dictionary of environment variables to set.
737
- """
738
- ...
739
-
740
- @typing.overload
741
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
742
- ...
743
-
744
- @typing.overload
745
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
746
- ...
747
-
748
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
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]]]:
749
730
  """
750
- Specifies environment variables to be set prior to the execution of a step.
731
+ Specifies a timeout for your step.
751
732
 
752
- Parameters
753
- ----------
754
- vars : Dict[str, str], default {}
755
- Dictionary of environment variables to set.
756
- """
757
- ...
758
-
759
- @typing.overload
760
- 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]]]:
761
- """
762
- Specifies the number of times the task corresponding
763
- to a step needs to be retried.
733
+ This decorator is useful if this step may hang indefinitely.
764
734
 
765
- This decorator is useful for handling transient errors, such as networking issues.
766
- If your task contains operations that can't be retried safely, e.g. database updates,
767
- it is advisable to annotate it with `@retry(times=0)`.
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.
768
738
 
769
- This can be used in conjunction with the `@catch` decorator. The `@catch`
770
- decorator will execute a no-op task after all retries have been exhausted,
771
- ensuring that the flow execution can continue.
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.
772
741
 
773
742
  Parameters
774
743
  ----------
775
- times : int, default 3
776
- Number of times to retry this task.
777
- minutes_between_retries : int, default 2
778
- Number of minutes between retries.
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.
779
750
  """
780
751
  ...
781
752
 
782
753
  @typing.overload
783
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
754
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
784
755
  ...
785
756
 
786
757
  @typing.overload
787
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
758
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
788
759
  ...
789
760
 
790
- 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):
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):
791
762
  """
792
- Specifies the number of times the task corresponding
793
- to a step needs to be retried.
763
+ Specifies a timeout for your step.
794
764
 
795
- This decorator is useful for handling transient errors, such as networking issues.
796
- If your task contains operations that can't be retried safely, e.g. database updates,
797
- it is advisable to annotate it with `@retry(times=0)`.
765
+ This decorator is useful if this step may hang indefinitely.
798
766
 
799
- This can be used in conjunction with the `@catch` decorator. The `@catch`
800
- decorator will execute a no-op task after all retries have been exhausted,
801
- ensuring that the flow execution can continue.
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.
802
773
 
803
774
  Parameters
804
775
  ----------
805
- times : int, default 3
806
- Number of times to retry this task.
807
- minutes_between_retries : int, default 2
808
- Number of minutes between retries.
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.
809
782
  """
810
783
  ...
811
784
 
@@ -886,6 +859,112 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
886
859
  """
887
860
  ...
888
861
 
862
+ @typing.overload
863
+ 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
+ """
865
+ Specifies the PyPI packages for the step.
866
+
867
+ Information in this decorator will augment any
868
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
869
+ you can use `@pypi_base` to set packages required by all
870
+ steps and use `@pypi` to specify step-specific overrides.
871
+
872
+ Parameters
873
+ ----------
874
+ packages : Dict[str, str], default: {}
875
+ Packages to use for this step. The key is the name of the package
876
+ and the value is the version to use.
877
+ python : str, optional, default: None
878
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
879
+ that the version used will correspond to the version of the Python interpreter used to start the run.
880
+ """
881
+ ...
882
+
883
+ @typing.overload
884
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
885
+ ...
886
+
887
+ @typing.overload
888
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
889
+ ...
890
+
891
+ 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):
892
+ """
893
+ Specifies the PyPI packages for the step.
894
+
895
+ Information in this decorator will augment any
896
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
897
+ you can use `@pypi_base` to set packages required by all
898
+ steps and use `@pypi` to specify step-specific overrides.
899
+
900
+ Parameters
901
+ ----------
902
+ packages : Dict[str, str], default: {}
903
+ Packages to use for this step. The key is the name of the package
904
+ and the value is the version to use.
905
+ python : str, optional, default: None
906
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
907
+ that the version used will correspond to the version of the Python interpreter used to start the run.
908
+ """
909
+ ...
910
+
911
+ @typing.overload
912
+ 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
+ """
914
+ Specifies the Conda environment for the step.
915
+
916
+ Information in this decorator will augment any
917
+ attributes set in the `@conda_base` flow-level decorator. Hence,
918
+ you can use `@conda_base` to set packages required by all
919
+ steps and use `@conda` to specify step-specific overrides.
920
+
921
+ Parameters
922
+ ----------
923
+ packages : Dict[str, str], default {}
924
+ Packages to use for this step. The key is the name of the package
925
+ and the value is the version to use.
926
+ libraries : Dict[str, str], default {}
927
+ Supported for backward compatibility. When used with packages, packages will take precedence.
928
+ python : str, optional, default None
929
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
930
+ that the version used will correspond to the version of the Python interpreter used to start the run.
931
+ disabled : bool, default False
932
+ If set to True, disables @conda.
933
+ """
934
+ ...
935
+
936
+ @typing.overload
937
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
938
+ ...
939
+
940
+ @typing.overload
941
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
942
+ ...
943
+
944
+ 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):
945
+ """
946
+ Specifies the Conda environment for the step.
947
+
948
+ Information in this decorator will augment any
949
+ attributes set in the `@conda_base` flow-level decorator. Hence,
950
+ you can use `@conda_base` to set packages required by all
951
+ steps and use `@conda` to specify step-specific overrides.
952
+
953
+ Parameters
954
+ ----------
955
+ packages : Dict[str, str], default {}
956
+ Packages to use for this step. The key is the name of the package
957
+ and the value is the version to use.
958
+ libraries : Dict[str, str], default {}
959
+ Supported for backward compatibility. When used with packages, packages will take precedence.
960
+ python : str, optional, default None
961
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
962
+ that the version used will correspond to the version of the Python interpreter used to start the run.
963
+ disabled : bool, default False
964
+ If set to True, disables @conda.
965
+ """
966
+ ...
967
+
889
968
  @typing.overload
890
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]]]:
891
970
  """
@@ -936,46 +1015,99 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
936
1015
  ...
937
1016
 
938
1017
  @typing.overload
939
- 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]]]:
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]]]:
940
1019
  """
941
- Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
1020
+ Specifies the number of times the task corresponding
1021
+ to a step needs to be retried.
1022
+
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)`.
1026
+
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.
942
1030
 
943
1031
  Parameters
944
1032
  ----------
945
- cpu : int, default 1
946
- Number of CPUs required for this step. If `@resources` is
947
- also present, the maximum value from all decorators is used.
948
- gpu : int, default 0
949
- Number of GPUs required for this step. If `@resources` is
950
- also present, the maximum value from all decorators is used.
951
- memory : int, default 4096
952
- Memory size (in MB) required for this step. If
953
- `@resources` is also present, the maximum value from all decorators is
954
- used.
955
- image : str, optional, default None
956
- Docker image to use when launching on AWS Batch. If not specified, and
957
- METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
958
- not, a default Docker image mapping to the current version of Python is used.
959
- queue : str, default METAFLOW_BATCH_JOB_QUEUE
960
- AWS Batch Job Queue to submit the job to.
961
- iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
962
- AWS IAM role that AWS Batch container uses to access AWS cloud resources.
963
- execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
964
- AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
965
- (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
966
- shared_memory : int, optional, default None
967
- The value for the size (in MiB) of the /dev/shm volume for this step.
968
- This parameter maps to the `--shm-size` option in Docker.
969
- max_swap : int, optional, default None
970
- The total amount of swap memory (in MiB) a container can use for this
971
- step. This parameter is translated to the `--memory-swap` option in
972
- Docker where the value is the sum of the container memory plus the
973
- `max_swap` value.
974
- swappiness : int, optional, default None
975
- This allows you to tune memory swappiness behavior for this step.
976
- A swappiness value of 0 causes swapping not to happen unless absolutely
977
- necessary. A swappiness value of 100 causes pages to be swapped very
978
- aggressively. Accepted values are whole numbers between 0 and 100.
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.
1037
+ """
1038
+ ...
1039
+
1040
+ @typing.overload
1041
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1042
+ ...
1043
+
1044
+ @typing.overload
1045
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1046
+ ...
1047
+
1048
+ 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):
1049
+ """
1050
+ Specifies the number of times the task corresponding
1051
+ to a step needs to be retried.
1052
+
1053
+ This decorator is useful for handling transient errors, such as networking issues.
1054
+ If your task contains operations that can't be retried safely, e.g. database updates,
1055
+ it is advisable to annotate it with `@retry(times=0)`.
1056
+
1057
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1058
+ decorator will execute a no-op task after all retries have been exhausted,
1059
+ ensuring that the flow execution can continue.
1060
+
1061
+ Parameters
1062
+ ----------
1063
+ times : int, default 3
1064
+ Number of times to retry this task.
1065
+ minutes_between_retries : int, default 2
1066
+ Number of minutes between retries.
1067
+ """
1068
+ ...
1069
+
1070
+ @typing.overload
1071
+ 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
+ """
1073
+ Specifies that this step should execute on [AWS Batch](https://aws.amazon.com/batch/).
1074
+
1075
+ Parameters
1076
+ ----------
1077
+ cpu : int, default 1
1078
+ Number of CPUs required for this step. If `@resources` is
1079
+ also present, the maximum value from all decorators is used.
1080
+ gpu : int, default 0
1081
+ Number of GPUs required for this step. If `@resources` is
1082
+ also present, the maximum value from all decorators is used.
1083
+ memory : int, default 4096
1084
+ Memory size (in MB) required for this step. If
1085
+ `@resources` is also present, the maximum value from all decorators is
1086
+ used.
1087
+ image : str, optional, default None
1088
+ Docker image to use when launching on AWS Batch. If not specified, and
1089
+ METAFLOW_BATCH_CONTAINER_IMAGE is specified, that image is used. If
1090
+ not, a default Docker image mapping to the current version of Python is used.
1091
+ queue : str, default METAFLOW_BATCH_JOB_QUEUE
1092
+ AWS Batch Job Queue to submit the job to.
1093
+ iam_role : str, default METAFLOW_ECS_S3_ACCESS_IAM_ROLE
1094
+ AWS IAM role that AWS Batch container uses to access AWS cloud resources.
1095
+ execution_role : str, default METAFLOW_ECS_FARGATE_EXECUTION_ROLE
1096
+ AWS IAM role that AWS Batch can use [to trigger AWS Fargate tasks]
1097
+ (https://docs.aws.amazon.com/batch/latest/userguide/execution-IAM-role.html).
1098
+ shared_memory : int, optional, default None
1099
+ The value for the size (in MiB) of the /dev/shm volume for this step.
1100
+ This parameter maps to the `--shm-size` option in Docker.
1101
+ max_swap : int, optional, default None
1102
+ The total amount of swap memory (in MiB) a container can use for this
1103
+ step. This parameter is translated to the `--memory-swap` option in
1104
+ Docker where the value is the sum of the container memory plus the
1105
+ `max_swap` value.
1106
+ swappiness : int, optional, default None
1107
+ This allows you to tune memory swappiness behavior for this step.
1108
+ A swappiness value of 0 causes swapping not to happen unless absolutely
1109
+ necessary. A swappiness value of 100 causes pages to be swapped very
1110
+ aggressively. Accepted values are whole numbers between 0 and 100.
979
1111
  use_tmpfs : bool, default False
980
1112
  This enables an explicit tmpfs mount for this step. Note that tmpfs is
981
1113
  not available on Fargate compute environments
@@ -1082,57 +1214,6 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1082
1214
  """
1083
1215
  ...
1084
1216
 
1085
- @typing.overload
1086
- 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]]]:
1087
- """
1088
- Creates a human-readable report, a Metaflow Card, after this step completes.
1089
-
1090
- Note that you may add multiple `@card` decorators in a step with different parameters.
1091
-
1092
- Parameters
1093
- ----------
1094
- type : str, default 'default'
1095
- Card type.
1096
- id : str, optional, default None
1097
- If multiple cards are present, use this id to identify this card.
1098
- options : Dict[str, Any], default {}
1099
- Options passed to the card. The contents depend on the card type.
1100
- timeout : int, default 45
1101
- Interrupt reporting if it takes more than this many seconds.
1102
-
1103
-
1104
- """
1105
- ...
1106
-
1107
- @typing.overload
1108
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1109
- ...
1110
-
1111
- @typing.overload
1112
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1113
- ...
1114
-
1115
- 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):
1116
- """
1117
- Creates a human-readable report, a Metaflow Card, after this step completes.
1118
-
1119
- Note that you may add multiple `@card` decorators in a step with different parameters.
1120
-
1121
- Parameters
1122
- ----------
1123
- type : str, default 'default'
1124
- Card type.
1125
- id : str, optional, default None
1126
- If multiple cards are present, use this id to identify this card.
1127
- options : Dict[str, Any], default {}
1128
- Options passed to the card. The contents depend on the card type.
1129
- timeout : int, default 45
1130
- Interrupt reporting if it takes more than this many seconds.
1131
-
1132
-
1133
- """
1134
- ...
1135
-
1136
1217
  @typing.overload
1137
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]]]:
1138
1219
  """
@@ -1167,112 +1248,57 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
1167
1248
  ...
1168
1249
 
1169
1250
  @typing.overload
1170
- 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]]]:
1171
- """
1172
- Specifies a timeout for your step.
1173
-
1174
- This decorator is useful if this step may hang indefinitely.
1175
-
1176
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1177
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1178
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1179
-
1180
- Note that all the values specified in parameters are added together so if you specify
1181
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1182
-
1183
- Parameters
1184
- ----------
1185
- seconds : int, default 0
1186
- Number of seconds to wait prior to timing out.
1187
- minutes : int, default 0
1188
- Number of minutes to wait prior to timing out.
1189
- hours : int, default 0
1190
- Number of hours to wait prior to timing out.
1191
- """
1192
- ...
1193
-
1194
- @typing.overload
1195
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1196
- ...
1197
-
1198
- @typing.overload
1199
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1200
- ...
1201
-
1202
- 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):
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]]]:
1203
1252
  """
1204
- Specifies a timeout for your step.
1205
-
1206
- This decorator is useful if this step may hang indefinitely.
1207
-
1208
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1209
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1210
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1253
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1211
1254
 
1212
- Note that all the values specified in parameters are added together so if you specify
1213
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1255
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1214
1256
 
1215
1257
  Parameters
1216
1258
  ----------
1217
- seconds : int, default 0
1218
- Number of seconds to wait prior to timing out.
1219
- minutes : int, default 0
1220
- Number of minutes to wait prior to timing out.
1221
- hours : int, default 0
1222
- Number of hours to wait prior to timing out.
1223
- """
1224
- ...
1225
-
1226
- @typing.overload
1227
- 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
- """
1229
- Specifies the PyPI packages for the step.
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.
1263
+ 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.
1230
1267
 
1231
- Information in this decorator will augment any
1232
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1233
- you can use `@pypi_base` to set packages required by all
1234
- steps and use `@pypi` to specify step-specific overrides.
1235
1268
 
1236
- Parameters
1237
- ----------
1238
- packages : Dict[str, str], default: {}
1239
- Packages to use for this step. The key is the name of the package
1240
- and the value is the version to use.
1241
- python : str, optional, default: None
1242
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1243
- that the version used will correspond to the version of the Python interpreter used to start the run.
1244
1269
  """
1245
1270
  ...
1246
1271
 
1247
1272
  @typing.overload
1248
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1273
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1249
1274
  ...
1250
1275
 
1251
1276
  @typing.overload
1252
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1277
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1253
1278
  ...
1254
1279
 
1255
- 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):
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):
1256
1281
  """
1257
- Specifies the PyPI packages for the step.
1282
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1258
1283
 
1259
- Information in this decorator will augment any
1260
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1261
- you can use `@pypi_base` to set packages required by all
1262
- steps and use `@pypi` to specify step-specific overrides.
1284
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1263
1285
 
1264
1286
  Parameters
1265
1287
  ----------
1266
- packages : Dict[str, str], default: {}
1267
- Packages to use for this step. The key is the name of the package
1268
- and the value is the version to use.
1269
- python : str, optional, default: None
1270
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1271
- that the version used will correspond to the version of the Python interpreter used to start the run.
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.
1296
+
1297
+
1272
1298
  """
1273
1299
  ...
1274
1300
 
1275
- 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) -> 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]]]:
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]]]:
1276
1302
  """
1277
1303
  Specifies that this step should execute on Kubernetes.
1278
1304
 
@@ -1326,166 +1352,39 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
1326
1352
  volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1327
1353
  shared_memory: int, optional
1328
1354
  Shared memory size (in MiB) required for this step
1355
+ port: int, optional
1356
+ Port number to specify in the Kubernetes job object
1329
1357
  """
1330
1358
  ...
1331
1359
 
1332
1360
  @typing.overload
1333
- 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]]]:
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]]]:
1334
1362
  """
1335
- Specifies the Conda environment for the step.
1336
-
1337
- Information in this decorator will augment any
1338
- attributes set in the `@conda_base` flow-level decorator. Hence,
1339
- you can use `@conda_base` to set packages required by all
1340
- steps and use `@conda` to specify step-specific overrides.
1363
+ Specifies environment variables to be set prior to the execution of a step.
1341
1364
 
1342
1365
  Parameters
1343
1366
  ----------
1344
- packages : Dict[str, str], default {}
1345
- Packages to use for this step. The key is the name of the package
1346
- and the value is the version to use.
1347
- libraries : Dict[str, str], default {}
1348
- Supported for backward compatibility. When used with packages, packages will take precedence.
1349
- python : str, optional, default None
1350
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1351
- that the version used will correspond to the version of the Python interpreter used to start the run.
1352
- disabled : bool, default False
1353
- If set to True, disables @conda.
1354
- """
1355
- ...
1356
-
1357
- @typing.overload
1358
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1359
- ...
1360
-
1361
- @typing.overload
1362
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1363
- ...
1364
-
1365
- 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):
1366
- """
1367
- Specifies the Conda environment for the step.
1368
-
1369
- Information in this decorator will augment any
1370
- attributes set in the `@conda_base` flow-level decorator. Hence,
1371
- you can use `@conda_base` to set packages required by all
1372
- steps and use `@conda` to specify step-specific overrides.
1373
-
1374
- Parameters
1375
- ----------
1376
- packages : Dict[str, str], default {}
1377
- Packages to use for this step. The key is the name of the package
1378
- and the value is the version to use.
1379
- libraries : Dict[str, str], default {}
1380
- Supported for backward compatibility. When used with packages, packages will take precedence.
1381
- python : str, optional, default None
1382
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1383
- that the version used will correspond to the version of the Python interpreter used to start the run.
1384
- disabled : bool, default False
1385
- If set to True, disables @conda.
1367
+ vars : Dict[str, str], default {}
1368
+ Dictionary of environment variables to set.
1386
1369
  """
1387
1370
  ...
1388
1371
 
1389
1372
  @typing.overload
1390
- 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]]:
1391
- """
1392
- Specifies the flow(s) that this flow depends on.
1393
-
1394
- ```
1395
- @trigger_on_finish(flow='FooFlow')
1396
- ```
1397
- or
1398
- ```
1399
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1400
- ```
1401
- This decorator respects the @project decorator and triggers the flow
1402
- when upstream runs within the same namespace complete successfully
1403
-
1404
- Additionally, you can specify project aware upstream flow dependencies
1405
- by specifying the fully qualified project_flow_name.
1406
- ```
1407
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1408
- ```
1409
- or
1410
- ```
1411
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1412
- ```
1413
-
1414
- You can also specify just the project or project branch (other values will be
1415
- inferred from the current project or project branch):
1416
- ```
1417
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1418
- ```
1419
-
1420
- Note that `branch` is typically one of:
1421
- - `prod`
1422
- - `user.bob`
1423
- - `test.my_experiment`
1424
- - `prod.staging`
1425
-
1426
- Parameters
1427
- ----------
1428
- flow : Union[str, Dict[str, str]], optional, default None
1429
- Upstream flow dependency for this flow.
1430
- flows : List[Union[str, Dict[str, str]]], default []
1431
- Upstream flow dependencies for this flow.
1432
- options : Dict[str, Any], default {}
1433
- Backend-specific configuration for tuning eventing behavior.
1434
-
1435
-
1436
- """
1373
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1437
1374
  ...
1438
1375
 
1439
1376
  @typing.overload
1440
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1377
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1441
1378
  ...
1442
1379
 
1443
- 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] = {}):
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] = {}):
1444
1381
  """
1445
- Specifies the flow(s) that this flow depends on.
1446
-
1447
- ```
1448
- @trigger_on_finish(flow='FooFlow')
1449
- ```
1450
- or
1451
- ```
1452
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1453
- ```
1454
- This decorator respects the @project decorator and triggers the flow
1455
- when upstream runs within the same namespace complete successfully
1456
-
1457
- Additionally, you can specify project aware upstream flow dependencies
1458
- by specifying the fully qualified project_flow_name.
1459
- ```
1460
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1461
- ```
1462
- or
1463
- ```
1464
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1465
- ```
1466
-
1467
- You can also specify just the project or project branch (other values will be
1468
- inferred from the current project or project branch):
1469
- ```
1470
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1471
- ```
1472
-
1473
- Note that `branch` is typically one of:
1474
- - `prod`
1475
- - `user.bob`
1476
- - `test.my_experiment`
1477
- - `prod.staging`
1382
+ Specifies environment variables to be set prior to the execution of a step.
1478
1383
 
1479
1384
  Parameters
1480
1385
  ----------
1481
- flow : Union[str, Dict[str, str]], optional, default None
1482
- Upstream flow dependency for this flow.
1483
- flows : List[Union[str, Dict[str, str]]], default []
1484
- Upstream flow dependencies for this flow.
1485
- options : Dict[str, Any], default {}
1486
- Backend-specific configuration for tuning eventing behavior.
1487
-
1488
-
1386
+ vars : Dict[str, str], default {}
1387
+ Dictionary of environment variables to set.
1489
1388
  """
1490
1389
  ...
1491
1390
 
@@ -1584,42 +1483,21 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1584
1483
  """
1585
1484
  ...
1586
1485
 
1587
- @typing.overload
1588
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1486
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1589
1487
  """
1590
- Specifies the PyPI packages for all steps of the flow.
1488
+ Specifies what flows belong to the same project.
1591
1489
 
1592
- Use `@pypi_base` to set common packages required by all
1593
- steps and use `@pypi` to specify step-specific overrides.
1594
- Parameters
1595
- ----------
1596
- packages : Dict[str, str], default: {}
1597
- Packages to use for this flow. The key is the name of the package
1598
- and the value is the version to use.
1599
- python : str, optional, default: None
1600
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1601
- that the version used will correspond to the version of the Python interpreter used to start the run.
1602
- """
1603
- ...
1604
-
1605
- @typing.overload
1606
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1607
- ...
1608
-
1609
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1610
- """
1611
- Specifies the PyPI packages for all steps of the flow.
1490
+ A project-specific namespace is created for all flows that
1491
+ use the same `@project(name)`.
1612
1492
 
1613
- Use `@pypi_base` to set common packages required by all
1614
- steps and use `@pypi` to specify step-specific overrides.
1615
1493
  Parameters
1616
1494
  ----------
1617
- packages : Dict[str, str], default: {}
1618
- Packages to use for this flow. The key is the name of the package
1619
- and the value is the version to use.
1620
- python : str, optional, default: None
1621
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1622
- that the version used will correspond to the version of the Python interpreter used to start the run.
1495
+ name : str
1496
+ Project name. Make sure that the name is unique amongst all
1497
+ projects that use the same production scheduler. The name may
1498
+ contain only lowercase alphanumeric characters and underscores.
1499
+
1500
+
1623
1501
  """
1624
1502
  ...
1625
1503
 
@@ -1672,87 +1550,106 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1672
1550
  """
1673
1551
  ...
1674
1552
 
1675
- 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]]:
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]]:
1676
1555
  """
1677
- 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)
1678
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1679
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1680
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1681
- starts only after all sensors finish.
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`
1682
1589
 
1683
1590
  Parameters
1684
1591
  ----------
1685
- timeout : int
1686
- Time, in seconds before the task times out and fails. (Default: 3600)
1687
- poke_interval : int
1688
- Time in seconds that the job should wait in between each try. (Default: 60)
1689
- mode : str
1690
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1691
- exponential_backoff : bool
1692
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1693
- pool : str
1694
- the slot pool this task should run in,
1695
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1696
- soft_fail : bool
1697
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1698
- name : str
1699
- Name of the sensor on Airflow
1700
- description : str
1701
- Description of sensor in the Airflow UI
1702
- bucket_key : Union[str, List[str]]
1703
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1704
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1705
- bucket_name : str
1706
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1707
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1708
- wildcard_match : bool
1709
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1710
- aws_conn_id : str
1711
- a reference to the s3 connection on Airflow. (Default: None)
1712
- verify : bool
1713
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
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
+
1714
1600
  """
1715
1601
  ...
1716
1602
 
1717
- 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]]:
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] = {}):
1718
1608
  """
1719
- 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.
1720
- This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
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`
1721
1642
 
1722
1643
  Parameters
1723
1644
  ----------
1724
- timeout : int
1725
- Time, in seconds before the task times out and fails. (Default: 3600)
1726
- poke_interval : int
1727
- Time in seconds that the job should wait in between each try. (Default: 60)
1728
- mode : str
1729
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1730
- exponential_backoff : bool
1731
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1732
- pool : str
1733
- the slot pool this task should run in,
1734
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1735
- soft_fail : bool
1736
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1737
- name : str
1738
- Name of the sensor on Airflow
1739
- description : str
1740
- Description of sensor in the Airflow UI
1741
- external_dag_id : str
1742
- The dag_id that contains the task you want to wait for.
1743
- external_task_ids : List[str]
1744
- The list of task_ids that you want to wait for.
1745
- If None (default value) the sensor waits for the DAG. (Default: None)
1746
- allowed_states : List[str]
1747
- Iterable of allowed states, (Default: ['success'])
1748
- failed_states : List[str]
1749
- Iterable of failed or dis-allowed states. (Default: None)
1750
- execution_delta : datetime.timedelta
1751
- time difference with the previous execution to look at,
1752
- the default is the same logical date as the current task or DAG. (Default: None)
1753
- check_existence: bool
1754
- Set to True to check if the external task exists or check if
1755
- the DAG to wait for exists. (Default: True)
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
+
1756
1653
  """
1757
1654
  ...
1758
1655
 
@@ -1805,21 +1702,126 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1805
1702
  """
1806
1703
  ...
1807
1704
 
1808
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
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]]:
1809
1707
  """
1810
- Specifies what flows belong to the same project.
1708
+ Specifies the PyPI packages for all steps of the flow.
1811
1709
 
1812
- A project-specific namespace is created for all flows that
1813
- use the same `@project(name)`.
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.
1814
1730
 
1731
+ Use `@pypi_base` to set common packages required by all
1732
+ steps and use `@pypi` to specify step-specific overrides.
1815
1733
  Parameters
1816
1734
  ----------
1817
- name : str
1818
- Project name. Make sure that the name is unique amongst all
1819
- projects that use the same production scheduler. The name may
1820
- contain only lowercase alphanumeric characters and underscores.
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
+ 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
+ """
1746
+ 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.
1747
+ This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1821
1748
 
1749
+ Parameters
1750
+ ----------
1751
+ timeout : int
1752
+ Time, in seconds before the task times out and fails. (Default: 3600)
1753
+ poke_interval : int
1754
+ Time in seconds that the job should wait in between each try. (Default: 60)
1755
+ mode : str
1756
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1757
+ exponential_backoff : bool
1758
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1759
+ pool : str
1760
+ the slot pool this task should run in,
1761
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1762
+ soft_fail : bool
1763
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1764
+ name : str
1765
+ Name of the sensor on Airflow
1766
+ description : str
1767
+ Description of sensor in the Airflow UI
1768
+ external_dag_id : str
1769
+ The dag_id that contains the task you want to wait for.
1770
+ external_task_ids : List[str]
1771
+ The list of task_ids that you want to wait for.
1772
+ If None (default value) the sensor waits for the DAG. (Default: None)
1773
+ allowed_states : List[str]
1774
+ Iterable of allowed states, (Default: ['success'])
1775
+ failed_states : List[str]
1776
+ Iterable of failed or dis-allowed states. (Default: None)
1777
+ execution_delta : datetime.timedelta
1778
+ time difference with the previous execution to look at,
1779
+ the default is the same logical date as the current task or DAG. (Default: None)
1780
+ check_existence: bool
1781
+ Set to True to check if the external task exists or check if
1782
+ the DAG to wait for exists. (Default: True)
1783
+ """
1784
+ ...
1785
+
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]]:
1787
+ """
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.
1822
1793
 
1794
+ Parameters
1795
+ ----------
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)
1823
1825
  """
1824
1826
  ...
1825
1827