ob-metaflow-stubs 4.1__py2.py3-none-any.whl → 4.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 (145) hide show
  1. metaflow-stubs/__init__.pyi +423 -423
  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 +7 -7
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +3 -3
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +5 -5
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +5 -5
  13. metaflow-stubs/metadata/metadata.pyi +3 -3
  14. metaflow-stubs/metadata/util.pyi +2 -2
  15. metaflow-stubs/metaflow_config.pyi +2 -2
  16. metaflow-stubs/metaflow_current.pyi +3 -3
  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 +3 -3
  21. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/airflow.pyi +3 -3
  23. metaflow-stubs/plugins/airflow/airflow_cli.pyi +3 -3
  24. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  28. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  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 +2 -2
  32. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  34. metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
  35. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +3 -3
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +3 -3
  37. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  38. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  39. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  45. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  46. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  47. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +3 -3
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  56. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  58. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  59. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  60. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  61. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  62. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  63. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  64. metaflow-stubs/plugins/cards/card_cli.pyi +5 -5
  65. metaflow-stubs/plugins/cards/card_client.pyi +4 -4
  66. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  69. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  71. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
  73. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
  74. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
  75. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
  76. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
  77. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  78. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  79. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  80. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  81. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  82. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  83. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  84. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  85. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  86. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  87. metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
  88. metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -6
  89. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  90. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  91. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  92. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  93. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  94. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  95. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  96. metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
  97. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  98. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  99. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  100. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  101. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  102. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  103. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  104. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
  105. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +3 -3
  106. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  107. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  108. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +3 -3
  109. metaflow-stubs/plugins/logs_cli.pyi +3 -3
  110. metaflow-stubs/plugins/package_cli.pyi +2 -2
  111. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  112. metaflow-stubs/plugins/perimeters.pyi +2 -2
  113. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  114. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  115. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  116. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  117. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  118. metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
  119. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  120. metaflow-stubs/plugins/resources_decorator.pyi +2 -2
  121. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  122. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  123. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  124. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  125. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  126. metaflow-stubs/plugins/tag_cli.pyi +5 -5
  127. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  128. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  129. metaflow-stubs/procpoll.pyi +2 -2
  130. metaflow-stubs/profilers/__init__.pyi +2 -2
  131. metaflow-stubs/pylint_wrapper.pyi +2 -2
  132. metaflow-stubs/runner/__init__.pyi +2 -2
  133. metaflow-stubs/runner/metaflow_runner.pyi +5 -5
  134. metaflow-stubs/runner/nbrun.pyi +2 -2
  135. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  136. metaflow-stubs/system/__init__.pyi +112 -0
  137. metaflow-stubs/system/system_logger.pyi +51 -0
  138. metaflow-stubs/system/system_monitor.pyi +73 -0
  139. metaflow-stubs/tagging_util.pyi +2 -2
  140. metaflow-stubs/tuple_util.pyi +2 -2
  141. {ob_metaflow_stubs-4.1.dist-info → ob_metaflow_stubs-4.3.dist-info}/METADATA +1 -1
  142. ob_metaflow_stubs-4.3.dist-info/RECORD +145 -0
  143. ob_metaflow_stubs-4.1.dist-info/RECORD +0 -142
  144. {ob_metaflow_stubs-4.1.dist-info → ob_metaflow_stubs-4.3.dist-info}/WHEEL +0 -0
  145. {ob_metaflow_stubs-4.1.dist-info → ob_metaflow_stubs-4.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.6.1+ob(v1) #
4
- # Generated on 2024-07-03T18:20:45.077392 #
3
+ # MF version: 2.12.7.1+ob(v1) #
4
+ # Generated on 2024-07-09T16:19:31.537205 #
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.flowspec
12
- import metaflow.datastore.inputs
13
- import metaflow.events
14
- import metaflow._vendor.click.types
11
+ import metaflow.client.core
15
12
  import metaflow.metaflow_current
16
- import metaflow.parameters
17
- import typing
18
- import metaflow.runner.metaflow_runner
19
13
  import io
20
- import metaflow.client.core
21
14
  import metaflow.plugins.datatools.s3.s3
22
15
  import datetime
16
+ import metaflow.datastore.inputs
17
+ import metaflow.flowspec
18
+ import metaflow.parameters
19
+ import metaflow._vendor.click.types
20
+ import metaflow.events
21
+ import typing
22
+ import metaflow.runner.metaflow_runner
23
23
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
24
24
  StepFlag = typing.NewType("StepFlag", bool)
25
25
 
@@ -728,218 +728,59 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
728
728
  ...
729
729
 
730
730
  @typing.overload
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
- """
733
- Specifies that the step will success under all circumstances.
734
-
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
-
740
- Parameters
741
- ----------
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.
748
- """
749
- ...
750
-
751
- @typing.overload
752
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
753
- ...
754
-
755
- @typing.overload
756
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
757
- ...
758
-
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):
760
- """
761
- Specifies that the step will success under all circumstances.
762
-
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.
767
-
768
- Parameters
769
- ----------
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.
776
- """
777
- ...
778
-
779
- 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]]]:
780
- """
781
- Specifies that this step should execute on Kubernetes.
782
-
783
- Parameters
784
- ----------
785
- cpu : int, default 1
786
- Number of CPUs required for this step. If `@resources` is
787
- also present, the maximum value from all decorators is used.
788
- memory : int, default 4096
789
- Memory size (in MB) required for this step. If
790
- `@resources` is also present, the maximum value from all decorators is
791
- used.
792
- disk : int, default 10240
793
- Disk size (in MB) required for this step. If
794
- `@resources` is also present, the maximum value from all decorators is
795
- used.
796
- image : str, optional, default None
797
- Docker image to use when launching on Kubernetes. If not specified, and
798
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
799
- not, a default Docker image mapping to the current version of Python is used.
800
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
801
- If given, the imagePullPolicy to be applied to the Docker image of the step.
802
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
803
- Kubernetes service account to use when launching pod in Kubernetes.
804
- secrets : List[str], optional, default None
805
- Kubernetes secrets to use when launching pod in Kubernetes. These
806
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
807
- in Metaflow configuration.
808
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
809
- Kubernetes namespace to use when launching pod in Kubernetes.
810
- gpu : int, optional, default None
811
- Number of GPUs required for this step. A value of zero implies that
812
- the scheduled node should not have GPUs.
813
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
814
- The vendor of the GPUs to be used for this step.
815
- tolerations : List[str], default []
816
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
817
- Kubernetes tolerations to use when launching pod in Kubernetes.
818
- use_tmpfs : bool, default False
819
- This enables an explicit tmpfs mount for this step.
820
- tmpfs_tempdir : bool, default True
821
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
822
- tmpfs_size : int, optional, default: None
823
- The value for the size (in MiB) of the tmpfs mount for this step.
824
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
825
- memory allocated for this step.
826
- tmpfs_path : str, optional, default /metaflow_temp
827
- Path to tmpfs mount for this step.
828
- persistent_volume_claims : Dict[str, str], optional, default None
829
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
830
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
831
- shared_memory: int, optional
832
- Shared memory size (in MiB) required for this step
833
- port: int, optional
834
- Port number to specify in the Kubernetes job object
835
- """
836
- ...
837
-
838
- @typing.overload
839
- 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]]]:
840
- """
841
- Creates a human-readable report, a Metaflow Card, after this step completes.
842
-
843
- Note that you may add multiple `@card` decorators in a step with different parameters.
844
-
845
- Parameters
846
- ----------
847
- type : str, default 'default'
848
- Card type.
849
- id : str, optional, default None
850
- If multiple cards are present, use this id to identify this card.
851
- options : Dict[str, Any], default {}
852
- Options passed to the card. The contents depend on the card type.
853
- timeout : int, default 45
854
- Interrupt reporting if it takes more than this many seconds.
855
-
856
-
857
- """
858
- ...
859
-
860
- @typing.overload
861
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
862
- ...
863
-
864
- @typing.overload
865
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
866
- ...
867
-
868
- 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):
869
- """
870
- Creates a human-readable report, a Metaflow Card, after this step completes.
871
-
872
- Note that you may add multiple `@card` decorators in a step with different parameters.
873
-
874
- Parameters
875
- ----------
876
- type : str, default 'default'
877
- Card type.
878
- id : str, optional, default None
879
- If multiple cards are present, use this id to identify this card.
880
- options : Dict[str, Any], default {}
881
- Options passed to the card. The contents depend on the card type.
882
- timeout : int, default 45
883
- Interrupt reporting if it takes more than this many seconds.
884
-
885
-
886
- """
887
- ...
888
-
889
- @typing.overload
890
- 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]]]:
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]]]:
891
732
  """
892
- Specifies a timeout for your step.
893
-
894
- This decorator is useful if this step may hang indefinitely.
895
-
896
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
897
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
898
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
733
+ Specifies the Conda environment for the step.
899
734
 
900
- Note that all the values specified in parameters are added together so if you specify
901
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
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.
902
739
 
903
740
  Parameters
904
741
  ----------
905
- seconds : int, default 0
906
- Number of seconds to wait prior to timing out.
907
- minutes : int, default 0
908
- Number of minutes to wait prior to timing out.
909
- hours : int, default 0
910
- Number of hours to wait prior to timing out.
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.
911
752
  """
