ob-metaflow-stubs 5.2__py2.py3-none-any.whl → 5.3__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 (138) hide show
  1. metaflow-stubs/__init__.pyi +520 -500
  2. metaflow-stubs/cards.pyi +5 -5
  3. metaflow-stubs/cli.pyi +3 -3
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +6 -6
  6. metaflow-stubs/client/filecache.pyi +3 -3
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +2 -2
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +5 -5
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +4 -4
  13. metaflow-stubs/metadata/metadata.pyi +3 -3
  14. metaflow-stubs/metadata/util.pyi +2 -2
  15. metaflow-stubs/metaflow_config.pyi +22 -6
  16. metaflow-stubs/metaflow_current.pyi +24 -24
  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_utils.pyi +2 -2
  23. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  24. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +3 -3
  26. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  27. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  28. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  29. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  30. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  31. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -6
  32. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +8 -6
  33. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +6 -6
  34. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +19 -4
  35. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  36. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  37. metaflow-stubs/plugins/aws/aws_utils.pyi +5 -2
  38. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  39. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +145 -0
  42. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  43. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
  44. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  45. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  46. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  47. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +19 -4
  51. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  52. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  53. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  54. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +2 -2
  55. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  56. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  57. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  58. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  59. metaflow-stubs/plugins/cards/card_cli.pyi +4 -4
  60. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  61. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  62. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  63. metaflow-stubs/plugins/cards/card_decorator.pyi +3 -3
  64. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  66. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  68. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +3 -3
  71. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  72. metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
  73. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  74. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  75. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  76. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  77. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  78. metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
  79. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  80. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  81. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  82. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  83. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  84. metaflow-stubs/plugins/events_decorator.pyi +3 -3
  85. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  86. metaflow-stubs/plugins/frameworks/pytorch.pyi +4 -4
  87. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  88. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
  89. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  90. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  91. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  92. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  93. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  94. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +7 -3
  95. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
  96. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  97. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  98. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  99. metaflow-stubs/plugins/logs_cli.pyi +3 -3
  100. metaflow-stubs/plugins/package_cli.pyi +2 -2
  101. metaflow-stubs/plugins/parallel_decorator.pyi +3 -3
  102. metaflow-stubs/plugins/perimeters.pyi +2 -2
  103. metaflow-stubs/plugins/project_decorator.pyi +3 -3
  104. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  105. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  106. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  107. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +6 -2
  108. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  109. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  110. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  111. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  112. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  113. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  114. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  115. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  116. metaflow-stubs/plugins/tag_cli.pyi +3 -3
  117. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  119. metaflow-stubs/procpoll.pyi +2 -2
  120. metaflow-stubs/profilers/__init__.pyi +2 -2
  121. metaflow-stubs/pylint_wrapper.pyi +2 -2
  122. metaflow-stubs/runner/__init__.pyi +2 -2
  123. metaflow-stubs/runner/deployer.pyi +20 -5
  124. metaflow-stubs/runner/metaflow_runner.pyi +6 -6
  125. metaflow-stubs/runner/nbdeploy.pyi +4 -4
  126. metaflow-stubs/runner/nbrun.pyi +4 -4
  127. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  128. metaflow-stubs/runner/utils.pyi +2 -2
  129. metaflow-stubs/system/__init__.pyi +4 -4
  130. metaflow-stubs/system/system_logger.pyi +3 -3
  131. metaflow-stubs/system/system_monitor.pyi +3 -3
  132. metaflow-stubs/tagging_util.pyi +2 -2
  133. metaflow-stubs/tuple_util.pyi +2 -2
  134. {ob_metaflow_stubs-5.2.dist-info → ob_metaflow_stubs-5.3.dist-info}/METADATA +1 -1
  135. ob_metaflow_stubs-5.3.dist-info/RECORD +138 -0
  136. ob_metaflow_stubs-5.2.dist-info/RECORD +0 -137
  137. {ob_metaflow_stubs-5.2.dist-info → ob_metaflow_stubs-5.3.dist-info}/WHEEL +0 -0
  138. {ob_metaflow_stubs-5.2.dist-info → ob_metaflow_stubs-5.3.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.12.0+ob(v1) #
4
- # Generated on 2024-08-14T18:23:51.845623 #
3
+ # MF version: 2.12.15.1+ob(v1) #
4
+ # Generated on 2024-08-22T21:03:01.630360 #
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
11
  import metaflow.flowspec
12
+ import metaflow.parameters
13
+ import metaflow.plugins.datatools.s3.s3
13
14
  import io
14
- import typing
15
15
  import datetime
16
- import metaflow.runner.metaflow_runner
17
- import metaflow.client.core
18
- import metaflow.plugins.datatools.s3.s3
19
- import metaflow.metaflow_current
20
- import metaflow.parameters
16
+ import metaflow.events
21
17
  import metaflow.datastore.inputs
18
+ import metaflow.metaflow_current
19
+ import metaflow.client.core
20
+ import metaflow.runner.metaflow_runner
22
21
  import metaflow._vendor.click.types
22
+ import typing
23
23
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
24
24
  StepFlag = typing.NewType("StepFlag", bool)
25
25
 
@@ -728,161 +728,108 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
728
728
  ...
729
729
 
730
730
  @typing.overload
731
- 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]]]:
731
+ def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
732
732
  """
733
- Specifies the Conda environment for the step.
733
+ Specifies that the step will success under all circumstances.
734
734
 
735
- Information in this decorator will augment any
736
- attributes set in the `@conda_base` flow-level decorator. Hence,
737
- you can use `@conda_base` to set packages required by all
738
- steps and use `@conda` to specify step-specific overrides.
735
+ The decorator will create an optional artifact, specified by `var`, which
736
+ contains the exception raised. You can use it to detect the presence
737
+ of errors, indicating that all happy-path artifacts produced by the step
738
+ are missing.
739
739
 
740
740
  Parameters
741
741
  ----------
742
- packages : Dict[str, str], default {}
743
- Packages to use for this step. The key is the name of the package
744
- and the value is the version to use.
745
- libraries : Dict[str, str], default {}
746
- Supported for backward compatibility. When used with packages, packages will take precedence.
747
- python : str, optional, default None
748
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
749
- that the version used will correspond to the version of the Python interpreter used to start the run.
750
- disabled : bool, default False
751
- If set to True, disables @conda.
742
+ var : str, optional, default None
743
+ Name of the artifact in which to store the caught exception.
744
+ If not specified, the exception is not stored.
745
+ print_exception : bool, default True
746
+ Determines whether or not the exception is printed to
747
+ stdout when caught.
752
748
  """
