metaflow-stubs 2.12.25__py2.py3-none-any.whl → 2.12.27__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 (152) hide show
  1. metaflow-stubs/__init__.pyi +420 -417
  2. metaflow-stubs/cards.pyi +6 -6
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +6 -6
  5. metaflow-stubs/client/core.pyi +9 -7
  6. metaflow-stubs/client/filecache.pyi +3 -3
  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 +4 -4
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +4 -4
  13. metaflow-stubs/info_file.pyi +2 -2
  14. metaflow-stubs/metadata/metadata.pyi +6 -3
  15. metaflow-stubs/metadata/util.pyi +2 -2
  16. metaflow-stubs/metaflow_config.pyi +2 -2
  17. metaflow-stubs/metaflow_current.pyi +33 -32
  18. metaflow-stubs/mflog/mflog.pyi +2 -2
  19. metaflow-stubs/multicore_utils.pyi +2 -2
  20. metaflow-stubs/parameters.pyi +4 -4
  21. metaflow-stubs/plugins/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  23. metaflow-stubs/plugins/airflow/airflow.pyi +3 -3
  24. metaflow-stubs/plugins/airflow/airflow_cli.pyi +6 -3
  25. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  29. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  30. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  31. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  32. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_client.pyi +11 -2
  34. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  35. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
  36. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +9 -6
  37. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +6 -6
  38. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  39. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  40. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  41. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  45. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  46. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +4 -4
  47. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  54. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +4 -4
  56. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  57. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  58. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  59. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  60. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  61. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  62. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +2 -2
  63. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  64. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  65. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  66. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  68. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  69. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_modules/basic.pyi +4 -4
  74. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
  78. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  81. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  82. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  83. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +3 -3
  84. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  85. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  86. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  87. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  88. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  89. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  90. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  91. metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -6
  92. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  93. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  94. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  95. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  96. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  97. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  98. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  99. metaflow-stubs/plugins/frameworks/pytorch.pyi +8 -7
  100. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  101. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  103. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  104. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  105. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  106. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  107. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  108. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +6 -3
  110. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  111. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +7 -4
  112. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
  113. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  114. metaflow-stubs/plugins/logs_cli.pyi +2 -2
  115. metaflow-stubs/plugins/package_cli.pyi +2 -2
  116. metaflow-stubs/plugins/parallel_decorator.pyi +7 -6
  117. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  119. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  121. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  122. metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
  123. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  124. metaflow-stubs/plugins/resources_decorator.pyi +3 -3
  125. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  126. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  127. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  128. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  129. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  130. metaflow-stubs/plugins/tag_cli.pyi +4 -4
  131. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  132. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  133. metaflow-stubs/procpoll.pyi +2 -2
  134. metaflow-stubs/pylint_wrapper.pyi +2 -2
  135. metaflow-stubs/runner/__init__.pyi +2 -2
  136. metaflow-stubs/runner/deployer.pyi +3 -3
  137. metaflow-stubs/runner/metaflow_runner.pyi +4 -35
  138. metaflow-stubs/runner/nbdeploy.pyi +5 -7
  139. metaflow-stubs/runner/nbrun.pyi +5 -7
  140. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  141. metaflow-stubs/runner/utils.pyi +2 -6
  142. metaflow-stubs/system/__init__.pyi +3 -3
  143. metaflow-stubs/system/system_logger.pyi +2 -2
  144. metaflow-stubs/system/system_monitor.pyi +3 -3
  145. metaflow-stubs/tagging_util.pyi +2 -2
  146. metaflow-stubs/tuple_util.pyi +2 -2
  147. metaflow-stubs/version.pyi +2 -2
  148. {metaflow_stubs-2.12.25.dist-info → metaflow_stubs-2.12.27.dist-info}/METADATA +2 -2
  149. metaflow_stubs-2.12.27.dist-info/RECORD +152 -0
  150. {metaflow_stubs-2.12.25.dist-info → metaflow_stubs-2.12.27.dist-info}/WHEEL +1 -1
  151. metaflow_stubs-2.12.25.dist-info/RECORD +0 -152
  152. {metaflow_stubs-2.12.25.dist-info → metaflow_stubs-2.12.27.dist-info}/top_level.txt +0 -0
@@ -1,25 +1,25 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.25 #
4
- # Generated on 2024-10-07T19:08:03.779487 #
3
+ # MF version: 2.12.27 #
4
+ # Generated on 2024-10-24T19:27:17.873106 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import typing
12
- import metaflow.metaflow_current
13
- import io
14
- import metaflow.client.core
15
11
  import metaflow.datastore.inputs
16
- import metaflow._vendor.click.types
17
12
  import metaflow.flowspec
18
- import metaflow.plugins.datatools.s3.s3
19
- import datetime
20
- import metaflow.parameters
21
13
  import metaflow.events
14
+ import metaflow.client.core
15
+ import metaflow._vendor.click.types
16
+ import typing
17
+ import datetime
22
18
  import metaflow.runner.metaflow_runner
19
+ import metaflow.plugins.datatools.s3.s3
20
+ import metaflow.parameters
21
+ import metaflow.metaflow_current
22
+ import io
23
23
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
24
24
  StepFlag = typing.NewType("StepFlag", bool)