912
753
  ...
913
754
 
914
755
  @typing.overload
915
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
756
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
916
757
  ...
917
758
 
918
759
  @typing.overload
919
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
760
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
920
761
  ...
921
762
 
922
- 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):
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):
923
764
  """
924
- Specifies a timeout for your step.
925
-
926
- This decorator is useful if this step may hang indefinitely.
927
-
928
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
929
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
930
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
765
+ Specifies the Conda environment for the step.
931
766
 
932
- Note that all the values specified in parameters are added together so if you specify
933
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
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.
934
771
 
935
772
  Parameters
936
773
  ----------
937
- seconds : int, default 0
938
- Number of seconds to wait prior to timing out.
939
- minutes : int, default 0
940
- Number of minutes to wait prior to timing out.
941
- hours : int, default 0
942
- Number of hours to wait prior to timing out.
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.
943
784
  """
944
785
  ...
945
786
 
@@ -1144,35 +985,51 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1144
985
  ...
1145
986
 
1146
987
  @typing.overload
1147
- 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]]]:
988
+ 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]]]:
1148
989
  """
1149
- Specifies secrets to be retrieved and injected as environment variables prior to
1150
- the execution of a step.
990
+ Specifies the PyPI packages for the step.
991
+
992
+ Information in this decorator will augment any
993
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
994
+ you can use `@pypi_base` to set packages required by all
995
+ steps and use `@pypi` to specify step-specific overrides.
1151
996
 
1152
997
  Parameters
1153
998
  ----------
1154
- sources : List[Union[str, Dict[str, Any]]], default: []
1155
- List of secret specs, defining how the secrets are to be retrieved
1156
- """
999
+ packages : Dict[str, str], default: {}
1000
+ Packages to use for this step. The key is the name of the package
1001
+ and the value is the version to use.
1002
+ python : str, optional, default: None
1003
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1004
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1005
+ """
1157
1006
  ...
1158
1007
 
1159
1008
  @typing.overload
1160
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1009
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1161
1010
  ...
1162
1011
 
1163
1012
  @typing.overload
1164
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1013
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1165
1014
  ...
1166
1015
 
1167
- 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]]] = []):
1016
+ 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):
1168
1017
  """