753
749
  ...
754
750
 
755
751
  @typing.overload
756
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
752
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
757
753
  ...
758
754
 
759
755
  @typing.overload
760
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
761
- ...
762
-
763
- 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):
764
- """
765
- Specifies the Conda environment for the step.
766
-
767
- Information in this decorator will augment any
768
- attributes set in the `@conda_base` flow-level decorator. Hence,
769
- you can use `@conda_base` to set packages required by all
770
- steps and use `@conda` to specify step-specific overrides.
771
-
772
- Parameters
773
- ----------
774
- packages : Dict[str, str], default {}
775
- Packages to use for this step. The key is the name of the package
776
- and the value is the version to use.
777
- libraries : Dict[str, str], default {}
778
- Supported for backward compatibility. When used with packages, packages will take precedence.
779
- python : str, optional, default None
780
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
781
- that the version used will correspond to the version of the Python interpreter used to start the run.
782
- disabled : bool, default False
783
- If set to True, disables @conda.
784
- """
756
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
785
757
  ...
786
758
 
787
- @typing.overload
788
- 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]]]:
759
+ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
789
760
  """
790
- Specifies the PyPI packages for the step.
761
+ Specifies that the step will success under all circumstances.
791
762
 
792
- Information in this decorator will augment any
793
- attributes set in the `@pyi_base` flow-level decorator. Hence,
794
- you can use `@pypi_base` to set packages required by all
795
- steps and use `@pypi` to specify step-specific overrides.
763
+ The decorator will create an optional artifact, specified by `var`, which
764
+ contains the exception raised. You can use it to detect the presence
765
+ of errors, indicating that all happy-path artifacts produced by the step
766
+ are missing.
796
767
 
797
768
  Parameters
798
769
  ----------
799
- packages : Dict[str, str], default: {}
800
- Packages to use for this step. The key is the name of the package
801
- and the value is the version to use.
802
- python : str, optional, default: None
803
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
804
- that the version used will correspond to the version of the Python interpreter used to start the run.
770
+ var : str, optional, default None
771
+ Name of the artifact in which to store the caught exception.
772
+ If not specified, the exception is not stored.
773
+ print_exception : bool, default True
774
+ Determines whether or not the exception is printed to
775
+ stdout when caught.
805
776
  """
806
777
  ...
807
778
 
808
779
  @typing.overload
809
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
810
- ...
811
-
812
- @typing.overload
813
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
814
- ...
815
-
816
- 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):
780
+ 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]]]:
817
781
  """
818
- Specifies the PyPI packages for the step.
819
-
820
- Information in this decorator will augment any
821
- attributes set in the `@pyi_base` flow-level decorator. Hence,
822
- you can use `@pypi_base` to set packages required by all
823
- steps and use `@pypi` to specify step-specific overrides.
782
+ Specifies a timeout for your step.
824
783
 
825
- Parameters
826
- ----------
827
- packages : Dict[str, str], default: {}
828
- Packages to use for this step. The key is the name of the package
829
- and the value is the version to use.
830
- python : str, optional, default: None
831
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
832
- that the version used will correspond to the version of the Python interpreter used to start the run.
833
- """
834
- ...
835
-
836
- @typing.overload
837
- 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]]]:
838
- """
839
- Specifies the number of times the task corresponding
840
- to a step needs to be retried.
784
+ This decorator is useful if this step may hang indefinitely.
841
785
 
842
- This decorator is useful for handling transient errors, such as networking issues.
843
- If your task contains operations that can't be retried safely, e.g. database updates,
844
- it is advisable to annotate it with `@retry(times=0)`.
786
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
787
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
788
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
845
789
 
846
- This can be used in conjunction with the `@catch` decorator. The `@catch`
847
- decorator will execute a no-op task after all retries have been exhausted,
848
- ensuring that the flow execution can continue.
790
+ Note that all the values specified in parameters are added together so if you specify
791
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
849
792
 
850
793
  Parameters
851
794
  ----------
852
- times : int, default 3
853
- Number of times to retry this task.
854
- minutes_between_retries : int, default 2
855
- Number of minutes between retries.
795
+ seconds : int, default 0
796
+ Number of seconds to wait prior to timing out.
797
+ minutes : int, default 0
798
+ Number of minutes to wait prior to timing out.
799
+ hours : int, default 0
800
+ Number of hours to wait prior to timing out.
856
801
  """
857
802
  ...
858
803
 
859
804
  @typing.overload
860
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
805
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
861
806
  ...
862
807
 
863
808
  @typing.overload
864
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
809
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
865
810
  ...
866
811
 
867
- 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):
812
+ 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):
868
813
  """
869
- Specifies the number of times the task corresponding
870
- to a step needs to be retried.
814
+ Specifies a timeout for your step.
871
815
 
872
- This decorator is useful for handling transient errors, such as networking issues.
873
- If your task contains operations that can't be retried safely, e.g. database updates,
874
- it is advisable to annotate it with `@retry(times=0)`.
816
+ This decorator is useful if this step may hang indefinitely.
875
817
 
876
- This can be used in conjunction with the `@catch` decorator. The `@catch`
877
- decorator will execute a no-op task after all retries have been exhausted,
878
- ensuring that the flow execution can continue.
818
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
819
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
820
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
821
+
822
+ Note that all the values specified in parameters are added together so if you specify
823
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
879
824
 
880
825
  Parameters
881
826
  ----------
882
- times : int, default 3
883
- Number of times to retry this task.
884
- minutes_between_retries : int, default 2
885
- Number of minutes between retries.
827
+ seconds : int, default 0
828
+ Number of seconds to wait prior to timing out.
829
+ minutes : int, default 0
830
+ Number of minutes to wait prior to timing out.
831
+ hours : int, default 0
832
+ Number of hours to wait prior to timing out.
886
833
  """
