ob-metaflow-stubs 3.2__py2.py3-none-any.whl → 3.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 (134) hide show
  1. metaflow-stubs/__init__.pyi +369 -369
  2. metaflow-stubs/cards.pyi +3 -3
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +5 -5
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +1 -1
  8. metaflow-stubs/events.pyi +2 -2
  9. metaflow-stubs/exception.pyi +1 -1
  10. metaflow-stubs/flowspec.pyi +3 -3
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +4 -4
  13. metaflow-stubs/metadata/metadata.pyi +1 -1
  14. metaflow-stubs/metadata/util.pyi +1 -1
  15. metaflow-stubs/metaflow_config.pyi +1 -1
  16. metaflow-stubs/metaflow_current.pyi +2 -2
  17. metaflow-stubs/mflog/mflog.pyi +1 -1
  18. metaflow-stubs/multicore_utils.pyi +1 -1
  19. metaflow-stubs/parameters.pyi +3 -3
  20. metaflow-stubs/plugins/__init__.pyi +2 -2
  21. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  22. metaflow-stubs/plugins/airflow/airflow.pyi +2 -2
  23. metaflow-stubs/plugins/airflow/airflow_cli.pyi +2 -2
  24. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +1 -1
  25. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  26. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  27. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  28. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
  29. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
  30. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
  31. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  32. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  33. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  34. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  35. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +3 -3
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
  37. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  38. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  39. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  40. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  41. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  42. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +1 -1
  43. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  44. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +2 -2
  45. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  46. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +2 -2
  47. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  48. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +1 -1
  49. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  50. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +1 -1
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +3 -3
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +1 -1
  56. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  57. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  58. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  59. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  60. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  61. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  62. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  63. metaflow-stubs/plugins/cards/card_cli.pyi +3 -3
  64. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  66. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  67. metaflow-stubs/plugins/cards/card_decorator.pyi +1 -1
  68. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  69. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  71. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +1 -1
  72. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +1 -1
  73. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +1 -1
  74. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +1 -1
  75. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +1 -1
  76. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  77. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  78. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  79. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
  80. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  81. metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
  82. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  83. metaflow-stubs/plugins/catch_decorator.pyi +2 -2
  84. metaflow-stubs/plugins/datatools/__init__.pyi +1 -1
  85. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  86. metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
  87. metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
  88. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  89. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  90. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  91. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  92. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  93. metaflow-stubs/plugins/events_decorator.pyi +1 -1
  94. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  95. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  96. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  97. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +2 -2
  98. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  99. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  100. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  101. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  102. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  103. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +2 -2
  105. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  106. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
  107. metaflow-stubs/plugins/package_cli.pyi +1 -1
  108. metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
  109. metaflow-stubs/plugins/perimeters.pyi +1 -1
  110. metaflow-stubs/plugins/project_decorator.pyi +1 -1
  111. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  112. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  113. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  114. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  115. metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
  116. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  117. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  118. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  119. metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
  120. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +1 -1
  121. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  122. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  123. metaflow-stubs/plugins/tag_cli.pyi +3 -3
  124. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
  125. metaflow-stubs/plugins/timeout_decorator.pyi +1 -1
  126. metaflow-stubs/procpoll.pyi +1 -1
  127. metaflow-stubs/profilers/__init__.pyi +1 -1
  128. metaflow-stubs/pylint_wrapper.pyi +1 -1
  129. metaflow-stubs/tagging_util.pyi +1 -1
  130. {ob_metaflow_stubs-3.2.dist-info → ob_metaflow_stubs-3.3.dist-info}/METADATA +1 -1
  131. ob_metaflow_stubs-3.3.dist-info/RECORD +134 -0
  132. ob_metaflow_stubs-3.2.dist-info/RECORD +0 -134
  133. {ob_metaflow_stubs-3.2.dist-info → ob_metaflow_stubs-3.3.dist-info}/WHEEL +0 -0
  134. {ob_metaflow_stubs-3.2.dist-info → ob_metaflow_stubs-3.3.dist-info}/top_level.txt +0 -0
@@ -1,23 +1,23 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.11.14.1+ob(v1) #
4
- # Generated on 2024-05-07T00:05:40.513974 #
4
+ # Generated on 2024-05-13T17:42:14.215304 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import io
12
- import metaflow.parameters
13
- import datetime
14
11
  import typing