1169
- Specifies secrets to be retrieved and injected as environment variables prior to
1170
- the execution of a step.
1018
+ Specifies the PyPI packages for the step.
1019
+
1020
+ Information in this decorator will augment any
1021
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1022
+ you can use `@pypi_base` to set packages required by all
1023
+ steps and use `@pypi` to specify step-specific overrides.
1171
1024
 
1172
1025
  Parameters
1173
1026
  ----------
1174
- sources : List[Union[str, Dict[str, Any]]], default: []
1175
- List of secret specs, defining how the secrets are to be retrieved
1027
+ packages : Dict[str, str], default: {}
1028
+ Packages to use for this step. The key is the name of the package
1029
+ and the value is the version to use.
1030
+ python : str, optional, default: None
1031
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1032
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1176
1033
  """
1177
1034
  ...
1178
1035
 
@@ -1254,220 +1111,282 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
1254
1111
  ...
1255
1112
 
1256
1113
  @typing.overload
1257
- 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]]]:
1114
+ 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]]]:
1258
1115
  """
1259
- Specifies the Conda environment for the step.
1260
-
1261
- Information in this decorator will augment any
1262
- attributes set in the `@conda_base` flow-level decorator. Hence,
1263
- you can use `@conda_base` to set packages required by all
1264
- steps and use `@conda` to specify step-specific overrides.
1116
+ Specifies environment variables to be set prior to the execution of a step.
1265
1117
 
1266
1118
  Parameters
1267
1119
  ----------