887
834
  ...
888
835
 
@@ -963,56 +910,7 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
963
910
  """
964
911
  ...
965
912
 
966
- @typing.overload
967
- 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]]]:
968
- """
969
- Specifies that the step will success under all circumstances.
970
-
971
- The decorator will create an optional artifact, specified by `var`, which
972
- contains the exception raised. You can use it to detect the presence
973
- of errors, indicating that all happy-path artifacts produced by the step
974
- are missing.
975
-
976
- Parameters
977
- ----------
978
- var : str, optional, default None
979
- Name of the artifact in which to store the caught exception.
980
- If not specified, the exception is not stored.
981
- print_exception : bool, default True
982
- Determines whether or not the exception is printed to
983
- stdout when caught.
984
- """
985
- ...
986
-
987
- @typing.overload
988
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
989
- ...
990
-
991
- @typing.overload
992
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
993
- ...
994
-
995
- 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):
996
- """
997
- Specifies that the step will success under all circumstances.
998
-
999
- The decorator will create an optional artifact, specified by `var`, which
1000
- contains the exception raised. You can use it to detect the presence
1001
- of errors, indicating that all happy-path artifacts produced by the step
1002
- are missing.
1003
-
1004
- Parameters
1005
- ----------
1006
- var : str, optional, default None
1007
- Name of the artifact in which to store the caught exception.
1008
- If not specified, the exception is not stored.
1009
- print_exception : bool, default True
1010
- Determines whether or not the exception is printed to
1011
- stdout when caught.
1012
- """
1013
- ...
1014
-
1015
- 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]]]:
913
+ 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, 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]]]:
1016
914
  """
1017
915
  Specifies that this step should execute on Kubernetes.
1018
916
 
@@ -1068,70 +966,22 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
1068
966
  Shared memory size (in MiB) required for this step
1069
967
  port: int, optional
1070
968
  Port number to specify in the Kubernetes job object
969
+ compute_pool : str, optional, default None
970
+ Compute pool to be used for for this step.
971
+ If not specified, any accessible compute pool within the perimeter is used.
1071
972
  """
1072
973
  ...
1073
974
 
1074
975
  @typing.overload
1075
- 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]]]:
976
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1076
977
  """
1077
- Creates a human-readable report, a Metaflow Card, after this step completes.
1078
-
1079
- Note that you may add multiple `@card` decorators in a step with different parameters.
1080
-
1081
- Parameters
1082
- ----------
1083
- type : str, default 'default'
1084
- Card type.
1085
- id : str, optional, default None
1086
- If multiple cards are present, use this id to identify this card.
1087
- options : Dict[str, Any], default {}
1088
- Options passed to the card. The contents depend on the card type.
1089
- timeout : int, default 45
1090
- Interrupt reporting if it takes more than this many seconds.
1091
-
1092
-
978
+ Decorator prototype for all step decorators. This function gets specialized
979
+ and imported for all decorators types by _import_plugin_decorators().
1093
980
  """
1094
981
  ...
1095
982
 
1096
983
  @typing.overload
1097
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1098
- ...
1099
-
1100
- @typing.overload
1101
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1102
- ...
1103
-
1104
- 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):
1105
- """
1106
- Creates a human-readable report, a Metaflow Card, after this step completes.
1107
-
1108
- Note that you may add multiple `@card` decorators in a step with different parameters.
1109
-
1110
- Parameters
1111
- ----------
1112
- type : str, default 'default'
1113
- Card type.
1114
- id : str, optional, default None
1115
- If multiple cards are present, use this id to identify this card.
1116
- options : Dict[str, Any], default {}
1117
- Options passed to the card. The contents depend on the card type.
1118
- timeout : int, default 45
1119
- Interrupt reporting if it takes more than this many seconds.
1120
-
1121
-
1122
- """
1123
- ...
1124
-
1125
- @typing.overload
1126
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1127
- """
1128
- Decorator prototype for all step decorators. This function gets specialized
1129
- and imported for all decorators types by _import_plugin_decorators().
1130
- """
1131
- ...
1132
-
1133
- @typing.overload
1134
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
984
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1135
985
  ...
1136
986
 
1137
987
  def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
@@ -1174,6 +1024,63 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
1174
1024
  """
1175
1025
  ...
1176
1026
 
1027
+ @typing.overload
1028
+ 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]]]:
1029
+ """
1030
+ Specifies the Conda environment for the step.
1031
+
1032
+ Information in this decorator will augment any
1033
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1034
+ you can use `@conda_base` to set packages required by all
1035
+ steps and use `@conda` to specify step-specific overrides.
1036
+
1037
+ Parameters
1038
+ ----------
1039
+ packages : Dict[str, str], default {}
1040
+ Packages to use for this step. The key is the name of the package
1041
+ and the value is the version to use.
1042
+ libraries : Dict[str, str], default {}
1043
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1044
+ python : str, optional, default None
1045
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1046
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1047
+ disabled : bool, default False
1048
+ If set to True, disables @conda.
1049
+ """
1050
+ ...
1051
+
1052
+ @typing.overload
1053
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1054
+ ...
1055
+
1056
+ @typing.overload
1057
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1058
+ ...
1059
+
1060
+ 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):
1061
+ """
1062
+ Specifies the Conda environment for the step.
1063
+
1064
+ Information in this decorator will augment any
1065
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1066
+ you can use `@conda_base` to set packages required by all
1067
+ steps and use `@conda` to specify step-specific overrides.
1068
+
1069
+ Parameters
1070
+ ----------
1071
+ packages : Dict[str, str], default {}
1072
+ Packages to use for this step. The key is the name of the package
1073
+ and the value is the version to use.
1074
+ libraries : Dict[str, str], default {}
1075
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1076
+ python : str, optional, default None
1077
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1078
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1079
+ disabled : bool, default False
1080
+ If set to True, disables @conda.
1081
+ """
1082
+ ...
1083
+
1177
1084
  @typing.overload