15
- import metaflow.events
12
+ import datetime
13
+ import metaflow._vendor.click.types
14
+ import metaflow.parameters
15
+ import metaflow.client.core
16
16
  import metaflow.plugins.datatools.s3.s3
17
- import metaflow.datastore.inputs
18
17
  import metaflow.metaflow_current
19
- import metaflow.client.core
20
- import metaflow._vendor.click.types
18
+ import metaflow.events
19
+ import metaflow.datastore.inputs
20
+ import io
21
21
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
22
22
  StepFlag = typing.NewType("StepFlag", bool)
23
23
 
@@ -726,136 +726,102 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
726
726
  ...
727
727
 
728
728
  @typing.overload
729
- def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
729
+ 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]]]:
730
730
  """
731
- Specifies a timeout for your step.
732
-
733
- This decorator is useful if this step may hang indefinitely.
734
-
735
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
736
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
737
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
731
+ Specifies that the step will success under all circumstances.
738
732
 
739
- Note that all the values specified in parameters are added together so if you specify
740
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
733
+ The decorator will create an optional artifact, specified by `var`, which
734
+ contains the exception raised. You can use it to detect the presence
735
+ of errors, indicating that all happy-path artifacts produced by the step
736
+ are missing.
741
737
 
742
738
  Parameters
743
739
  ----------
744
- seconds : int, default 0
745
- Number of seconds to wait prior to timing out.
746
- minutes : int, default 0
747
- Number of minutes to wait prior to timing out.
748
- hours : int, default 0
749
- Number of hours to wait prior to timing out.
740
+ var : str, optional, default None
741
+ Name of the artifact in which to store the caught exception.
742
+ If not specified, the exception is not stored.
743
+ print_exception : bool, default True
744
+ Determines whether or not the exception is printed to
745
+ stdout when caught.
750
746
  """
751
747
  ...
752
748
 
753
749
  @typing.overload
754
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
750
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
755
751
  ...
756
752
 
757
753
  @typing.overload
758
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
754
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
759
755
  ...
760
756
 
761
- def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
757
+ 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):
762
758
  """
763
- Specifies a timeout for your step.
764
-
765
- This decorator is useful if this step may hang indefinitely.
766
-
767
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
768
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
769
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
759
+ Specifies that the step will success under all circumstances.
770
760
 
771
- Note that all the values specified in parameters are added together so if you specify
772
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
761
+ The decorator will create an optional artifact, specified by `var`, which
762
+ contains the exception raised. You can use it to detect the presence
763
+ of errors, indicating that all happy-path artifacts produced by the step
764
+ are missing.
773
765
 
774
766
  Parameters
775
767
  ----------
776
- seconds : int, default 0
777
- Number of seconds to wait prior to timing out.
778
- minutes : int, default 0
779
- Number of minutes to wait prior to timing out.
780
- hours : int, default 0
781
- Number of hours to wait prior to timing out.
768
+ var : str, optional, default None
769
+ Name of the artifact in which to store the caught exception.
770
+ If not specified, the exception is not stored.
771
+ print_exception : bool, default True
772
+ Determines whether or not the exception is printed to
773
+ stdout when caught.
782
774
  """
783
775
  ...
784
776
 
785
777
  @typing.overload