1268
- packages : Dict[str, str], default {}
1269
- Packages to use for this step. The key is the name of the package
1270
- and the value is the version to use.
1271
- libraries : Dict[str, str], default {}
1272
- Supported for backward compatibility. When used with packages, packages will take precedence.
1273
- python : str, optional, default None
1274
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1275
- that the version used will correspond to the version of the Python interpreter used to start the run.
1276
- disabled : bool, default False
1277
- If set to True, disables @conda.
1120
+ vars : Dict[str, str], default {}
1121
+ Dictionary of environment variables to set.
1278
1122
  """
1279
1123
  ...
1280
1124
 
1281
1125
  @typing.overload
1282
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1126
+ def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1283
1127
  ...
1284
1128
 
1285
1129
  @typing.overload
1286
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1130
+ def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1287
1131
  ...
1288
1132
 
1289
- 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):
1133
+ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1290
1134
  """
1291
- Specifies the Conda environment for the step.
1292
-
1293
- Information in this decorator will augment any
1294
- attributes set in the `@conda_base` flow-level decorator. Hence,
1295
- you can use `@conda_base` to set packages required by all
1296
- steps and use `@conda` to specify step-specific overrides.
1135
+ Specifies environment variables to be set prior to the execution of a step.
1297
1136
 
1298
1137
  Parameters
1299
1138
  ----------
1300
- packages : Dict[str, str], default {}
1301
- Packages to use for this step. The key is the name of the package
1302
- and the value is the version to use.
1303
- libraries : Dict[str, str], default {}
1304
- Supported for backward compatibility. When used with packages, packages will take precedence.
1305
- python : str, optional, default None
1306
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1307
- that the version used will correspond to the version of the Python interpreter used to start the run.
1308
- disabled : bool, default False
1309
- If set to True, disables @conda.
1139
+ vars : Dict[str, str], default {}
1140
+ Dictionary of environment variables to set.
1310
1141
  """
1311
1142
  ...
1312
1143
 
1313
1144
  @typing.overload
1314
- 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]]]:
1145
+ 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]]]:
1315
1146
  """
1316
- Specifies environment variables to be set prior to the execution of a step.
1147
+ Specifies a timeout for your step.
1148
+
1149
+ This decorator is useful if this step may hang indefinitely.
1150
+
1151
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1152
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1153
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1154
+
1155
+ Note that all the values specified in parameters are added together so if you specify
1156
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1317
1157
 
1318
1158
  Parameters
1319
1159
  ----------
1320
- vars : Dict[str, str], default {}
1321
- Dictionary of environment variables to set.
1160
+ seconds : int, default 0
1161
+ Number of seconds to wait prior to timing out.
1162
+ minutes : int, default 0
1163
+ Number of minutes to wait prior to timing out.
1164
+ hours : int, default 0
1165
+ Number of hours to wait prior to timing out.
1322
1166
  """
1323
1167
  ...
1324
1168
 
1325
1169
  @typing.overload
1326
- def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1170
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1327
1171
  ...
1328
1172
 
1329
1173
  @typing.overload
1330
- def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1174
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1331
1175
  ...
1332
1176
 
1333
- def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
1177
+ 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):
1334
1178
  """
1335
- Specifies environment variables to be set prior to the execution of a step.
1179
+ Specifies a timeout for your step.
1180
+
1181
+ This decorator is useful if this step may hang indefinitely.
1182
+
1183
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1184
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1185
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1186
+
1187
+ Note that all the values specified in parameters are added together so if you specify
1188
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1336
1189
 
1337
1190
  Parameters
1338
1191
  ----------
1339
- vars : Dict[str, str], default {}
1340
- Dictionary of environment variables to set.
1192
+ seconds : int, default 0
1193
+ Number of seconds to wait prior to timing out.
1194
+ minutes : int, default 0
1195
+ Number of minutes to wait prior to timing out.
1196
+ hours : int, default 0
1197
+ Number of hours to wait prior to timing out.
1341
1198
  """
1342
1199
  ...
1343
1200
 
1344
1201
  @typing.overload
1345
- 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]]]:
1202
+ 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]]]:
1346
1203
  """
1347
- Specifies the PyPI packages for the step.
1204
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1348
1205
 
1349
- Information in this decorator will augment any
1350
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1351
- you can use `@pypi_base` to set packages required by all
1352
- steps and use `@pypi` to specify step-specific overrides.
1206
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1353
1207
 
1354
1208
  Parameters
1355
1209
  ----------