1178
1085
  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]]]:
1179
1086
  """
@@ -1206,101 +1113,218 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
1206
1113
  ...
1207
1114
 
1208
1115
  @typing.overload
1209
- 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]]]:
1116
+ 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]]]:
1210
1117
  """
1211
- Specifies a timeout for your step.
1118
+ Specifies the PyPI packages for the step.
1212
1119
 
1213
- This decorator is useful if this step may hang indefinitely.
1120
+ Information in this decorator will augment any
1121
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1122
+ you can use `@pypi_base` to set packages required by all
1123
+ steps and use `@pypi` to specify step-specific overrides.
1214
1124
 
1215
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1216
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1217
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1125
+ Parameters
1126
+ ----------
1127
+ packages : Dict[str, str], default: {}
1128
+ Packages to use for this step. The key is the name of the package
1129
+ and the value is the version to use.
1130
+ python : str, optional, default: None
1131
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1132
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1133
+ """
1134
+ ...
1135
+
1136
+ @typing.overload
1137
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1138
+ ...
1139
+
1140
+ @typing.overload
1141
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1142
+ ...
1143
+
1144
+ 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):
1145
+ """
1146
+ Specifies the PyPI packages for the step.
1218
1147
 
1219
- Note that all the values specified in parameters are added together so if you specify
1220
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1148
+ Information in this decorator will augment any
1149
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1150
+ you can use `@pypi_base` to set packages required by all
1151
+ steps and use `@pypi` to specify step-specific overrides.
1221
1152
 
1222
1153
  Parameters
1223
1154
  ----------
1224
- seconds : int, default 0
1225
- Number of seconds to wait prior to timing out.
1226
- minutes : int, default 0
1227
- Number of minutes to wait prior to timing out.
1228
- hours : int, default 0
1229
- Number of hours to wait prior to timing out.
1155
+ packages : Dict[str, str], default: {}
1156
+ Packages to use for this step. The key is the name of the package
1157
+ and the value is the version to use.
1158
+ python : str, optional, default: None
1159
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1160
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1230
1161
  """
1231
1162
  ...
1232
1163
 
1233
1164
  @typing.overload
1234
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1165
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1166
+ """
1167
+ Internal decorator to support Fast bakery
1168
+ """
1235
1169
  ...
1236
1170
 
1237
1171
  @typing.overload
1238
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1172
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1239
1173
  ...
1240
1174
 
1241
- 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):
1175
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1242
1176
  """
1243
- Specifies a timeout for your step.
1177
+ Internal decorator to support Fast bakery
1178
+ """
1179
+ ...
1180
+
1181
+ @typing.overload
1182
+ 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]]]:
1183
+ """
1184
+ Specifies the number of times the task corresponding
1185
+ to a step needs to be retried.
1244
1186
 
1245
- This decorator is useful if this step may hang indefinitely.
1187
+ This decorator is useful for handling transient errors, such as networking issues.
1188
+ If your task contains operations that can't be retried safely, e.g. database updates,
1189
+ it is advisable to annotate it with `@retry(times=0)`.
1246
1190
 
1247
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1248
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1249
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1191
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1192
+ decorator will execute a no-op task after all retries have been exhausted,
1193
+ ensuring that the flow execution can continue.
1250
1194
 
1251
- Note that all the values specified in parameters are added together so if you specify
1252
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1195
+ Parameters
1196
+ ----------
1197
+ times : int, default 3
1198
+ Number of times to retry this task.
1199
+ minutes_between_retries : int, default 2
1200
+ Number of minutes between retries.
1201
+ """
1202
+ ...
1203
+
1204
+ @typing.overload
1205
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1206
+ ...
1207
+
1208
+ @typing.overload
1209
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1210
+ ...
1211
+
1212
+ 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):
1213
+ """
1214
+ Specifies the number of times the task corresponding
1215
+ to a step needs to be retried.
1216
+
1217
+ This decorator is useful for handling transient errors, such as networking issues.
1218
+ If your task contains operations that can't be retried safely, e.g. database updates,
1219
+ it is advisable to annotate it with `@retry(times=0)`.
1220
+
1221
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1222
+ decorator will execute a no-op task after all retries have been exhausted,
1223
+ ensuring that the flow execution can continue.
1253
1224
 
1254
1225
  Parameters
1255
1226
  ----------
1256
- seconds : int, default 0
1257
- Number of seconds to wait prior to timing out.
1258
- minutes : int, default 0
1259
- Number of minutes to wait prior to timing out.
1260
- hours : int, default 0
1261
- Number of hours to wait prior to timing out.
1227
+ times : int, default 3
1228
+ Number of times to retry this task.
1229
+ minutes_between_retries : int, default 2
1230
+ Number of minutes between retries.
1262
1231
  """
1263
1232
  ...
1264
1233
 
1265
1234
  @typing.overload
1266
- def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1235
+ 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]]]:
1267
1236
  """
1268
- Specifies the event(s) that this flow depends on.
1237
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1238
+
1239
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1240
+
1241
+ Parameters
1242
+ ----------
1243
+ type : str, default 'default'
1244
+ Card type.
1245
+ id : str, optional, default None
1246
+ If multiple cards are present, use this id to identify this card.
1247
+ options : Dict[str, Any], default {}
1248
+ Options passed to the card. The contents depend on the card type.
1249
+ timeout : int, default 45
1250
+ Interrupt reporting if it takes more than this many seconds.
1251
+
1252
+
1253
+ """
1254
+ ...
1255
+
1256
+ @typing.overload
1257
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1258
+ ...
1259
+
1260
+ @typing.overload
1261
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1262
+ ...
1263
+
1264
+ 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):
1265
+ """
1266
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1267
+
1268
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1269
+
1270
+ Parameters
1271
+ ----------
1272
+ type : str, default 'default'
1273
+ Card type.
1274
+ id : str, optional, default None
1275
+ If multiple cards are present, use this id to identify this card.
1276
+ options : Dict[str, Any], default {}
1277
+ Options passed to the card. The contents depend on the card type.
1278
+ timeout : int, default 45
1279
+ Interrupt reporting if it takes more than this many seconds.
1280
+
1281
+
1282
+ """
1283
+ ...
1284
+
1285
+ @typing.overload
1286
+ 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]]:
1287
+ """
1288
+ Specifies the flow(s) that this flow depends on.
1269
1289
 