25
25
 
@@ -855,112 +855,125 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
855
855
  ...
856
856
 
857
857
  @typing.overload
858
- 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]]]:
858
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
859
859
  """
860
- Specifies that the step will success under all circumstances.
860
+ Decorator prototype for all step decorators. This function gets specialized
861
+ and imported for all decorators types by _import_plugin_decorators().
862
+ """
863
+ ...
864
+
865
+ @typing.overload
866
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
867
+ ...
868
+
869
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
870
+ """
871
+ Decorator prototype for all step decorators. This function gets specialized
872
+ and imported for all decorators types by _import_plugin_decorators().
873
+ """
874
+ ...
875
+
876
+ @typing.overload
877
+ 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]]]:
878
+ """
879
+ Specifies the PyPI packages for the step.
861
880
 
862
- The decorator will create an optional artifact, specified by `var`, which
863
- contains the exception raised. You can use it to detect the presence
864
- of errors, indicating that all happy-path artifacts produced by the step
865
- are missing.
881
+ Information in this decorator will augment any
882
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
883
+ you can use `@pypi_base` to set packages required by all
884
+ steps and use `@pypi` to specify step-specific overrides.
866
885
 
867
886
  Parameters
868
887
  ----------
869
- var : str, optional, default None
870
- Name of the artifact in which to store the caught exception.
871
- If not specified, the exception is not stored.
872
- print_exception : bool, default True
873
- Determines whether or not the exception is printed to
874
- stdout when caught.
888
+ packages : Dict[str, str], default: {}
889
+ Packages to use for this step. The key is the name of the package
890
+ and the value is the version to use.
891
+ python : str, optional, default: None
892
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
893
+ that the version used will correspond to the version of the Python interpreter used to start the run.
875
894
  """
876
895
  ...
877
896
 
878
897
  @typing.overload
879
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
898
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
880
899
  ...
881
900
 
882
901
  @typing.overload
883
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
902
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
884
903
  ...
885
904
 
886
- 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):
905
+ 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):
887
906
  """
888
- Specifies that the step will success under all circumstances.
907
+ Specifies the PyPI packages for the step.
889
908
 
890
- The decorator will create an optional artifact, specified by `var`, which
891
- contains the exception raised. You can use it to detect the presence
892
- of errors, indicating that all happy-path artifacts produced by the step
893
- are missing.
909
+ Information in this decorator will augment any
910
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
911
+ you can use `@pypi_base` to set packages required by all
912
+ steps and use `@pypi` to specify step-specific overrides.
894
913
 
895
914
  Parameters
896
915
  ----------
897
- var : str, optional, default None
898
- Name of the artifact in which to store the caught exception.
899
- If not specified, the exception is not stored.
900
- print_exception : bool, default True
901
- Determines whether or not the exception is printed to
902
- stdout when caught.
916
+ packages : Dict[str, str], default: {}
917
+ Packages to use for this step. The key is the name of the package
918
+ and the value is the version to use.
919
+ python : str, optional, default: None
920
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
921
+ that the version used will correspond to the version of the Python interpreter used to start the run.
903
922
  """
904
923
  ...
905
924
 
906
925
  @typing.overload
907
- 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]]]:
926
+ 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]]]:
908
927
  """
909
- Specifies a timeout for your step.
910
-
911
- This decorator is useful if this step may hang indefinitely.
912
-
913
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
914
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
915
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
928
+ Creates a human-readable report, a Metaflow Card, after this step completes.
916
929
 
917
- Note that all the values specified in parameters are added together so if you specify
918
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
930
+ Note that you may add multiple `@card` decorators in a step with different parameters.
919
931
 
920
932
  Parameters
921
933
  ----------
922
- seconds : int, default 0
923
- Number of seconds to wait prior to timing out.
924
- minutes : int, default 0
925
- Number of minutes to wait prior to timing out.
926
- hours : int, default 0
927
- Number of hours to wait prior to timing out.
934
+ type : str, default 'default'
935
+ Card type.
936
+ id : str, optional, default None
937
+ If multiple cards are present, use this id to identify this card.
938
+ options : Dict[str, Any], default {}
939
+ Options passed to the card. The contents depend on the card type.
940
+ timeout : int, default 45
941
+ Interrupt reporting if it takes more than this many seconds.
942
+
943
+
928
944
  """
929
945
  ...
930
946
 
931
947
  @typing.overload
932
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
948
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
933
949
  ...
934
950
 
935
951
  @typing.overload
936
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
952
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
937
953
  ...
938
954
 