786
- def resources(*, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
778
+ 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]]]:
787
779
  """
788
- Specifies the resources needed when executing this step.
789
-
790
- Use `@resources` to specify the resource requirements
791
- independently of the specific compute layer (`@batch`, `@kubernetes`).
780
+ Creates a human-readable report, a Metaflow Card, after this step completes.
792
781
 
793
- You can choose the compute layer on the command line by executing e.g.
794
- ```
795
- python myflow.py run --with batch
796
- ```
797
- or
798
- ```
799
- python myflow.py run --with kubernetes
800
- ```
801
- which executes the flow on the desired system using the
802
- requirements specified in `@resources`.
782
+ Note that you may add multiple `@card` decorators in a step with different parameters.
803
783
 
804
784
  Parameters
805
785
  ----------
806
- cpu : int, default 1
807
- Number of CPUs required for this step.
808
- gpu : int, default 0
809
- Number of GPUs required for this step.
810
- disk : int, optional, default None
811
- Disk size (in MB) required for this step. Only applies on Kubernetes.
812
- memory : int, default 4096
813
- Memory size (in MB) required for this step.
814
- shared_memory : int, optional, default None
815
- The value for the size (in MiB) of the /dev/shm volume for this step.
816
- This parameter maps to the `--shm-size` option in Docker.
786
+ type : str, default 'default'
787
+ Card type.
788
+ id : str, optional, default None
789
+ If multiple cards are present, use this id to identify this card.
790
+ options : Dict[str, Any], default {}
791
+ Options passed to the card. The contents depend on the card type.
792
+ timeout : int, default 45
793
+ Interrupt reporting if it takes more than this many seconds.
794
+
795
+
817
796
  """
818
797
  ...
819
798
 
820
799
  @typing.overload
821
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
800
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
822
801
  ...
823
802
 
824
803
  @typing.overload
825
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
804
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
826
805
  ...
827
806
 
828
- def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
807
+ 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):
829
808
  """
830
- Specifies the resources needed when executing this step.
831
-
832
- Use `@resources` to specify the resource requirements
833
- independently of the specific compute layer (`@batch`, `@kubernetes`).
809
+ Creates a human-readable report, a Metaflow Card, after this step completes.
834
810
 
835
- You can choose the compute layer on the command line by executing e.g.
836
- ```
837
- python myflow.py run --with batch
838
- ```
839
- or
840
- ```
841
- python myflow.py run --with kubernetes
842
- ```
843
- which executes the flow on the desired system using the
844
- requirements specified in `@resources`.
811
+ Note that you may add multiple `@card` decorators in a step with different parameters.
845
812
 
846
813
  Parameters
847
814
  ----------
848
- cpu : int, default 1
849
- Number of CPUs required for this step.
850
- gpu : int, default 0
851
- Number of GPUs required for this step.
852
- disk : int, optional, default None
853
- Disk size (in MB) required for this step. Only applies on Kubernetes.
854
- memory : int, default 4096
855
- Memory size (in MB) required for this step.
856
- shared_memory : int, optional, default None
857
- The value for the size (in MiB) of the /dev/shm volume for this step.
858
- This parameter maps to the `--shm-size` option in Docker.
815
+ type : str, default 'default'
816
+ Card type.
817
+ id : str, optional, default None
818
+ If multiple cards are present, use this id to identify this card.
819
+ options : Dict[str, Any], default {}
820
+ Options passed to the card. The contents depend on the card type.
821
+ timeout : int, default 45
822
+ Interrupt reporting if it takes more than this many seconds.
823
+
824
+
859
825
  """
860
826
  ...
861
827
 
@@ -913,82 +879,128 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
913
879
  ...
914
880
 
915
881
  @typing.overload
916
- 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]]]:
882
+ 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]]]:
917
883
  """
918
- Specifies environment variables to be set prior to the execution of a step.
884
+ Specifies the resources needed when executing this step.
885
+
886
+ Use `@resources` to specify the resource requirements
887
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
888
+
889
+ You can choose the compute layer on the command line by executing e.g.
890
+ ```
891
+ python myflow.py run --with batch
892
+ ```
893
+ or
894
+ ```
895
+ python myflow.py run --with kubernetes
896
+ ```
897
+ which executes the flow on the desired system using the
898
+ requirements specified in `@resources`.
919
899
 
920
900
  Parameters
921
901
  ----------
922
- vars : Dict[str, str], default {}
923
- Dictionary of environment variables to set.
902
+ cpu : int, default 1
903
+ Number of CPUs required for this step.
904
+ gpu : int, default 0
905
+ Number of GPUs required for this step.
906
+ disk : int, optional, default None
907
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
908
+ memory : int, default 4096
909
+ Memory size (in MB) required for this step.
910
+ shared_memory : int, optional, default None
911
+ The value for the size (in MiB) of the /dev/shm volume for this step.
912
+ This parameter maps to the `--shm-size` option in Docker.
924
913
  """
925
914
  ...
926
915
 
927
916
  @typing.overload
928
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
917
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
929
918
  ...