1270
1290
  ```
1271
- @trigger(event='foo')
1291
+ @trigger_on_finish(flow='FooFlow')
1272
1292
  ```
1273
1293
  or
1274
1294
  ```
1275
- @trigger(events=['foo', 'bar'])
1295
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1276
1296
  ```
1297
+ This decorator respects the @project decorator and triggers the flow
1298
+ when upstream runs within the same namespace complete successfully
1277
1299
 
1278
- Additionally, you can specify the parameter mappings
1279
- to map event payload to Metaflow parameters for the flow.
1300
+ Additionally, you can specify project aware upstream flow dependencies
1301
+ by specifying the fully qualified project_flow_name.
1280
1302
  ```
1281
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1303
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1282
1304
  ```
1283
1305
  or
1284
1306
  ```
1285
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1286
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1307
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1287
1308
  ```
1288
1309
 
1289
- 'parameters' can also be a list of strings and tuples like so:
1290
- ```
1291
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1292
- ```
1293
- This is equivalent to:
1310
+ You can also specify just the project or project branch (other values will be
1311
+ inferred from the current project or project branch):
1294
1312
  ```
1295
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1313
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1296
1314
  ```
1297
1315
 
1316
+ Note that `branch` is typically one of:
1317
+ - `prod`
1318
+ - `user.bob`
1319
+ - `test.my_experiment`
1320
+ - `prod.staging`
1321
+
1298
1322
  Parameters
1299
1323
  ----------
1300
- event : Union[str, Dict[str, Any]], optional, default None
1301
- Event dependency for this flow.
1302
- events : List[Union[str, Dict[str, Any]]], default []
1303
- Events dependency for this flow.
1324
+ flow : Union[str, Dict[str, str]], optional, default None
1325
+ Upstream flow dependency for this flow.
1326
+ flows : List[Union[str, Dict[str, str]]], default []
1327
+ Upstream flow dependencies for this flow.
1304
1328
  options : Dict[str, Any], default {}
1305
1329
  Backend-specific configuration for tuning eventing behavior.
1306
1330
 
@@ -1309,47 +1333,51 @@ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = No
1309
1333
  ...
1310
1334
 
1311
1335
  @typing.overload
1312
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1336
+ def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1313
1337
  ...
1314
1338
 
1315
- def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1339
+ 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] = {}):
1316
1340
  """
1317
- Specifies the event(s) that this flow depends on.
1341
+ Specifies the flow(s) that this flow depends on.
1318
1342
 
1319
1343
  ```
1320
- @trigger(event='foo')
1344
+ @trigger_on_finish(flow='FooFlow')
1321
1345
  ```
1322
1346
  or
1323
1347
  ```
1324
- @trigger(events=['foo', 'bar'])
1348
+ @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1325
1349
  ```
1350
+ This decorator respects the @project decorator and triggers the flow
1351
+ when upstream runs within the same namespace complete successfully
1326
1352
 
1327
- Additionally, you can specify the parameter mappings
1328
- to map event payload to Metaflow parameters for the flow.
1353
+ Additionally, you can specify project aware upstream flow dependencies
1354
+ by specifying the fully qualified project_flow_name.
1329
1355
  ```
1330
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1356
+ @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1331
1357
  ```
1332
1358
  or
1333
1359
  ```
1334
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1335
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1360
+ @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1336
1361
  ```
1337
1362
 
1338
- 'parameters' can also be a list of strings and tuples like so:
1339
- ```
1340
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1341
- ```
1342
- This is equivalent to:
1363
+ You can also specify just the project or project branch (other values will be
1364
+ inferred from the current project or project branch):
1343
1365
  ```
1344
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1366
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1345
1367
  ```
1346
1368
 
1369
+ Note that `branch` is typically one of:
1370
+ - `prod`
1371
+ - `user.bob`
1372
+ - `test.my_experiment`
1373
+ - `prod.staging`
1374
+
1347
1375
  Parameters
1348
1376
  ----------
1349
- event : Union[str, Dict[str, Any]], optional, default None
1350
- Event dependency for this flow.
1351
- events : List[Union[str, Dict[str, Any]]], default []
1352
- Events dependency for this flow.
1377
+ flow : Union[str, Dict[str, str]], optional, default None
1378
+ Upstream flow dependency for this flow.
1379
+ flows : List[Union[str, Dict[str, str]]], default []
1380
+ Upstream flow dependencies for this flow.
1353
1381
  options : Dict[str, Any], default {}
1354
1382
  Backend-specific configuration for tuning eventing behavior.
1355
1383
 
@@ -1357,49 +1385,44 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1357
1385
  """
1358
1386
  ...
1359
1387
 