1356
- packages : Dict[str, str], default: {}
1357
- Packages to use for this step. The key is the name of the package
1358
- and the value is the version to use.
1359
- python : str, optional, default: None
1360
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1361
- that the version used will correspond to the version of the Python interpreter used to start the run.
1210
+ type : str, default 'default'
1211
+ Card type.
1212
+ id : str, optional, default None
1213
+ If multiple cards are present, use this id to identify this card.
1214
+ options : Dict[str, Any], default {}
1215
+ Options passed to the card. The contents depend on the card type.
1216
+ timeout : int, default 45
1217
+ Interrupt reporting if it takes more than this many seconds.
1218
+
1219
+
1362
1220
  """
1363
1221
  ...
1364
1222
 
1365
1223
  @typing.overload
1366
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1224
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1367
1225
  ...
1368
1226
 
1369
1227
  @typing.overload
1370
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1228
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1371
1229
  ...
1372
1230
 
1373
- 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):
1231
+ 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):
1374
1232
  """
1375
- Specifies the PyPI packages for the step.
1233
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1376
1234
 
1377
- Information in this decorator will augment any
1378
- attributes set in the `@pyi_base` flow-level decorator. Hence,
1379
- you can use `@pypi_base` to set packages required by all
1380
- steps and use `@pypi` to specify step-specific overrides.
1235
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1381
1236
 
1382
1237
  Parameters
1383
1238
  ----------
1384
- packages : Dict[str, str], default: {}
1385
- Packages to use for this step. The key is the name of the package
1386
- and the value is the version to use.
1387
- python : str, optional, default: None
1388
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1389
- that the version used will correspond to the version of the Python interpreter used to start the run.
1239
+ type : str, default 'default'
1240
+ Card type.
1241
+ id : str, optional, default None
1242
+ If multiple cards are present, use this id to identify this card.
1243
+ options : Dict[str, Any], default {}
1244
+ Options passed to the card. The contents depend on the card type.
1245
+ timeout : int, default 45
1246
+ Interrupt reporting if it takes more than this many seconds.
1247
+
1248
+
1390
1249
  """
1391
1250
  ...
1392
1251
 
1393
- 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]]:
1252
+ @typing.overload
1253
+ 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]]]:
1394
1254
  """
1395
- 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.
1396
- 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.
1255
+ Specifies secrets to be retrieved and injected as environment variables prior to
1256
+ the execution of a step.
1397
1257
 
1398
1258
  Parameters
1399
1259
  ----------
1400
- timeout : int
1401
- Time, in seconds before the task times out and fails. (Default: 3600)
1402
- poke_interval : int
1403
- Time in seconds that the job should wait in between each try. (Default: 60)
1404
- mode : str
1405
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1406
- exponential_backoff : bool
1407
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1408
- pool : str
1409
- the slot pool this task should run in,
1410
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1411
- soft_fail : bool
1412
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1413
- name : str
1414
- Name of the sensor on Airflow
1415
- description : str
1416
- Description of sensor in the Airflow UI
1417
- external_dag_id : str
1418
- The dag_id that contains the task you want to wait for.
1419
- external_task_ids : List[str]
1420
- The list of task_ids that you want to wait for.
1421
- If None (default value) the sensor waits for the DAG. (Default: None)
1422
- allowed_states : List[str]
1423
- Iterable of allowed states, (Default: ['success'])
1424
- failed_states : List[str]
1425
- Iterable of failed or dis-allowed states. (Default: None)
1426
- execution_delta : datetime.timedelta
1427
- time difference with the previous execution to look at,
1428
- the default is the same logical date as the current task or DAG. (Default: None)
1429
- check_existence: bool
1430
- Set to True to check if the external task exists or check if
1431
- the DAG to wait for exists. (Default: True)
1260
+ sources : List[Union[str, Dict[str, Any]]], default: []
1261
+ List of secret specs, defining how the secrets are to be retrieved
1432
1262
  """
1433
1263
  ...
1434
1264
 
1435
1265
  @typing.overload
1436
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1266
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1267
+ ...
1268
+
1269
+ @typing.overload
1270
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1271
+ ...
1272
+
1273
+ 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]]] = []):
1437
1274
  """
1438
- Specifies the PyPI packages for all steps of the flow.
1275
+ Specifies secrets to be retrieved and injected as environment variables prior to
1276
+ the execution of a step.
1439
1277
 
1440
- Use `@pypi_base` to set common packages required by all
1441
- steps and use `@pypi` to specify step-specific overrides.
1442
1278
  Parameters
1443
1279
  ----------