930
919
 
931
920
  @typing.overload
932
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
921
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
933
922
  ...
934
923
 
935
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
924
+ 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):
936
925
  """
937
- Specifies environment variables to be set prior to the execution of a step.
926
+ Specifies the resources needed when executing this step.
927
+
928
+ Use `@resources` to specify the resource requirements
929
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
930
+
931
+ You can choose the compute layer on the command line by executing e.g.
932
+ ```
933
+ python myflow.py run --with batch
934
+ ```
935
+ or
936
+ ```
937
+ python myflow.py run --with kubernetes
938
+ ```
939
+ which executes the flow on the desired system using the
940
+ requirements specified in `@resources`.
938
941
 
939
942
  Parameters
940
943
  ----------
941
- vars : Dict[str, str], default {}
942
- Dictionary of environment variables to set.
944
+ cpu : int, default 1
945
+ Number of CPUs required for this step.
946
+ gpu : int, default 0
947
+ Number of GPUs required for this step.
948
+ disk : int, optional, default None
949
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
950
+ memory : int, default 4096
951
+ Memory size (in MB) required for this step.
952
+ shared_memory : int, optional, default None
953
+ The value for the size (in MiB) of the /dev/shm volume for this step.
954
+ This parameter maps to the `--shm-size` option in Docker.
943
955
  """
944
956
  ...
945
957
 
946
958
  @typing.overload
947
- 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]]]:
959
+ 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]]]:
948
960
  """
949
- Specifies that the step will success under all circumstances.
961
+ Specifies the PyPI packages for the step.
950
962
 
951
- The decorator will create an optional artifact, specified by `var`, which
952
- contains the exception raised. You can use it to detect the presence
953
- of errors, indicating that all happy-path artifacts produced by the step
954
- are missing.
963
+ Information in this decorator will augment any
964
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
965
+ you can use `@pypi_base` to set packages required by all
966
+ steps and use `@pypi` to specify step-specific overrides.
955
967
 
956
968
  Parameters
957
969
  ----------
958
- var : str, optional, default None
959
- Name of the artifact in which to store the caught exception.
960
- If not specified, the exception is not stored.
961
- print_exception : bool, default True
962
- Determines whether or not the exception is printed to
963
- stdout when caught.
970
+ packages : Dict[str, str], default: {}
971
+ Packages to use for this step. The key is the name of the package
972
+ and the value is the version to use.
973
+ python : str, optional, default: None
974
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
975
+ that the version used will correspond to the version of the Python interpreter used to start the run.
964
976
  """
965
977
  ...
966
978
 
967
979
  @typing.overload
968
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
980
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
969
981
  ...
970
982
 
971
983
  @typing.overload
972
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
984
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
973
985
  ...
974
986
 
975
- 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):
987
+ 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):
976
988
  """
977
- Specifies that the step will success under all circumstances.
989
+ Specifies the PyPI packages for the step.
978
990
 
979
- The decorator will create an optional artifact, specified by `var`, which
980
- contains the exception raised. You can use it to detect the presence
981
- of errors, indicating that all happy-path artifacts produced by the step
982
- are missing.
991
+ Information in this decorator will augment any
992
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
993
+ you can use `@pypi_base` to set packages required by all
994
+ steps and use `@pypi` to specify step-specific overrides.
983
995
 
984
996
  Parameters
985
997
  ----------
986
- var : str, optional, default None
987
- Name of the artifact in which to store the caught exception.
988
- If not specified, the exception is not stored.
989
- print_exception : bool, default True
990
- Determines whether or not the exception is printed to
991
- stdout when caught.
998
+ packages : Dict[str, str], default: {}
999
+ Packages to use for this step. The key is the name of the package
1000
+ and the value is the version to use.
1001
+ python : str, optional, default: None
1002
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1003
+ that the version used will correspond to the version of the Python interpreter used to start the run.
992
1004
  """
993
1005
  ...
994
1006
 
@@ -1052,51 +1064,66 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
1052
1064
  ...
1053
1065
 
1054
1066
  @typing.overload