1360
- @typing.overload
1361
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1388
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1362
1389
  """
1363
- Specifies the PyPI packages for all steps of the flow.
1390
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1364
1391
 
1365
- Use `@pypi_base` to set common packages required by all
1366
- steps and use `@pypi` to specify step-specific overrides.
1367
- Parameters
1368
- ----------
1369
- packages : Dict[str, str], default: {}
1370
- Packages to use for this flow. The key is the name of the package
1371
- and the value is the version to use.
1372
- python : str, optional, default: None
1373
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1374
- that the version used will correspond to the version of the Python interpreter used to start the run.
1375
- """
1376
- ...
1377
-
1378
- @typing.overload
1379
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1380
- ...
1381
-
1382
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1383
- """
1384
- Specifies the PyPI packages for all steps of the flow.
1392
+ User code call
1393
+ -----------
1394
+ @nim(
1395
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1396
+ backend='managed'
1397
+ )
1398
+
1399
+ Valid backend options
1400
+ ---------------------
1401
+ - 'managed': Outerbounds selects a compute provider based on the model.
1402
+ - 🚧 'dataplane': Run in your account.
1403
+
1404
+ Valid model options
1405
+ ----------------
1406
+ - 'meta/llama3-8b-instruct': 8B parameter model
1407
+ - 'meta/llama3-70b-instruct': 70B parameter model
1408
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1385
1409
 
1386
- Use `@pypi_base` to set common packages required by all
1387
- steps and use `@pypi` to specify step-specific overrides.
1388
1410
  Parameters
1389
1411
  ----------
1390
- packages : Dict[str, str], default: {}
1391
- Packages to use for this flow. The key is the name of the package
1392
- and the value is the version to use.
1393
- python : str, optional, default: None
1394
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1395
- that the version used will correspond to the version of the Python interpreter used to start the run.
1412
+ models: list[NIM]
1413
+ List of NIM containers running models in sidecars.
1414
+ backend: str
1415
+ Compute provider to run the NIM container.
1396
1416
  """
1397
1417
  ...
1398
1418
 
1399
- 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]]:
1419
+ 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]]:
1400
1420
  """
1401
- 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.
1402
- 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.
1421
+ 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)
1422
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1423
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1424
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1425
+ starts only after all sensors finish.
1403
1426
 
1404
1427
  Parameters
1405
1428
  ----------
@@ -1420,116 +1443,109 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
1420
1443
  Name of the sensor on Airflow
1421
1444
  description : str
1422
1445
  Description of sensor in the Airflow UI
1423
- external_dag_id : str
1424
- The dag_id that contains the task you want to wait for.
1425
- external_task_ids : List[str]
1426
- The list of task_ids that you want to wait for.
1427
- If None (default value) the sensor waits for the DAG. (Default: None)
1428
- allowed_states : List[str]
1429
- Iterable of allowed states, (Default: ['success'])
1430
- failed_states : List[str]
1431
- Iterable of failed or dis-allowed states. (Default: None)
1432
- execution_delta : datetime.timedelta
1433
- time difference with the previous execution to look at,
1434
- the default is the same logical date as the current task or DAG. (Default: None)
1435
- check_existence: bool
1436
- Set to True to check if the external task exists or check if
1437
- the DAG to wait for exists. (Default: True)
1446
+ bucket_key : Union[str, List[str]]
1447
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1448
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1449
+ bucket_name : str
1450
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1451
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1452
+ wildcard_match : bool
1453
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1454
+ aws_conn_id : str
1455
+ a reference to the s3 connection on Airflow. (Default: None)
1456
+ verify : bool
1457
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1438
1458
  """
1439
1459
  ...
1440
1460
 
1441
1461
  @typing.overload
1442
- 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]]:
1462
+ def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1443
1463
  """
1444
- Specifies the times when the flow should be run when running on a
1445
- production scheduler.
1464
+ Specifies the Conda environment for all steps of the flow.
1465
+
1466
+ Use `@conda_base` to set common libraries required by all
1467
+ steps and use `@conda` to specify step-specific additions.
1446
1468
 
1447
1469
  Parameters
1448
1470
  ----------
1449
- hourly : bool, default False
1450
- Run the workflow hourly.
1451
- daily : bool, default True
1452
- Run the workflow daily.
1453
- weekly : bool, default False
1454
- Run the workflow weekly.
1455
- cron : str, optional, default None
1456
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1457
- specified by this expression.
1458
- timezone : str, optional, default None
1459
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1460
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1471
+ packages : Dict[str, str], default {}
1472
+ Packages to use for this flow. The key is the name of the package
1473
+ and the value is the version to use.
1474
+ libraries : Dict[str, str], default {}
1475
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1476
+ python : str, optional, default None
1477
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1478
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1479
+ disabled : bool, default False
1480
+ If set to True, disables Conda.
1461
1481
  """
1462
1482
  ...
1463
1483
 
1464
1484
  @typing.overload
1465
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1485
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1466
1486
  ...
1467
1487
 
1468
- def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1469
- """
1470
- Specifies the times when the flow should be run when running on a
1471
- production scheduler.
1472
-
1473
- Parameters
1474
- ----------
1475
- hourly : bool, default False
1476
- Run the workflow hourly.
1477
- daily : bool, default True
1478
- Run the workflow daily.
1479
- weekly : bool, default False
1480
- Run the workflow weekly.
1481
- cron : str, optional, default None
1482
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1483
- specified by this expression.
1484
- timezone : str, optional, default None
1485
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1486
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1488
+ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1489
+ """
1490
+ Specifies the Conda environment for all steps of the flow.
1491
+
1492
+ Use `@conda_base` to set common libraries required by all
1493
+ steps and use `@conda` to specify step-specific additions.
1494
+
1495
+ Parameters
1496
+ ----------
1497
+ packages : Dict[str, str], default {}
1498
+ Packages to use for this flow. The key is the name of the package
1499
+ and the value is the version to use.
1500
+ libraries : Dict[str, str], default {}
1501
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1502
+ python : str, optional, default None
1503
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1504
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1505
+ disabled : bool, default False
1506
+ If set to True, disables Conda.
1487
1507
  """
1488
1508
  ...
1489
1509
 
1490
1510
  @typing.overload
1491
- 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]]:
1511
+ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1492
1512
  """
1493
- Specifies the flow(s) that this flow depends on.
1513
+ Specifies the event(s) that this flow depends on.
1494
1514
 
1495
1515
  ```
1496
- @trigger_on_finish(flow='FooFlow')
1516
+ @trigger(event='foo')
1497
1517
  ```
1498
1518
  or
1499
1519
  ```
1500
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1520
+ @trigger(events=['foo', 'bar'])
1501
1521
  ```
1502
- This decorator respects the @project decorator and triggers the flow
1503
- when upstream runs within the same namespace complete successfully
1504
1522
 