939
- 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):
955
+ 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):
940
956
  """
941
- Specifies a timeout for your step.
942
-
943
- This decorator is useful if this step may hang indefinitely.
944
-
945
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
946
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
947
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
957
+ Creates a human-readable report, a Metaflow Card, after this step completes.
948
958
 
949
- Note that all the values specified in parameters are added together so if you specify
950
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
959
+ Note that you may add multiple `@card` decorators in a step with different parameters.
951
960
 
952
961
  Parameters
953
962
  ----------
954
- seconds : int, default 0
955
- Number of seconds to wait prior to timing out.
956
- minutes : int, default 0
957
- Number of minutes to wait prior to timing out.
958
- hours : int, default 0
959
- Number of hours to wait prior to timing out.
963
+ type : str, default 'default'
964
+ Card type.
965
+ id : str, optional, default None
966
+ If multiple cards are present, use this id to identify this card.
967
+ options : Dict[str, Any], default {}
968
+ Options passed to the card. The contents depend on the card type.
969
+ timeout : int, default 45
970
+ Interrupt reporting if it takes more than this many seconds.
971
+
972
+
960
973
  """
961
974
  ...
962
975
 
963
- 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, node_selector: typing.Union[typing.Dict[str, str], str, None] = 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, compute_pool: 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]]]:
976
+ 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, node_selector: typing.Union[typing.Dict[str, str], str, None] = 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, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600) -> 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]]]:
964
977
  """
965
978
  Specifies that this step should execute on Kubernetes.
966
979
 
@@ -1023,68 +1036,71 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
1023
1036
  compute_pool : str, optional, default None
1024
1037
  Compute pool to be used for for this step.
1025
1038
  If not specified, any accessible compute pool within the perimeter is used.
1039
+ hostname_resolution_timeout: int, default 10 * 60
1040
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
1041
+ Only applicable when @parallel is used.
1026
1042
  """
1027
1043
  ...
1028
1044
 
1029
1045
  @typing.overload
1030
- 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]]]:
1046
+ 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]]]:
1031
1047
  """
1032
- Specifies the Conda environment for the step.
1048
+ Specifies a timeout for your step.
1033
1049
 
1034
- Information in this decorator will augment any
1035
- attributes set in the `@conda_base` flow-level decorator. Hence,
1036
- you can use `@conda_base` to set packages required by all
1037
- steps and use `@conda` to specify step-specific overrides.
1050
+ This decorator is useful if this step may hang indefinitely.
1051
+
1052
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1053
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1054
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1055
+
1056
+ Note that all the values specified in parameters are added together so if you specify
1057
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1038
1058
 
1039
1059
  Parameters
1040
1060
  ----------
1041
- packages : Dict[str, str], default {}
1042
- Packages to use for this step. The key is the name of the package
1043
- and the value is the version to use.
1044
- libraries : Dict[str, str], default {}
1045
- Supported for backward compatibility. When used with packages, packages will take precedence.
1046
- python : str, optional, default None
1047
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1048
- that the version used will correspond to the version of the Python interpreter used to start the run.
1049
- disabled : bool, default False
1050
- If set to True, disables @conda.
1061
+ seconds : int, default 0
1062
+ Number of seconds to wait prior to timing out.
1063
+ minutes : int, default 0
1064
+ Number of minutes to wait prior to timing out.
1065
+ hours : int, default 0
1066
+ Number of hours to wait prior to timing out.
1051
1067
  """
1052
1068
  ...
1053
1069
 
1054
1070
  @typing.overload
1055
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1071
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1056
1072
  ...
1057
1073
 
1058
1074
  @typing.overload
1059
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1075
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1060
1076
  ...
1061
1077
 
1062
- 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):
1078
+ 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):
1063
1079
  """
1064
- Specifies the Conda environment for the step.
1080
+ Specifies a timeout for your step.
1065
1081
 
1066
- Information in this decorator will augment any
1067
- attributes set in the `@conda_base` flow-level decorator. Hence,
1068
- you can use `@conda_base` to set packages required by all
1069
- steps and use `@conda` to specify step-specific overrides.
1082
+ This decorator is useful if this step may hang indefinitely.
1083
+
1084
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1085
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1086
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1087
+
1088
+ Note that all the values specified in parameters are added together so if you specify
1089
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1070
1090
 
1071
1091
  Parameters
1072
1092
  ----------
1073
- packages : Dict[str, str], default {}
1074
- Packages to use for this step. The key is the name of the package
1075
- and the value is the version to use.
1076
- libraries : Dict[str, str], default {}
1077
- Supported for backward compatibility. When used with packages, packages will take precedence.
1078
- python : str, optional, default None
1079
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1080
- that the version used will correspond to the version of the Python interpreter used to start the run.
1081
- disabled : bool, default False
1082
- If set to True, disables @conda.
1093
+ seconds : int, default 0
1094
+ Number of seconds to wait prior to timing out.
1095
+ minutes : int, default 0
1096
+ Number of minutes to wait prior to timing out.
1097
+ hours : int, default 0
1098
+ Number of hours to wait prior to timing out.
1083
1099
  """
1084
1100
  ...
1085
1101
 
1086
1102
  @typing.overload
1087
- 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]]]:
1103
+ def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, 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]]]:
1088
1104
  """
1089
1105
  Specifies the resources needed when executing this step.
1090
1106
 
@@ -1106,7 +1122,7 @@ def resources(*, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None,
1106
1122
  ----------
1107
1123
  cpu : int, default 1
1108
1124
  Number of CPUs required for this step.
1109
- gpu : int, default 0
1125
+ gpu : int, optional, default None
1110
1126
  Number of GPUs required for this step.
1111
1127
  disk : int, optional, default None
1112
1128
  Disk size (in MB) required for this step. Only applies on Kubernetes.
@@ -1126,7 +1142,7 @@ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.C
1126
1142
  def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1127
1143
  ...
1128
1144
 
1129
- 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):
1145
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
1130
1146
  """