1055
- 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]]]:
1067
+ 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]]]:
1056
1068
  """
1057
- Specifies the PyPI packages for the step.
1058
-
1059
- Information in this decorator will augment any
1060
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1061
- you can use `@pypi_base` to set packages required by all
1062
- steps and use `@pypi` to specify step-specific overrides.
1069
+ Specifies environment variables to be set prior to the execution of a step.
1063
1070
 
1064
1071
  Parameters
1065
1072
  ----------
1066
- packages : Dict[str, str], default: {}
1067
- Packages to use for this step. The key is the name of the package
1068
- and the value is the version to use.
1069
- python : str, optional, default: None
1070
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1071
- that the version used will correspond to the version of the Python interpreter used to start the run.
1073
+ vars : Dict[str, str], default {}
1074
+ Dictionary of environment variables to set.
1072
1075
  """
1073
1076
  ...
1074
1077
 
1075
1078
  @typing.overload
1076
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1079
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1077
1080
  ...
1078
1081
 
1079
1082
  @typing.overload
1080
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1083
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1081
1084
  ...
1082
1085
 
1083
- 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):
1086
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1084
1087
  """
1085
- Specifies the PyPI packages for the step.
1088
+ Specifies environment variables to be set prior to the execution of a step.
1086
1089
 
1087
- Information in this decorator will augment any
1088
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1089
- you can use `@pypi_base` to set packages required by all
1090
- steps and use `@pypi` to specify step-specific overrides.
1090
+ Parameters
1091
+ ----------
1092
+ vars : Dict[str, str], default {}
1093
+ Dictionary of environment variables to set.
1094
+ """
1095
+ ...
1096
+
1097
+ @typing.overload
1098
+ 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]]]:
1099
+ """
1100
+ Specifies secrets to be retrieved and injected as environment variables prior to
1101
+ the execution of a step.
1091
1102
 
1092
1103
  Parameters
1093
1104
  ----------
1094
- packages : Dict[str, str], default: {}
1095
- Packages to use for this step. The key is the name of the package
1096
- and the value is the version to use.
1097
- python : str, optional, default: None
1098
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1099
- that the version used will correspond to the version of the Python interpreter used to start the run.
1105
+ sources : List[Union[str, Dict[str, Any]]], default: []
1106
+ List of secret specs, defining how the secrets are to be retrieved
1107
+ """
1108
+ ...
1109
+
1110
+ @typing.overload
1111
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1112
+ ...
1113
+
1114
+ @typing.overload
1115
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1116
+ ...
1117
+
1118
+ 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]]] = []):
1119
+ """
1120
+ Specifies secrets to be retrieved and injected as environment variables prior to
1121
+ the execution of a step.
1122
+
1123
+ Parameters
1124
+ ----------
1125
+ sources : List[Union[str, Dict[str, Any]]], default: []
1126
+ List of secret specs, defining how the secrets are to be retrieved
1100
1127
  """
1101
1128
  ...
1102
1129
 
@@ -1158,86 +1185,59 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1158
1185
  ...
1159
1186
 
1160
1187
  @typing.overload
1161
- 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]]]:
1188
+ 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]]]:
1162
1189
  """
1163
- Creates a human-readable report, a Metaflow Card, after this step completes.
1190
+ Specifies a timeout for your step.
1164
1191
 
1165
- Note that you may add multiple `@card` decorators in a step with different parameters.
1192
+ This decorator is useful if this step may hang indefinitely.
1166
1193
 
1167
- Parameters
1168
- ----------
1169
- type : str, default 'default'
1170
- Card type.
1171
- id : str, optional, default None
1172
- If multiple cards are present, use this id to identify this card.
1173
- options : Dict[str, Any], default {}
1174
- Options passed to the card. The contents depend on the card type.
1175
- timeout : int, default 45
1176
- Interrupt reporting if it takes more than this many seconds.
1194
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1195
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1196
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1177
1197
 
1198
+ Note that all the values specified in parameters are added together so if you specify
1199
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1178
1200
 
1201
+ Parameters
1202
+ ----------
1203
+ seconds : int, default 0
1204
+ Number of seconds to wait prior to timing out.
1205
+ minutes : int, default 0
1206
+ Number of minutes to wait prior to timing out.
1207
+ hours : int, default 0
1208
+ Number of hours to wait prior to timing out.
1179
1209
  """
1180
1210
  ...