1505
- Additionally, you can specify project aware upstream flow dependencies
1506
- by specifying the fully qualified project_flow_name.
1523
+ Additionally, you can specify the parameter mappings
1524
+ to map event payload to Metaflow parameters for the flow.
1507
1525
  ```
1508
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1526
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1509
1527
  ```
1510
1528
  or
1511
1529
  ```
1512
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1530
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1531
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1513
1532
  ```
1514
1533
 
1515
- You can also specify just the project or project branch (other values will be
1516
- inferred from the current project or project branch):
1534
+ 'parameters' can also be a list of strings and tuples like so:
1517
1535
  ```
1518
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1536
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1537
+ ```
1538
+ This is equivalent to:
1539
+ ```
1540
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1519
1541
  ```
1520
-
1521
- Note that `branch` is typically one of:
1522
- - `prod`
1523
- - `user.bob`
1524
- - `test.my_experiment`
1525
- - `prod.staging`
1526
1542
 
1527
1543
  Parameters
1528
1544
  ----------
1529
- flow : Union[str, Dict[str, str]], optional, default None
1530
- Upstream flow dependency for this flow.
1531
- flows : List[Union[str, Dict[str, str]]], default []
1532
- Upstream flow dependencies for this flow.
1545
+ event : Union[str, Dict[str, Any]], optional, default None
1546
+ Event dependency for this flow.
1547
+ events : List[Union[str, Dict[str, Any]]], default []
1548
+ Events dependency for this flow.
1533
1549
  options : Dict[str, Any], default {}
1534
1550
  Backend-specific configuration for tuning eventing behavior.
1535
1551
 
@@ -1538,51 +1554,47 @@ def trigger_on_finish(*, flow: typing.Union[str, typing.Dict[str, str], None] =
1538
1554
  ...
1539
1555
 
1540
1556
  @typing.overload
1541
- def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1557
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1542
1558
  ...
1543
1559
 
1544
- 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] = {}):
1560
+ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1545
1561
  """
1546
- Specifies the flow(s) that this flow depends on.
1562
+ Specifies the event(s) that this flow depends on.
1547
1563
 
1548
1564
  ```
1549
- @trigger_on_finish(flow='FooFlow')
1565
+ @trigger(event='foo')
1550
1566
  ```
1551
1567
  or
1552
1568
  ```
1553
- @trigger_on_finish(flows=['FooFlow', 'BarFlow'])
1569
+ @trigger(events=['foo', 'bar'])
1554
1570
  ```
1555
- This decorator respects the @project decorator and triggers the flow
1556
- when upstream runs within the same namespace complete successfully
1557
1571
 
1558
- Additionally, you can specify project aware upstream flow dependencies
1559
- by specifying the fully qualified project_flow_name.
1572
+ Additionally, you can specify the parameter mappings
1573
+ to map event payload to Metaflow parameters for the flow.
1560
1574
  ```
1561
- @trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
1575
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1562
1576
  ```
1563
1577
  or
1564
1578
  ```
1565
- @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1579
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1580
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1566
1581
  ```
1567
1582
 
1568
- You can also specify just the project or project branch (other values will be
1569
- inferred from the current project or project branch):
1583
+ 'parameters' can also be a list of strings and tuples like so:
1570
1584
  ```
1571
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1585
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1586
+ ```
1587
+ This is equivalent to:
1588
+ ```
1589
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1572
1590
  ```
1573
-
1574
- Note that `branch` is typically one of:
1575
- - `prod`
1576
- - `user.bob`
1577
- - `test.my_experiment`
1578
- - `prod.staging`
1579
1591
 
1580
1592
  Parameters
1581
1593
  ----------
1582
- flow : Union[str, Dict[str, str]], optional, default None
1583
- Upstream flow dependency for this flow.
1584
- flows : List[Union[str, Dict[str, str]]], default []
1585
- Upstream flow dependencies for this flow.
1594
+ event : Union[str, Dict[str, Any]], optional, default None
1595
+ Event dependency for this flow.
1596
+ events : List[Union[str, Dict[str, Any]]], default []
1597
+ Events dependency for this flow.
1586
1598
  options : Dict[str, Any], default {}
1587
1599
  Backend-specific configuration for tuning eventing behavior.
1588
1600
 
@@ -1591,51 +1603,51 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1591
1603
  ...
1592
1604
 
1593
1605
  @typing.overload
1594
- def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1606
+ 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]]:
1595
1607
  """
1596
- Specifies the Conda environment for all steps of the flow.
1597
-
1598
- Use `@conda_base` to set common libraries required by all
1599
- steps and use `@conda` to specify step-specific additions.
1608
+ Specifies the times when the flow should be run when running on a
1609
+ production scheduler.
1600
1610
 
1601
1611
  Parameters
1602
1612
  ----------
1603
- packages : Dict[str, str], default {}
1604
- Packages to use for this flow. The key is the name of the package
1605
- and the value is the version to use.
1606
- libraries : Dict[str, str], default {}
1607
- Supported for backward compatibility. When used with packages, packages will take precedence.
1608
- python : str, optional, default None
1609
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1610
- that the version used will correspond to the version of the Python interpreter used to start the run.
1611
- disabled : bool, default False
1612
- If set to True, disables Conda.
1613
+ hourly : bool, default False
1614
+ Run the workflow hourly.
1615
+ daily : bool, default True
1616
+ Run the workflow daily.
1617
+ weekly : bool, default False
1618
+ Run the workflow weekly.
1619
+ cron : str, optional, default None
1620
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1621
+ specified by this expression.
1622
+ timezone : str, optional, default None
1623
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1624
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1613
1625
  """
1614
1626
  ...
1615
1627
 
1616
1628
  @typing.overload
1617
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1629
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1618
1630
  ...
1619
1631
 
1620
- def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
1632
+ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1621
1633
  """
1622
- Specifies the Conda environment for all steps of the flow.
1623
-
1624
- Use `@conda_base` to set common libraries required by all
1625
- steps and use `@conda` to specify step-specific additions.
1634
+ Specifies the times when the flow should be run when running on a
1635
+ production scheduler.
1626
1636
 
1627
1637
  Parameters
1628
1638
  ----------