1131
1147
  Specifies the resources needed when executing this step.
1132
1148
 
@@ -1148,7 +1164,7 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1148
1164
  ----------
1149
1165
  cpu : int, default 1
1150
1166
  Number of CPUs required for this step.
1151
- gpu : int, default 0
1167
+ gpu : int, optional, default None
1152
1168
  Number of GPUs required for this step.
1153
1169
  disk : int, optional, default None
1154
1170
  Disk size (in MB) required for this step. Only applies on Kubernetes.
@@ -1161,170 +1177,49 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1161
1177
  ...
1162
1178
 
1163
1179
  @typing.overload
1164
- 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]]]:
1180
+ 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]]]:
1165
1181
  """
1166
- Specifies secrets to be retrieved and injected as environment variables prior to
1167
- the execution of a step.
1182
+ Specifies environment variables to be set prior to the execution of a step.
1168
1183
 
1169
1184
  Parameters
1170
1185
  ----------
1171
- sources : List[Union[str, Dict[str, Any]]], default: []
1172
- List of secret specs, defining how the secrets are to be retrieved
1186
+ vars : Dict[str, str], default {}
1187
+ Dictionary of environment variables to set.
1173
1188
  """
1174
1189
  ...
1175
1190
 
1176
1191
  @typing.overload
1177
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1192
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1178
1193
  ...
1179
1194
 
1180
1195
  @typing.overload
1181
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1196
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1182
1197
  ...
1183
1198
 
1184
- 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]]] = []):
1199
+ 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
1200
  """
1186
- Specifies secrets to be retrieved and injected as environment variables prior to
1187
- the execution of a step.
1201
+ Specifies environment variables to be set prior to the execution of a step.
1188
1202
 
1189
1203
  Parameters
1190
1204
  ----------
1191
- sources : List[Union[str, Dict[str, Any]]], default: []
1192
- List of secret specs, defining how the secrets are to be retrieved
1205
+ vars : Dict[str, str], default {}
1206
+ Dictionary of environment variables to set.
1193
1207
  """
1194
1208
  ...
1195
1209
 
1196
1210
  @typing.overload
1197
- 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]]]:
1211
+ 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]]]:
1198
1212
  """
1199
- Creates a human-readable report, a Metaflow Card, after this step completes.
1213
+ Specifies the number of times the task corresponding
1214
+ to a step needs to be retried.
1200
1215
 
1201
- Note that you may add multiple `@card` decorators in a step with different parameters.
1202
-
1203
- Parameters
1204
- ----------
1205
- type : str, default 'default'
1206
- Card type.
1207
- id : str, optional, default None
1208
- If multiple cards are present, use this id to identify this card.
1209
- options : Dict[str, Any], default {}
1210
- Options passed to the card. The contents depend on the card type.
1211
- timeout : int, default 45
1212
- Interrupt reporting if it takes more than this many seconds.
1213
-
1214
-
1215
- """
1216
- ...
1217
-
1218
- @typing.overload
1219
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1220
- ...
1221
-
1222
- @typing.overload
1223
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1224
- ...
1225
-
1226
- 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):
1227
- """
1228
- Creates a human-readable report, a Metaflow Card, after this step completes.
1229
-
1230
- Note that you may add multiple `@card` decorators in a step with different parameters.
1231
-
1232
- Parameters
1233
- ----------
1234
- type : str, default 'default'
1235
- Card type.
1236
- id : str, optional, default None
1237
- If multiple cards are present, use this id to identify this card.
1238
- options : Dict[str, Any], default {}
1239
- Options passed to the card. The contents depend on the card type.
1240
- timeout : int, default 45
1241
- Interrupt reporting if it takes more than this many seconds.
1242
-
1243
-
1244
- """
1245
- ...
1246
-
1247
- @typing.overload
1248
- 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]]]:
1249
- """
1250
- Specifies the PyPI packages for the step.
1251
-
1252
- Information in this decorator will augment any
1253
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1254
- you can use `@pypi_base` to set packages required by all
1255
- steps and use `@pypi` to specify step-specific overrides.
1256
-
1257
- Parameters
1258
- ----------
1259
- packages : Dict[str, str], default: {}
1260
- Packages to use for this step. The key is the name of the package
1261
- and the value is the version to use.
1262
- python : str, optional, default: None
1263
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1264
- that the version used will correspond to the version of the Python interpreter used to start the run.
1265
- """
1266
- ...
1267
-
1268
- @typing.overload
1269
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1270
- ...
1271
-
1272
- @typing.overload
1273
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1274
- ...
1275
-
1276
- 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):
1277
- """
1278
- Specifies the PyPI packages for the step.
1279
-
1280
- Information in this decorator will augment any
1281
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1282
- you can use `@pypi_base` to set packages required by all
1283
- steps and use `@pypi` to specify step-specific overrides.
1284
-
1285
- Parameters
1286
- ----------
1287
- packages : Dict[str, str], default: {}
1288
- Packages to use for this step. The key is the name of the package
1289
- and the value is the version to use.
1290
- python : str, optional, default: None
1291
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1292
- that the version used will correspond to the version of the Python interpreter used to start the run.
1293
- """
1294
- ...
1295
-
1296
- @typing.overload
1297
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1298
- """
1299
- Decorator prototype for all step decorators. This function gets specialized
1300
- and imported for all decorators types by _import_plugin_decorators().
1301
- """
1302
- ...
1303
-
1304
- @typing.overload
1305
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1306
- ...
1307
-
1308
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1309
- """
1310
- Decorator prototype for all step decorators. This function gets specialized
1311
- and imported for all decorators types by _import_plugin_decorators().
1312
- """
1313
- ...
1314
-
1315
- @typing.overload
1316
- def retry(*, times: int = 3, minutes_between_retries: int = 2) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1317
- """
1318
- Specifies the number of times the task corresponding
1319
- to a step needs to be retried.
1320
-
1321
- This decorator is useful for handling transient errors, such as networking issues.
1322
- If your task contains operations that can't be retried safely, e.g. database updates,
1323
- it is advisable to annotate it with `@retry(times=0)`.
1324
-
1325
- This can be used in conjunction with the `@catch` decorator. The `@catch`
1326
- decorator will execute a no-op task after all retries have been exhausted,
1327
- ensuring that the flow execution can continue.
1216
+ This decorator is useful for handling transient errors, such as networking issues.
1217
+ If your task contains operations that can't be retried safely, e.g. database updates,
1218
+ it is advisable to annotate it with `@retry(times=0)`.
1219
+
1220
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1221
+ decorator will execute a no-op task after all retries have been exhausted,
1222
+ ensuring that the flow execution can continue.
1328
1223
 
1329
1224
  Parameters
1330
1225
  ----------
@@ -1513,175 +1408,159 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1513
1408
  ...
1514
1409
 
1515
1410
  @typing.overload
1516
- 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]]]:
1411
+ 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]]]:
1517
1412
  """