1181
1211
 
1182
1212
  @typing.overload
1183
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1213
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1184
1214
  ...
1185
1215
 
1186
1216
  @typing.overload
1187
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1217
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1188
1218
  ...
1189
1219
 
1190
- 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):
1220
+ 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):
1191
1221
  """
1192
- Creates a human-readable report, a Metaflow Card, after this step completes.
1193
-
1194
- Note that you may add multiple `@card` decorators in a step with different parameters.
1195
-
1196
- Parameters
1197
- ----------
1198
- type : str, default 'default'
1199
- Card type.
1200
- id : str, optional, default None
1201
- If multiple cards are present, use this id to identify this card.
1202
- options : Dict[str, Any], default {}
1203
- Options passed to the card. The contents depend on the card type.
1204
- timeout : int, default 45
1205
- Interrupt reporting if it takes more than this many seconds.
1222
+ Specifies a timeout for your step.
1206
1223
 
1224
+ This decorator is useful if this step may hang indefinitely.
1207
1225
 
1208
- """
1209
- ...
1210
-
1211
- @typing.overload
1212
- 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]]]:
1213
- """
1214
- Specifies secrets to be retrieved and injected as environment variables prior to
1215
- the execution of a step.
1226
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1227
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1228
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1216
1229
 
1217
- Parameters
1218
- ----------
1219
- sources : List[Union[str, Dict[str, Any]]], default: []
1220
- List of secret specs, defining how the secrets are to be retrieved
1221
- """
1222
- ...
1223
-
1224
- @typing.overload
1225
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1226
- ...
1227
-
1228
- @typing.overload
1229
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1230
- ...
1231
-
1232
- 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]]] = []):
1233
- """
1234
- Specifies secrets to be retrieved and injected as environment variables prior to
1235
- the execution of a step.
1230
+ Note that all the values specified in parameters are added together so if you specify
1231
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1236
1232
 
1237
1233
  Parameters
1238
1234
  ----------
1239
- sources : List[Union[str, Dict[str, Any]]], default: []
1240
- List of secret specs, defining how the secrets are to be retrieved
1235
+ seconds : int, default 0
1236
+ Number of seconds to wait prior to timing out.
1237
+ minutes : int, default 0
1238
+ Number of minutes to wait prior to timing out.
1239
+ hours : int, default 0
1240
+ Number of hours to wait prior to timing out.
1241
1241
  """
1242
1242
  ...
1243
1243
 
@@ -1388,6 +1388,55 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1388
1388
  """
1389
1389
  ...
1390
1390
 
1391
+ @typing.overload
1392
+ 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]]:
1393
+ """
1394
+ Specifies the Conda environment for all steps of the flow.
1395
+
1396
+ Use `@conda_base` to set common libraries required by all
1397
+ steps and use `@conda` to specify step-specific additions.
1398
+
1399
+ Parameters
1400
+ ----------
1401
+ packages : Dict[str, str], default {}
1402
+ Packages to use for this flow. The key is the name of the package
1403
+ and the value is the version to use.
1404
+ libraries : Dict[str, str], default {}
1405
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1406
+ python : str, optional, default None
1407
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1408
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1409
+ disabled : bool, default False
1410
+ If set to True, disables Conda.
1411
+ """
1412
+ ...
1413
+
1414
+ @typing.overload
1415
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1416
+ ...
1417
+
1418
+ 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):
1419
+ """
1420
+ Specifies the Conda environment for all steps of the flow.
1421
+
1422
+ Use `@conda_base` to set common libraries required by all
1423
+ steps and use `@conda` to specify step-specific additions.
1424
+
1425
+ Parameters
1426
+ ----------
1427
+ packages : Dict[str, str], default {}
1428
+ Packages to use for this flow. The key is the name of the package
1429
+ and the value is the version to use.
1430
+ libraries : Dict[str, str], default {}
1431
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1432
+ python : str, optional, default None
1433
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1434
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1435
+ disabled : bool, default False
1436
+ If set to True, disables Conda.
1437
+ """
1438
+ ...
1439
+
1391
1440
  @typing.overload
1392
1441
  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]]:
1393
1442
  """