1444
- packages : Dict[str, str], default: {}
1445
- Packages to use for this flow. The key is the name of the package
1446
- and the value is the version to use.
1447
- python : str, optional, default: None
1448
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1449
- that the version used will correspond to the version of the Python interpreter used to start the run.
1280
+ sources : List[Union[str, Dict[str, Any]]], default: []
1281
+ List of secret specs, defining how the secrets are to be retrieved
1282
+ """
1283
+ ...
1284
+
1285
+ 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]]]:
1286
+ """
1287
+ Specifies that this step should execute on Kubernetes.
1288
+
1289
+ Parameters
1290
+ ----------
1291
+ cpu : int, default 1
1292
+ Number of CPUs required for this step. If `@resources` is
1293
+ also present, the maximum value from all decorators is used.
1294
+ memory : int, default 4096
1295
+ Memory size (in MB) required for this step. If
1296
+ `@resources` is also present, the maximum value from all decorators is
1297
+ used.
1298
+ disk : int, default 10240
1299
+ Disk size (in MB) required for this step. If
1300
+ `@resources` is also present, the maximum value from all decorators is
1301
+ used.
1302
+ image : str, optional, default None
1303
+ Docker image to use when launching on Kubernetes. If not specified, and
1304
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1305
+ not, a default Docker image mapping to the current version of Python is used.
1306
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1307
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
1308
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1309
+ Kubernetes service account to use when launching pod in Kubernetes.
1310
+ secrets : List[str], optional, default None
1311
+ Kubernetes secrets to use when launching pod in Kubernetes. These
1312
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1313
+ in Metaflow configuration.
1314
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1315
+ Kubernetes namespace to use when launching pod in Kubernetes.
1316
+ gpu : int, optional, default None
1317
+ Number of GPUs required for this step. A value of zero implies that
1318
+ the scheduled node should not have GPUs.
1319
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1320
+ The vendor of the GPUs to be used for this step.
1321
+ tolerations : List[str], default []
1322
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1323
+ Kubernetes tolerations to use when launching pod in Kubernetes.
1324
+ use_tmpfs : bool, default False
1325
+ This enables an explicit tmpfs mount for this step.
1326
+ tmpfs_tempdir : bool, default True
1327
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1328
+ tmpfs_size : int, optional, default: None
1329
+ The value for the size (in MiB) of the tmpfs mount for this step.
1330
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1331
+ memory allocated for this step.
1332
+ tmpfs_path : str, optional, default /metaflow_temp
1333
+ Path to tmpfs mount for this step.
1334
+ persistent_volume_claims : Dict[str, str], optional, default None
1335
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1336
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1337
+ shared_memory: int, optional
1338
+ Shared memory size (in MiB) required for this step
1339
+ port: int, optional
1340
+ Port number to specify in the Kubernetes job object
1450
1341
  """
1451
1342
  ...
1452
1343
 
1453
1344
  @typing.overload
1454
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1345
+ 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]]]:
1346
+ """
1347
+ Specifies that the step will success under all circumstances.
1348
+
1349
+ The decorator will create an optional artifact, specified by `var`, which
1350
+ contains the exception raised. You can use it to detect the presence
1351
+ of errors, indicating that all happy-path artifacts produced by the step
1352
+ are missing.
1353
+
1354
+ Parameters
1355
+ ----------
1356
+ var : str, optional, default None
1357
+ Name of the artifact in which to store the caught exception.
1358
+ If not specified, the exception is not stored.
1359
+ print_exception : bool, default True
1360
+ Determines whether or not the exception is printed to
1361
+ stdout when caught.
1362
+ """
1455
1363
  ...
1456
1364
 
1457
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1365
+ @typing.overload
1366
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1367
+ ...
1368
+
1369
+ @typing.overload
1370
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1371
+ ...
1372
+
1373
+ 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):
1458
1374
  """
1459
- Specifies the PyPI packages for all steps of the flow.
1375
+ Specifies that the step will success under all circumstances.
1376
+
1377
+ The decorator will create an optional artifact, specified by `var`, which
1378
+ contains the exception raised. You can use it to detect the presence
1379
+ of errors, indicating that all happy-path artifacts produced by the step
1380
+ are missing.
1460
1381
 
1461
- Use `@pypi_base` to set common packages required by all
1462
- steps and use `@pypi` to specify step-specific overrides.
1463
1382
  Parameters
1464
1383
  ----------