1518
- Specifies environment variables to be set prior to the execution of a step.
1413
+ Specifies secrets to be retrieved and injected as environment variables prior to
1414
+ the execution of a step.
1519
1415
 
1520
1416
  Parameters
1521
1417
  ----------
1522
- vars : Dict[str, str], default {}
1523
- Dictionary of environment variables to set.
1418
+ sources : List[Union[str, Dict[str, Any]]], default: []
1419
+ List of secret specs, defining how the secrets are to be retrieved
1524
1420
  """
1525
1421
  ...
1526
1422
 
1527
1423
  @typing.overload
1528
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1424
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1529
1425
  ...
1530
1426
 
1531
1427
  @typing.overload
1532
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1428
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1533
1429
  ...
1534
1430
 
1535
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1431
+ 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]]] = []):
1536
1432
  """
1537
- Specifies environment variables to be set prior to the execution of a step.
1433
+ Specifies secrets to be retrieved and injected as environment variables prior to
1434
+ the execution of a step.
1538
1435
 
1539
1436
  Parameters
1540
1437
  ----------
1541
- vars : Dict[str, str], default {}
1542
- Dictionary of environment variables to set.
1438
+ sources : List[Union[str, Dict[str, Any]]], default: []
1439
+ List of secret specs, defining how the secrets are to be retrieved
1543
1440
  """
1544
1441
  ...
1545
1442
 
1546
1443
  @typing.overload
1547
- def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, 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]]:
1444
+ 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]]]:
1548
1445
  """
1549
- Specifies the flow(s) that this flow depends on.
1550
-
1551
- ```
1552
- @trigger_on_finish(flow='FooFlow')
1553
- ```
1554
- or
1555
- ```
1556
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1557
- ```
1558
- This decorator respects the @project decorator and triggers the flow
1559
- when upstream runs within the same namespace complete successfully
1560
-
1561
- Additionally, you can specify project aware upstream flow dependencies
1562
- by specifying the fully qualified project_flow_name.
1563
- ```
1564
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1565
- ```
1566
- or
1567
- ```
1568
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1569
- ```
1570
-
1571
- You can also specify just the project or project branch (other values will be
1572
- inferred from the current project or project branch):
1573
- ```
1574
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1575
- ```
1446
+ Specifies the Conda environment for the step.
1576
1447
 
1577
- Note that `branch` is typically one of:
1578
- - `prod`
1579
- - `user.bob`
1580
- - `test.my_experiment`
1581
- - `prod.staging`
1448
+ Information in this decorator will augment any
1449
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1450
+ you can use `@conda_base` to set packages required by all
1451
+ steps and use `@conda` to specify step-specific overrides.
1582
1452
 
1583
1453
  Parameters
1584
1454
  ----------