@@ -1491,6 +1540,24 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1491
1540
  """
1492
1541
  ...
1493
1542
 
1543
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1544
+ """
1545
+ Specifies what flows belong to the same project.
1546
+
1547
+ A project-specific namespace is created for all flows that
1548
+ use the same `@project(name)`.
1549
+
1550
+ Parameters
1551
+ ----------
1552
+ name : str
1553
+ Project name. Make sure that the name is unique amongst all
1554
+ projects that use the same production scheduler. The name may
1555
+ contain only lowercase alphanumeric characters and underscores.
1556
+
1557
+
1558
+ """
1559
+ ...
1560
+
1494
1561
  @typing.overload
1495
1562
  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]]:
1496
1563
  """
@@ -1540,6 +1607,90 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1540
1607
  """
1541
1608
  ...
1542
1609
 
1610
+ 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]]:
1611
+ """
1612
+ 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)
1613
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1614
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1615
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1616
+ starts only after all sensors finish.
1617
+
1618
+ Parameters
1619
+ ----------
1620
+ timeout : int
1621
+ Time, in seconds before the task times out and fails. (Default: 3600)
1622
+ poke_interval : int
1623
+ Time in seconds that the job should wait in between each try. (Default: 60)
1624
+ mode : str
1625
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1626
+ exponential_backoff : bool
1627
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1628
+ pool : str
1629
+ the slot pool this task should run in,
1630
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1631
+ soft_fail : bool
1632
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1633
+ name : str
1634
+ Name of the sensor on Airflow
1635
+ description : str
1636
+ Description of sensor in the Airflow UI
1637
+ bucket_key : Union[str, List[str]]
1638
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1639
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1640
+ bucket_name : str
1641
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1642
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1643
+ wildcard_match : bool
1644
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1645
+ aws_conn_id : str
1646
+ a reference to the s3 connection on Airflow. (Default: None)
1647
+ verify : bool
1648
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1649
+ """
1650
+ ...
1651
+
1652
+ 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]]:
1653
+ """
1654
+ 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.
1655
+ 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.
1656
+
1657
+ Parameters
1658
+ ----------
1659
+ timeout : int
1660
+ Time, in seconds before the task times out and fails. (Default: 3600)
1661
+ poke_interval : int
1662
+ Time in seconds that the job should wait in between each try. (Default: 60)
1663
+ mode : str
1664
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1665
+ exponential_backoff : bool
1666
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1667
+ pool : str
1668
+ the slot pool this task should run in,
1669
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1670
+ soft_fail : bool
1671
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1672
+ name : str
1673
+ Name of the sensor on Airflow
1674
+ description : str
1675
+ Description of sensor in the Airflow UI
1676
+ external_dag_id : str
1677
+ The dag_id that contains the task you want to wait for.
1678
+ external_task_ids : List[str]
1679
+ The list of task_ids that you want to wait for.
1680
+ If None (default value) the sensor waits for the DAG. (Default: None)
1681
+ allowed_states : List[str]
1682
+ Iterable of allowed states, (Default: ['success'])
1683
+ failed_states : List[str]
1684
+ Iterable of failed or dis-allowed states. (Default: None)
1685
+ execution_delta : datetime.timedelta
1686
+ time difference with the previous execution to look at,
1687
+ the default is the same logical date as the current task or DAG. (Default: None)
1688
+ check_existence: bool
1689
+ Set to True to check if the external task exists or check if
1690
+ the DAG to wait for exists. (Default: True)
1691
+ """
1692
+ ...
1693
+
1543
1694
  @typing.overload
1544
1695
  def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1545
1696
  """