1465
- packages : Dict[str, str], default: {}
1466
- Packages to use for this flow. The key is the name of the package
1467
- and the value is the version to use.
1468
- python : str, optional, default: None
1469
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1470
- that the version used will correspond to the version of the Python interpreter used to start the run.
1384
+ var : str, optional, default None
1385
+ Name of the artifact in which to store the caught exception.
1386
+ If not specified, the exception is not stored.
1387
+ print_exception : bool, default True
1388
+ Determines whether or not the exception is printed to
1389
+ stdout when caught.
1471
1390
  """
1472
1391
  ...
1473
1392
 
@@ -1520,52 +1439,87 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1520
1439
  """
1521
1440
  ...
1522
1441
 
1523
- @typing.overload
1524
- 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]]:
1442
+ 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]]:
1525
1443
  """
1526
- Specifies the times when the flow should be run when running on a
1527
- production scheduler.
1444
+ 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)
1445
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1446
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1447
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1448
+ starts only after all sensors finish.
1528
1449
 
1529
1450
  Parameters
1530
1451
  ----------
1531
- hourly : bool, default False
1532
- Run the workflow hourly.
1533
- daily : bool, default True
1534
- Run the workflow daily.
1535
- weekly : bool, default False
1536
- Run the workflow weekly.
1537
- cron : str, optional, default None
1538
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1539
- specified by this expression.
1540
- timezone : str, optional, default None
1541
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1542
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1452
+ timeout : int
1453
+ Time, in seconds before the task times out and fails. (Default: 3600)
1454
+ poke_interval : int
1455
+ Time in seconds that the job should wait in between each try. (Default: 60)
1456
+ mode : str
1457
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1458
+ exponential_backoff : bool
1459
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1460
+ pool : str
1461
+ the slot pool this task should run in,
1462
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1463
+ soft_fail : bool
1464
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1465
+ name : str
1466
+ Name of the sensor on Airflow
1467
+ description : str
1468
+ Description of sensor in the Airflow UI
1469
+ bucket_key : Union[str, List[str]]
1470
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1471
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1472
+ bucket_name : str
1473
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1474
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1475
+ wildcard_match : bool
1476
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1477
+ aws_conn_id : str
1478
+ a reference to the s3 connection on Airflow. (Default: None)
1479
+ verify : bool
1480
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1543
1481
  """
1544
1482
  ...
1545
1483
 
1546
- @typing.overload
1547
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1548
- ...
1549
-
1550
- 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):
1484
+ 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]]:
1551
1485
  """
1552
- Specifies the times when the flow should be run when running on a
1553
- production scheduler.
1486
+ 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.
1487
+ 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.
1554
1488
 
1555
1489
  Parameters
1556
1490
  ----------
1557
- hourly : bool, default False
1558
- Run the workflow hourly.
1559
- daily : bool, default True
1560
- Run the workflow daily.
1561
- weekly : bool, default False
1562
- Run the workflow weekly.
1563
- cron : str, optional, default None
1564
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1565
- specified by this expression.
1566
- timezone : str, optional, default None
1567
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1568
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1491
+ timeout : int
1492
+ Time, in seconds before the task times out and fails. (Default: 3600)
1493
+ poke_interval : int
1494
+ Time in seconds that the job should wait in between each try. (Default: 60)
1495
+ mode : str
1496
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1497
+ exponential_backoff : bool
1498
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1499
+ pool : str
1500
+ the slot pool this task should run in,
1501
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1502
+ soft_fail : bool
1503
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1504
+ name : str
1505
+ Name of the sensor on Airflow
1506
+ description : str
1507
+ Description of sensor in the Airflow UI
1508
+ external_dag_id : str
1509
+ The dag_id that contains the task you want to wait for.
1510
+ external_task_ids : List[str]
1511
+ The list of task_ids that you want to wait for.
1512
+ If None (default value) the sensor waits for the DAG. (Default: None)
1513
+ allowed_states : List[str]
1514
+ Iterable of allowed states, (Default: ['success'])
1515
+ failed_states : List[str]
1516
+ Iterable of failed or dis-allowed states. (Default: None)
1517
+ execution_delta : datetime.timedelta
1518
+ time difference with the previous execution to look at,
1519
+ the default is the same logical date as the current task or DAG. (Default: None)
1520
+ check_existence: bool
1521
+ Set to True to check if the external task exists or check if
1522
+ the DAG to wait for exists. (Default: True)
1569
1523
  """
1570
1524
  ...
1571
1525
 