1585
- flow : Union[str, Dict[str, str]], optional, default None
1586
- Upstream flow dependency for this flow.
1587
- flows : List[Union[str, Dict[str, str]]], default []
1588
- Upstream flow dependencies for this flow.
1589
- options : Dict[str, Any], default {}
1590
- Backend-specific configuration for tuning eventing behavior.
1591
-
1592
-
1455
+ packages : Dict[str, str], default {}
1456
+ Packages to use for this step. The key is the name of the package
1457
+ and the value is the version to use.
1458
+ libraries : Dict[str, str], default {}
1459
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1460
+ python : str, optional, default None
1461
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1462
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1463
+ disabled : bool, default False
1464
+ If set to True, disables @conda.
1593
1465
  """
1594
1466
  ...
1595
1467
 
1596
1468
  @typing.overload
1597
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1469
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1598
1470
  ...
1599
1471
 
1600
- def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1472
+ @typing.overload
1473
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1474
+ ...
1475
+
1476
+ 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):
1601
1477
  """
1602
- Specifies the flow(s) that this flow depends on.
1603
-
1604
- ```
1605
- @trigger_on_finish(flow='FooFlow')
1606
- ```
1607
- or
1608
- ```
1609
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1610
- ```
1611
- This decorator respects the @project decorator and triggers the flow
1612
- when upstream runs within the same namespace complete successfully
1613
-
1614
- Additionally, you can specify project aware upstream flow dependencies
1615
- by specifying the fully qualified project_flow_name.
1616
- ```
1617
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1618
- ```
1619
- or
1620
- ```
1621
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1622
- ```
1623
-
1624
- You can also specify just the project or project branch (other values will be
1625
- inferred from the current project or project branch):
1626
- ```
1627
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1628
- ```
1478
+ Specifies the Conda environment for the step.
1629
1479
 
1630
- Note that `branch` is typically one of:
1631
- - `prod`
1632
- - `user.bob`
1633
- - `test.my_experiment`
1634
- - `prod.staging`
1480
+ Information in this decorator will augment any
1481
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1482
+ you can use `@conda_base` to set packages required by all
1483
+ steps and use `@conda` to specify step-specific overrides.
1635
1484
 
1636
1485
  Parameters
1637
1486
  ----------
1638
- flow : Union[str, Dict[str, str]], optional, default None
1639
- Upstream flow dependency for this flow.
1640
- flows : List[Union[str, Dict[str, str]]], default []
1641
- Upstream flow dependencies for this flow.
1642
- options : Dict[str, Any], default {}
1643
- Backend-specific configuration for tuning eventing behavior.
1487
+ packages : Dict[str, str], default {}
1488
+ Packages to use for this step. The key is the name of the package
1489
+ and the value is the version to use.
1490
+ libraries : Dict[str, str], default {}
1491
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1492
+ python : str, optional, default None
1493
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1494
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1495
+ disabled : bool, default False
1496
+ If set to True, disables @conda.
1497
+ """
1498
+ ...
1499
+
1500
+ @typing.overload
1501
+ 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]]]:
1502
+ """
1503
+ Specifies that the step will success under all circumstances.
1644
1504
 
1505
+ The decorator will create an optional artifact, specified by `var`, which
1506
+ contains the exception raised. You can use it to detect the presence
1507
+ of errors, indicating that all happy-path artifacts produced by the step
1508
+ are missing.
1645
1509
 
1510
+ Parameters
1511
+ ----------
1512
+ var : str, optional, default None
1513
+ Name of the artifact in which to store the caught exception.
1514
+ If not specified, the exception is not stored.
1515
+ print_exception : bool, default True
1516
+ Determines whether or not the exception is printed to
1517
+ stdout when caught.
1646
1518
  """
1647
1519
  ...
1648
1520
 
1649
1521
  @typing.overload
1650
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1522
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1523
+ ...
1524
+
1525
+ @typing.overload
1526
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1527
+ ...
1528
+
1529
+ 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):
1651
1530
  """
1652
- Specifies the PyPI packages for all steps of the flow.
1531
+ Specifies that the step will success under all circumstances.
1532
+
1533
+ The decorator will create an optional artifact, specified by `var`, which
1534
+ contains the exception raised. You can use it to detect the presence
1535
+ of errors, indicating that all happy-path artifacts produced by the step
1536
+ are missing.
1653
1537
 
1654
- Use `@pypi_base` to set common packages required by all
1655
- steps and use `@pypi` to specify step-specific overrides.
1656
1538
  Parameters
1657
1539
  ----------
1658
- packages : Dict[str, str], default: {}
1659
- Packages to use for this flow. The key is the name of the package
1660
- and the value is the version to use.
1661
- python : str, optional, default: None
1662
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1663
- that the version used will correspond to the version of the Python interpreter used to start the run.
1540
+ var : str, optional, default None
1541
+ Name of the artifact in which to store the caught exception.
1542
+ If not specified, the exception is not stored.
1543
+ print_exception : bool, default True
1544
+ Determines whether or not the exception is printed to
1545
+ stdout when caught.
1664
1546
  """
1665
1547
  ...
1666
1548
 
1667
- @typing.overload
1668
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1669
- ...
1670
-
1671
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1549
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1672
1550
  """
1673
- Specifies the PyPI packages for all steps of the flow.
1551
+ Specifies what flows belong to the same project.
1552
+
1553
+ A project-specific namespace is created for all flows that
1554
+ use the same `@project(name)`.
1674
1555
 