1629
- packages : Dict[str, str], default {}
1630
- Packages to use for this flow. The key is the name of the package
1631
- and the value is the version to use.
1632
- libraries : Dict[str, str], default {}
1633
- Supported for backward compatibility. When used with packages, packages will take precedence.
1634
- python : str, optional, default None
1635
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1636
- that the version used will correspond to the version of the Python interpreter used to start the run.
1637
- disabled : bool, default False
1638
- If set to True, disables Conda.
1639
+ hourly : bool, default False
1640
+ Run the workflow hourly.
1641
+ daily : bool, default True
1642
+ Run the workflow daily.
1643
+ weekly : bool, default False
1644
+ Run the workflow weekly.
1645
+ cron : str, optional, default None
1646
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1647
+ specified by this expression.
1648
+ timezone : str, optional, default None
1649
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1650
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1639
1651
  """
1640
1652
  ...
1641
1653
 
@@ -1657,13 +1669,10 @@ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typ
1657
1669
  """
1658
1670
  ...
1659
1671
 
1660
- 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]]:
1672
+ 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]]:
1661
1673
  """
1662
- 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)
1663
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1664
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1665
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1666
- starts only after all sensors finish.
1674
+ 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.
1675
+ 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.
1667
1676
 
1668
1677
  Parameters
1669
1678
  ----------
@@ -1684,49 +1693,60 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1684
1693
  Name of the sensor on Airflow
1685
1694
  description : str
1686
1695
  Description of sensor in the Airflow UI
1687
- bucket_key : Union[str, List[str]]
1688
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1689
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1690
- bucket_name : str
1691
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1692
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1693
- wildcard_match : bool
1694
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1695
- aws_conn_id : str
1696
- a reference to the s3 connection on Airflow. (Default: None)
1697
- verify : bool
1698
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1696
+ external_dag_id : str
1697
+ The dag_id that contains the task you want to wait for.
1698
+ external_task_ids : List[str]
1699
+ The list of task_ids that you want to wait for.
1700
+ If None (default value) the sensor waits for the DAG. (Default: None)
1701
+ allowed_states : List[str]
1702
+ Iterable of allowed states, (Default: ['success'])
1703
+ failed_states : List[str]
1704
+ Iterable of failed or dis-allowed states. (Default: None)
1705
+ execution_delta : datetime.timedelta
1706
+ time difference with the previous execution to look at,
1707
+ the default is the same logical date as the current task or DAG. (Default: None)
1708
+ check_existence: bool
1709
+ Set to True to check if the external task exists or check if
1710
+ the DAG to wait for exists. (Default: True)
1699
1711
  """
1700
1712
  ...
1701
1713
 
1702
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1714
+ @typing.overload
1715
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1703
1716
  """
1704
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1705
-
1706
- User code call
1707
- -----------
1708
- @nim(
1709
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1710
- backend='managed'
1711
- )
1712
-
1713
- Valid backend options
1714
- ---------------------
1715
- - 'managed': Outerbounds selects a compute provider based on the model.
1716
- - 🚧 'dataplane': Run in your account.
1717
+ Specifies the PyPI packages for all steps of the flow.
1717
1718
 
1718
- Valid model options
1719
- ----------------
1720
- - 'meta/llama3-8b-instruct': 8B parameter model
1721
- - 'meta/llama3-70b-instruct': 70B parameter model
1722
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1719
+ Use `@pypi_base` to set common packages required by all
1720
+ steps and use `@pypi` to specify step-specific overrides.
1721
+ Parameters
1722
+ ----------
1723
+ packages : Dict[str, str], default: {}
1724
+ Packages to use for this flow. The key is the name of the package
1725
+ and the value is the version to use.
1726
+ python : str, optional, default: None
1727
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1728
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1729
+ """
1730
+ ...
1731
+
1732
+ @typing.overload
1733
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1734
+ ...
1735
+
1736
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1737
+ """
1738
+ Specifies the PyPI packages for all steps of the flow.
1723
1739
 
1740
+ Use `@pypi_base` to set common packages required by all
1741
+ steps and use `@pypi` to specify step-specific overrides.
1724
1742
  Parameters
1725
1743
  ----------
1726
- models: list[NIM]
1727
- List of NIM containers running models in sidecars.
1728
- backend: str
1729
- Compute provider to run the NIM container.
1744
+ packages : Dict[str, str], default: {}
1745
+ Packages to use for this flow. The key is the name of the package
1746
+ and the value is the version to use.
1747
+ python : str, optional, default: None
1748
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1749
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1730
1750
  """
1731
1751
  ...
1732
1752
 
@@ -2681,7 +2701,7 @@ class DataArtifact(metaflow.client.core.MetaflowObject, metaclass=type):
2681
2701
  ...
2682
2702
 
2683
2703
  class Runner(object, metaclass=type):
2684
- def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, **kwargs):
2704
+ def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
2685
2705
  ...
2686
2706
  def __enter__(self) -> metaflow.runner.metaflow_runner.Runner:
2687
2707
  ...
@@ -2773,7 +2793,7 @@ class Runner(object, metaclass=type):
2773
2793
  ...
2774
2794
 
2775
2795
  class NBRunner(object, metaclass=type):
2776
- def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", **kwargs):
2796
+ 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):
2777
2797
  ...
2778
2798
  def nbrun(self, **kwargs):
2779
2799
  """
@@ -2879,7 +2899,7 @@ class NBRunner(object, metaclass=type):
2879
2899
  ...
2880
2900
 
2881
2901
  class Deployer(object, metaclass=type):
2882
- def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, **kwargs):
2902
+ def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
2883
2903
  ...
2884
2904
  def _Deployer__make_function(self, deployer_class):
2885
2905
  """
@@ -2899,7 +2919,7 @@ class Deployer(object, metaclass=type):
2899
2919
  ...
2900
2920
 
2901
2921
  class NBDeployer(object, metaclass=type):
2902
- def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", **kwargs):
2922
+ 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):
2903
2923
  ...
2904
2924
  def cleanup(self):
2905
2925
  """