@@ -1672,6 +1626,24 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1672
1626
  """
1673
1627
  ...
1674
1628
 
1629
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1630
+ """
1631
+ Specifies what flows belong to the same project.
1632
+
1633
+ A project-specific namespace is created for all flows that
1634
+ use the same `@project(name)`.
1635
+
1636
+ Parameters
1637
+ ----------
1638
+ name : str
1639
+ Project name. Make sure that the name is unique amongst all
1640
+ projects that use the same production scheduler. The name may
1641
+ contain only lowercase alphanumeric characters and underscores.
1642
+
1643
+
1644
+ """
1645
+ ...
1646
+
1675
1647
  @typing.overload
1676
1648
  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]]:
1677
1649
  """
@@ -1767,63 +1739,91 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1767
1739
  """
1768
1740
  ...
1769
1741
 
1770
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1742
+ @typing.overload
1743
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1771
1744
  """
1772
- Specifies what flows belong to the same project.
1773
-
1774
- A project-specific namespace is created for all flows that
1775
- use the same `@project(name)`.
1745
+ Specifies the PyPI packages for all steps of the flow.
1776
1746
 
1747
+ Use `@pypi_base` to set common packages required by all
1748
+ steps and use `@pypi` to specify step-specific overrides.
1777
1749
  Parameters
1778
1750
  ----------
1779
- name : str
1780
- Project name. Make sure that the name is unique amongst all
1781
- projects that use the same production scheduler. The name may
1782
- contain only lowercase alphanumeric characters and underscores.
1751
+ packages : Dict[str, str], default: {}
1752
+ Packages to use for this flow. The key is the name of the package
1753
+ and the value is the version to use.
1754
+ python : str, optional, default: None
1755
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1756
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1757
+ """
1758
+ ...
1759
+
1760
+ @typing.overload
1761
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1762
+ ...
1763
+
1764
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1765
+ """
1766
+ Specifies the PyPI packages for all steps of the flow.
1783
1767
 
1768
+ Use `@pypi_base` to set common packages required by all
1769
+ steps and use `@pypi` to specify step-specific overrides.
1770
+ Parameters
1771
+ ----------
1772
+ packages : Dict[str, str], default: {}
1773
+ Packages to use for this flow. The key is the name of the package
1774
+ and the value is the version to use.
1775
+ python : str, optional, default: None
1776
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1777
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1778
+ """
1779
+ ...
1780
+
1781
+ @typing.overload
1782
+ 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]]:
1783
+ """
1784
+ Specifies the times when the flow should be run when running on a
1785
+ production scheduler.
1784
1786
 
1787
+ Parameters
1788
+ ----------
1789
+ hourly : bool, default False
1790
+ Run the workflow hourly.
1791
+ daily : bool, default True
1792
+ Run the workflow daily.
1793
+ weekly : bool, default False
1794
+ Run the workflow weekly.
1795
+ cron : str, optional, default None
1796
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1797
+ specified by this expression.
1798
+ timezone : str, optional, default None
1799
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1800
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1785
1801
  """
1786
1802
  ...
1787
1803
 
1788
- 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]]:
1804
+ @typing.overload
1805
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1806
+ ...
1807
+
1808
+ 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):
1789
1809
  """
1790
- 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)
1791
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1792
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1793
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1794
- starts only after all sensors finish.
1810
+ Specifies the times when the flow should be run when running on a
1811
+ production scheduler.
1795
1812
 
1796
1813
  Parameters
1797
1814
  ----------
1798
- timeout : int
1799
- Time, in seconds before the task times out and fails. (Default: 3600)
1800
- poke_interval : int
1801
- Time in seconds that the job should wait in between each try. (Default: 60)
1802
- mode : str
1803
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1804
- exponential_backoff : bool
1805
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1806
- pool : str
1807
- the slot pool this task should run in,
1808
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1809
- soft_fail : bool
1810
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1811
- name : str
1812
- Name of the sensor on Airflow
1813
- description : str
1814
- Description of sensor in the Airflow UI
1815
- bucket_key : Union[str, List[str]]
1816
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1817
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1818
- bucket_name : str
1819
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1820
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1821
- wildcard_match : bool
1822
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1823
- aws_conn_id : str
1824
- a reference to the s3 connection on Airflow. (Default: None)
1825
- verify : bool
1826
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1815
+ hourly : bool, default False
1816
+ Run the workflow hourly.
1817
+ daily : bool, default True
1818
+ Run the workflow daily.
1819
+ weekly : bool, default False
1820
+ Run the workflow weekly.
1821
+ cron : str, optional, default None
1822
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1823
+ specified by this expression.
1824
+ timezone : str, optional, default None
1825
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1826
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1827
1827
  """
1828
1828
  ...
1829
1829