1675
- Use `@pypi_base` to set common packages required by all
1676
- steps and use `@pypi` to specify step-specific overrides.
1677
1556
  Parameters
1678
1557
  ----------
1679
- packages : Dict[str, str], default: {}
1680
- Packages to use for this flow. The key is the name of the package
1681
- and the value is the version to use.
1682
- python : str, optional, default: None
1683
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1684
- that the version used will correspond to the version of the Python interpreter used to start the run.
1558
+ name : str
1559
+ Project name. Make sure that the name is unique amongst all
1560
+ projects that use the same production scheduler. The name may
1561
+ contain only lowercase alphanumeric characters and underscores.
1562
+
1563
+
1685
1564
  """
1686
1565
  ...
1687
1566
 
@@ -1727,6 +1606,48 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1727
1606
  """
1728
1607
  ...
1729
1608
 
1609
+ 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]]:
1610
+ """
1611
+ 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)
1612
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1613
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1614
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1615
+ starts only after all sensors finish.
1616
+
1617
+ Parameters
1618
+ ----------
1619
+ timeout : int
1620
+ Time, in seconds before the task times out and fails. (Default: 3600)
1621
+ poke_interval : int
1622
+ Time in seconds that the job should wait in between each try. (Default: 60)
1623
+ mode : str
1624
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1625
+ exponential_backoff : bool
1626
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1627
+ pool : str
1628
+ the slot pool this task should run in,
1629
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1630
+ soft_fail : bool
1631
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1632
+ name : str
1633
+ Name of the sensor on Airflow
1634
+ description : str
1635
+ Description of sensor in the Airflow UI
1636
+ bucket_key : Union[str, List[str]]
1637
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1638
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1639
+ bucket_name : str
1640
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1641
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1642
+ wildcard_match : bool
1643
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1644
+ aws_conn_id : str
1645
+ a reference to the s3 connection on Airflow. (Default: None)
1646
+ verify : bool
1647
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1648
+ """
1649
+ ...
1650
+
1730
1651
  @typing.overload
1731
1652
  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]]:
1732
1653
  """
@@ -1871,21 +1792,42 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1871
1792
  """
1872
1793
  ...
1873
1794
 
1874
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1795
+ @typing.overload
1796
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1875
1797
  """
1876
- Specifies what flows belong to the same project.
1877
-
1878
- A project-specific namespace is created for all flows that
1879
- use the same `@project(name)`.
1798
+ Specifies the PyPI packages for all steps of the flow.
1880
1799
 
1800
+ Use `@pypi_base` to set common packages required by all
1801
+ steps and use `@pypi` to specify step-specific overrides.
1881
1802
  Parameters
1882
1803
  ----------
1883
- name : str
1884
- Project name. Make sure that the name is unique amongst all
1885
- projects that use the same production scheduler. The name may
1886
- contain only lowercase alphanumeric characters and underscores.
1887
-
1804
+ packages : Dict[str, str], default: {}
1805
+ Packages to use for this flow. The key is the name of the package
1806
+ and the value is the version to use.
1807
+ python : str, optional, default: None
1808
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1809
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1810
+ """
1811
+ ...
1812
+
1813
+ @typing.overload
1814
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1815
+ ...
1816
+
1817
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1818
+ """
1819
+ Specifies the PyPI packages for all steps of the flow.
1888
1820
 
1821
+ Use `@pypi_base` to set common packages required by all
1822
+ steps and use `@pypi` to specify step-specific overrides.
1823
+ Parameters
1824
+ ----------
1825
+ packages : Dict[str, str], default: {}
1826
+ Packages to use for this flow. The key is the name of the package
1827
+ and the value is the version to use.
1828
+ python : str, optional, default: None
1829
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1830
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1889
1831
  """
1890
1832
  ...
1891
1833
 
@@ -1938,45 +1880,106 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1938
1880
  """
1939
1881
  ...
1940
1882
 
1941
- 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]]:
1883
+ @typing.overload
1884
+ def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, 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]]:
1942
1885
  """
1943
- 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)
1944
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1945
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1946
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1947
- starts only after all sensors finish.
1886
+ Specifies the flow(s) that this flow depends on.
1887
+
1888
+ ```
1889
+ @trigger_on_finish(flow='FooFlow')
1890
+ ```
1891
+ or
1892
+ ```
1893
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1894
+ ```
1895
+ This decorator respects the @project decorator and triggers the flow
1896
+ when upstream runs within the same namespace complete successfully
1897
+
1898
+ Additionally, you can specify project aware upstream flow dependencies
1899
+ by specifying the fully qualified project_flow_name.
1900
+ ```
1901
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1902
+ ```
1903
+ or
1904
+ ```
1905
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1906
+ ```
1907
+
1908
+ You can also specify just the project or project branch (other values will be
1909
+ inferred from the current project or project branch):
1910
+ ```
1911
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1912
+ ```
1913
+
1914
+ Note that `branch` is typically one of:
1915
+ - `prod`
1916
+ - `user.bob`
1917
+ - `test.my_experiment`
1918
+ - `prod.staging`
1948
1919
 