@@ -1674,157 +1825,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1674
1825
  """
1675
1826
  ...
1676
1827
 
1677
- 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]]:
1678
- """
1679
- 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.
1680
- 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.
1681
-
1682
- Parameters
1683
- ----------
1684
- timeout : int
1685
- Time, in seconds before the task times out and fails. (Default: 3600)
1686
- poke_interval : int
1687
- Time in seconds that the job should wait in between each try. (Default: 60)
1688
- mode : str
1689
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1690
- exponential_backoff : bool
1691
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1692
- pool : str
1693
- the slot pool this task should run in,
1694
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1695
- soft_fail : bool
1696
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1697
- name : str
1698
- Name of the sensor on Airflow
1699
- description : str
1700
- Description of sensor in the Airflow UI
1701
- external_dag_id : str
1702
- The dag_id that contains the task you want to wait for.
1703
- external_task_ids : List[str]
1704
- The list of task_ids that you want to wait for.
1705
- If None (default value) the sensor waits for the DAG. (Default: None)
1706
- allowed_states : List[str]
1707
- Iterable of allowed states, (Default: ['success'])
1708
- failed_states : List[str]
1709
- Iterable of failed or dis-allowed states. (Default: None)
1710
- execution_delta : datetime.timedelta
1711
- time difference with the previous execution to look at,
1712
- the default is the same logical date as the current task or DAG. (Default: None)
1713
- check_existence: bool
1714
- Set to True to check if the external task exists or check if
1715
- the DAG to wait for exists. (Default: True)
1716
- """
1717
- ...
1718
-
1719
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1720
- """
1721
- Specifies what flows belong to the same project.
1722
-
1723
- A project-specific namespace is created for all flows that
1724
- use the same `@project(name)`.
1725
-
1726
- Parameters
1727
- ----------
1728
- name : str
1729
- Project name. Make sure that the name is unique amongst all
1730
- projects that use the same production scheduler. The name may
1731
- contain only lowercase alphanumeric characters and underscores.
1732
-
1733
-
1734
- """
1735
- ...
1736
-
1737
- 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]]:
1738
- """
1739
- 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)
1740
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1741
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1742
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1743
- starts only after all sensors finish.
1744
-
1745
- Parameters
1746
- ----------
1747
- timeout : int
1748
- Time, in seconds before the task times out and fails. (Default: 3600)
1749
- poke_interval : int
1750
- Time in seconds that the job should wait in between each try. (Default: 60)
1751
- mode : str
1752
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1753
- exponential_backoff : bool
1754
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1755
- pool : str
1756
- the slot pool this task should run in,
1757
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1758
- soft_fail : bool
1759
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1760
- name : str
1761
- Name of the sensor on Airflow
1762
- description : str
1763
- Description of sensor in the Airflow UI
1764
- bucket_key : Union[str, List[str]]
1765
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1766
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1767
- bucket_name : str
1768
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1769
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1770
- wildcard_match : bool
1771
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1772
- aws_conn_id : str
1773
- a reference to the s3 connection on Airflow. (Default: None)
1774
- verify : bool
1775
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1776
- """
1777
- ...
1778
-
1779
- @typing.overload
1780
- 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]]:
1781
- """
1782
- Specifies the Conda environment for all steps of the flow.
1783
-
1784
- Use `@conda_base` to set common libraries required by all
1785
- steps and use `@conda` to specify step-specific additions.
1786
-
1787
- Parameters
1788
- ----------
1789
- packages : Dict[str, str], default {}
1790
- Packages to use for this flow. The key is the name of the package
1791
- and the value is the version to use.
1792
- libraries : Dict[str, str], default {}
1793
- Supported for backward compatibility. When used with packages, packages will take precedence.
1794
- python : str, optional, default None
1795
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1796
- that the version used will correspond to the version of the Python interpreter used to start the run.
1797
- disabled : bool, default False
1798
- If set to True, disables Conda.
1799
- """
1800
- ...
1801
-
1802
- @typing.overload
1803
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1804
- ...
1805
-
1806
- 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):
1807
- """
1808
- Specifies the Conda environment for all steps of the flow.
1809
-
1810
- Use `@conda_base` to set common libraries required by all
1811
- steps and use `@conda` to specify step-specific additions.
1812
-
1813
- Parameters
1814
- ----------
1815
- packages : Dict[str, str], default {}
1816
- Packages to use for this flow. The key is the name of the package
1817
- and the value is the version to use.
1818
- libraries : Dict[str, str], default {}
1819
- Supported for backward compatibility. When used with packages, packages will take precedence.
1820
- python : str, optional, default None
1821
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1822
- that the version used will correspond to the version of the Python interpreter used to start the run.
1823
- disabled : bool, default False
1824
- If set to True, disables Conda.
1825
- """
1826
- ...
1827
-
1828
1828
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1829
1829
  """
1830
1830
  Switch namespace to the one provided.