1949
1920
  Parameters
1950
1921
  ----------
1951
- timeout : int
1952
- Time, in seconds before the task times out and fails. (Default: 3600)
1953
- poke_interval : int
1954
- Time in seconds that the job should wait in between each try. (Default: 60)
1955
- mode : str
1956
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1957
- exponential_backoff : bool
1958
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1959
- pool : str
1960
- the slot pool this task should run in,
1961
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1962
- soft_fail : bool
1963
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1964
- name : str
1965
- Name of the sensor on Airflow
1966
- description : str
1967
- Description of sensor in the Airflow UI
1968
- bucket_key : Union[str, List[str]]
1969
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1970
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1971
- bucket_name : str
1972
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1973
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1974
- wildcard_match : bool
1975
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1976
- aws_conn_id : str
1977
- a reference to the s3 connection on Airflow. (Default: None)
1978
- verify : bool
1979
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1922
+ flow : Union[str, Dict[str, str]], optional, default None
1923
+ Upstream flow dependency for this flow.
1924
+ flows : List[Union[str, Dict[str, str]]], default []
1925
+ Upstream flow dependencies for this flow.
1926
+ options : Dict[str, Any], default {}
1927
+ Backend-specific configuration for tuning eventing behavior.
1928
+
1929
+
1930
+ """
1931
+ ...
1932
+
1933
+ @typing.overload
1934
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1935
+ ...
1936
+
1937
+ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
1938
+ """
1939
+ Specifies the flow(s) that this flow depends on.
1940
+
1941
+ ```
1942
+ @trigger_on_finish(flow='FooFlow')
1943
+ ```
1944
+ or
1945
+ ```
1946
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1947
+ ```
1948
+ This decorator respects the @project decorator and triggers the flow
1949
+ when upstream runs within the same namespace complete successfully
1950
+
1951
+ Additionally, you can specify project aware upstream flow dependencies
1952
+ by specifying the fully qualified project_flow_name.
1953
+ ```
1954
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1955
+ ```
1956
+ or
1957
+ ```
1958
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1959
+ ```
1960
+
1961
+ You can also specify just the project or project branch (other values will be
1962
+ inferred from the current project or project branch):
1963
+ ```
1964
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1965
+ ```
1966
+
1967
+ Note that `branch` is typically one of:
1968
+ - `prod`
1969
+ - `user.bob`
1970
+ - `test.my_experiment`
1971
+ - `prod.staging`
1972
+
1973
+ Parameters
1974
+ ----------
1975
+ flow : Union[str, Dict[str, str]], optional, default None
1976
+ Upstream flow dependency for this flow.
1977
+ flows : List[Union[str, Dict[str, str]]], default []
1978
+ Upstream flow dependencies for this flow.
1979
+ options : Dict[str, Any], default {}
1980
+ Backend-specific configuration for tuning eventing behavior.
1981
+
1982
+
1980
1983
  """
1981
1984
  ...
1982
1985
 
@@ -2071,7 +2074,7 @@ class Metaflow(object, metaclass=type):
2071
2074
  flows present in the current namespace will be returned. A `Flow` is present in a namespace
2072
2075
  if it has at least one run in the namespace.
2073
2076
  """
2074
- def __init__(self):
2077
+ def __init__(self, _current_metadata: typing.Optional[str] = None):
2075
2078
  ...
2076
2079
  @property
2077
2080
  def flows(self) -> typing.List[metaflow.client.core.Flow]:
@@ -3214,15 +3217,15 @@ class NBRunner(object, metaclass=type):
3214
3217
  Additional environment variables to set for the Run. This overrides the
3215
3218
  environment set for this process.
3216
3219
  base_dir : Optional[str], default None
3217
- The directory to run the subprocess in; if not specified, a temporary
3218
- directory is used.
3220
+ The directory to run the subprocess in; if not specified, the current
3221
+ working directory is used.
3219
3222
  file_read_timeout : int, default 3600
3220
3223
  The timeout until which we try to read the runner attribute file.
3221
3224
  **kwargs : Any
3222
3225
  Additional arguments that you would pass to `python myflow.py` before
3223
3226
  the `run` command.
3224
3227
  """
3225
- def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", file_read_timeout: int = 3600, **kwargs):
3228
+ def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
3226
3229
  ...
3227
3230
  def nbrun(self, **kwargs):
3228
3231
  """
@@ -3403,13 +3406,13 @@ class NBDeployer(object, metaclass=type):
3403
3406
  Additional environment variables to set. This overrides the
3404
3407
  environment set for this process.
3405
3408
  base_dir : Optional[str], default None
3406
- The directory to run the subprocess in; if not specified, a temporary
3407
- directory is used.
3409
+ The directory to run the subprocess in; if not specified, the current
3410
+ working directory is used.
3408
3411
  **kwargs : Any
3409
3412
  Additional arguments that you would pass to `python myflow.py` i.e. options
3410
3413
  listed in `python myflow.py --help`
3411
3414
  """
3412
- def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", file_read_timeout: int = 3600, **kwargs):
3415
+ def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
3413
3416
  ...
3414
3417
  def cleanup(self):
3415
3418
  """