metaflow-stubs 2.11.16__py2.py3-none-any.whl → 2.12.0__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 (142) hide show
  1. metaflow-stubs/__init__.pyi +598 -399
  2. metaflow-stubs/cards.pyi +6 -6
  3. metaflow-stubs/cli.pyi +42 -22
  4. metaflow-stubs/client/__init__.pyi +4 -4
  5. metaflow-stubs/client/core.pyi +7 -7
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +3 -3
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +5 -5
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +3 -3
  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 +5 -5
  17. metaflow-stubs/mflog/mflog.pyi +2 -2
  18. metaflow-stubs/multicore_utils.pyi +2 -2
  19. metaflow-stubs/parameters.pyi +4 -4
  20. metaflow-stubs/plugins/__init__.pyi +2 -2
  21. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/airflow.pyi +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 +3 -3
  29. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  30. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  31. metaflow-stubs/plugins/argo/__init__.pyi +2 -2
  32. metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
  33. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  34. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
  35. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +4 -4
  36. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
  37. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  38. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  39. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +2 -2
  43. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  44. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  45. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  46. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  47. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  52. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +4 -4
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  55. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +2 -2
  56. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  57. metaflow-stubs/plugins/azure/azure_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 +2 -2
  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 +3 -3
  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 +3 -3
  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 +3 -3
  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 +3 -3
  88. metaflow-stubs/plugins/datatools/s3/s3.pyi +5 -5
  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 +3 -3
  95. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  96. metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
  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 +2 -2
  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_job.pyi +2 -2
  109. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  110. metaflow-stubs/plugins/logs_cli.pyi +3 -3
  111. metaflow-stubs/plugins/package_cli.pyi +2 -2
  112. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  113. metaflow-stubs/plugins/project_decorator.pyi +3 -3
  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 +3 -3
  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 +4 -4
  127. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  128. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  129. metaflow-stubs/procpoll.pyi +2 -2
  130. metaflow-stubs/pylint_wrapper.pyi +2 -2
  131. metaflow-stubs/runner/__init__.pyi +9 -0
  132. metaflow-stubs/runner/metaflow_runner.pyi +696 -0
  133. metaflow-stubs/runner/nbrun.pyi +224 -0
  134. metaflow-stubs/runner/subprocess_manager.pyi +221 -0
  135. metaflow-stubs/tagging_util.pyi +2 -2
  136. metaflow-stubs/tuple_util.pyi +2 -2
  137. metaflow-stubs/version.pyi +2 -2
  138. {metaflow_stubs-2.11.16.dist-info → metaflow_stubs-2.12.0.dist-info}/METADATA +2 -2
  139. metaflow_stubs-2.12.0.dist-info/RECORD +142 -0
  140. metaflow_stubs-2.11.16.dist-info/RECORD +0 -138
  141. {metaflow_stubs-2.11.16.dist-info → metaflow_stubs-2.12.0.dist-info}/WHEEL +0 -0
  142. {metaflow_stubs-2.11.16.dist-info → metaflow_stubs-2.12.0.dist-info}/top_level.txt +0 -0
@@ -1,23 +1,24 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.11.16 #
4
- # Generated on 2024-05-22T00:31:19.988196 #
3
+ # MF version: 2.12.0 #
4
+ # Generated on 2024-05-28T09:55:27.155006 #
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.parameters
11
12
  import metaflow._vendor.click.types
12
- import metaflow.plugins.datatools.s3.s3
13
- import metaflow.events
14
13
  import metaflow.datastore.inputs
15
- import typing
16
14
  import datetime
17
15
  import metaflow.client.core
18
- import io
16
+ import metaflow.plugins.datatools.s3.s3
17
+ import typing
19
18
  import metaflow.metaflow_current
20
- import metaflow.parameters
19
+ import io
20
+ import metaflow.events
21
+ import metaflow.runner.metaflow_runner
21
22
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
22
23
  StepFlag = typing.NewType("StepFlag", bool)
23
24
 
@@ -802,54 +803,62 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
802
803
  """
803
804
  ...
804
805
 
805
- @typing.overload
806
- 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]]]:
807
- """
808
- Creates a human-readable report, a Metaflow Card, after this step completes.
809
-
810
- Note that you may add multiple `@card` decorators in a step with different parameters.
811
-
812
- Parameters
813
- ----------
814
- type : str, default 'default'
815
- Card type.
816
- id : str, optional, default None
817
- If multiple cards are present, use this id to identify this card.
818
- options : Dict[str, Any], default {}
819
- Options passed to the card. The contents depend on the card type.
820
- timeout : int, default 45
821
- Interrupt reporting if it takes more than this many seconds.
822
-
823
-
824
- """
825
- ...
826
-
827
- @typing.overload
828
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
829
- ...
830
-
831
- @typing.overload
832
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
833
- ...
834
-
835
- 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):
806
+ 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]]]:
836
807
  """
837
- Creates a human-readable report, a Metaflow Card, after this step completes.
838
-
839
- Note that you may add multiple `@card` decorators in a step with different parameters.
808
+ Specifies that this step should execute on Kubernetes.
840
809
 
841
810
  Parameters
842
811
  ----------
843
- type : str, default 'default'
844
- Card type.
845
- id : str, optional, default None
846
- If multiple cards are present, use this id to identify this card.
847
- options : Dict[str, Any], default {}
848
- Options passed to the card. The contents depend on the card type.
849
- timeout : int, default 45
850
- Interrupt reporting if it takes more than this many seconds.
851
-
852
-
812
+ cpu : int, default 1
813
+ Number of CPUs required for this step. If `@resources` is
814
+ also present, the maximum value from all decorators is used.
815
+ memory : int, default 4096
816
+ Memory size (in MB) required for this step. If
817
+ `@resources` is also present, the maximum value from all decorators is
818
+ used.
819
+ disk : int, default 10240
820
+ Disk size (in MB) required for this step. If
821
+ `@resources` is also present, the maximum value from all decorators is
822
+ used.
823
+ image : str, optional, default None
824
+ Docker image to use when launching on Kubernetes. If not specified, and
825
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
826
+ not, a default Docker image mapping to the current version of Python is used.
827
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
828
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
829
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
830
+ Kubernetes service account to use when launching pod in Kubernetes.
831
+ secrets : List[str], optional, default None
832
+ Kubernetes secrets to use when launching pod in Kubernetes. These
833
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
834
+ in Metaflow configuration.
835
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
836
+ Kubernetes namespace to use when launching pod in Kubernetes.
837
+ gpu : int, optional, default None
838
+ Number of GPUs required for this step. A value of zero implies that
839
+ the scheduled node should not have GPUs.
840
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
841
+ The vendor of the GPUs to be used for this step.
842
+ tolerations : List[str], default []
843
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
844
+ Kubernetes tolerations to use when launching pod in Kubernetes.
845
+ use_tmpfs : bool, default False
846
+ This enables an explicit tmpfs mount for this step.
847
+ tmpfs_tempdir : bool, default True
848
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
849
+ tmpfs_size : int, optional, default: None
850
+ The value for the size (in MiB) of the tmpfs mount for this step.
851
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
852
+ memory allocated for this step.
853
+ tmpfs_path : str, optional, default /metaflow_temp
854
+ Path to tmpfs mount for this step.
855
+ persistent_volume_claims : Dict[str, str], optional, default None
856
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
857
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
858
+ shared_memory: int, optional
859
+ Shared memory size (in MiB) required for this step
860
+ port: int, optional
861
+ Port number to specify in the Kubernetes job object
853
862
  """
854
863
  ...
855
864
 
@@ -911,15 +920,15 @@ def batch(*, cpu: int = 1, gpu: int = 0, memory: int = 4096, image: typing.Optio
911
920
  Alias for inferentia. Use only one of the two.
912
921
  efa : int, default 0
913
922
  Number of elastic fabric adapter network devices to attach to container
914
- ephemeral_storage: int, default None
915
- The total amount, in GiB, of ephemeral storage to set for the task (21-200)
923
+ ephemeral_storage : int, default None
924
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
916
925
  This is only relevant for Fargate compute environments
917
926
  log_driver: str, optional, default None
918
927
  The log driver to use for the Amazon ECS container.
919
928
  log_options: List[str], optional, default None
920
929
  List of strings containing options for the chosen log driver. The configurable values
921
930
  depend on the `log driver` chosen. Validation of these options is not supported yet.
922
- Example usage: ["awslogs-group:aws/batch/job"]
931
+ Example: [`awslogs-group:aws/batch/job`]
923
932
  """
924
933
  ...
925
934
 
@@ -988,74 +997,72 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
988
997
  Alias for inferentia. Use only one of the two.
989
998
  efa : int, default 0
990
999
  Number of elastic fabric adapter network devices to attach to container
991
- ephemeral_storage: int, default None
992
- The total amount, in GiB, of ephemeral storage to set for the task (21-200)
1000
+ ephemeral_storage : int, default None
1001
+ The total amount, in GiB, of ephemeral storage to set for the task, 21-200GiB.
993
1002
  This is only relevant for Fargate compute environments
994
1003
  log_driver: str, optional, default None
995
1004
  The log driver to use for the Amazon ECS container.
996
1005
  log_options: List[str], optional, default None
997
1006
  List of strings containing options for the chosen log driver. The configurable values
998
1007
  depend on the `log driver` chosen. Validation of these options is not supported yet.
999
- Example usage: ["awslogs-group:aws/batch/job"]
1008
+ Example: [`awslogs-group:aws/batch/job`]
1000
1009
  """
1001
1010
  ...
1002
1011
 
1003
- 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]]]:
1012
+ @typing.overload
1013
+ 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]]]:
1004
1014
  """
1005
- Specifies that this step should execute on Kubernetes.
1015
+ Specifies a timeout for your step.
1016
+
1017
+ This decorator is useful if this step may hang indefinitely.
1018
+
1019
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1020
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1021
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1022
+
1023
+ Note that all the values specified in parameters are added together so if you specify
1024
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1006
1025
 
1007
1026
  Parameters
1008
1027
  ----------
1009
- cpu : int, default 1
1010
- Number of CPUs required for this step. If `@resources` is
1011
- also present, the maximum value from all decorators is used.
1012
- memory : int, default 4096
1013
- Memory size (in MB) required for this step. If
1014
- `@resources` is also present, the maximum value from all decorators is
1015
- used.
1016
- disk : int, default 10240
1017
- Disk size (in MB) required for this step. If
1018
- `@resources` is also present, the maximum value from all decorators is
1019
- used.
1020
- image : str, optional, default None
1021
- Docker image to use when launching on Kubernetes. If not specified, and
1022
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1023
- not, a default Docker image mapping to the current version of Python is used.
1024
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1025
- If given, the imagePullPolicy to be applied to the Docker image of the step.
1026
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1027
- Kubernetes service account to use when launching pod in Kubernetes.
1028
- secrets : List[str], optional, default None
1029
- Kubernetes secrets to use when launching pod in Kubernetes. These
1030
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1031
- in Metaflow configuration.
1032
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1033
- Kubernetes namespace to use when launching pod in Kubernetes.
1034
- gpu : int, optional, default None
1035
- Number of GPUs required for this step. A value of zero implies that
1036
- the scheduled node should not have GPUs.
1037
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1038
- The vendor of the GPUs to be used for this step.
1039
- tolerations : List[str], default []
1040
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1041
- Kubernetes tolerations to use when launching pod in Kubernetes.
1042
- use_tmpfs : bool, default False
1043
- This enables an explicit tmpfs mount for this step.
1044
- tmpfs_tempdir : bool, default True
1045
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1046
- tmpfs_size : int, optional, default: None
1047
- The value for the size (in MiB) of the tmpfs mount for this step.
1048
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1049
- memory allocated for this step.
1050
- tmpfs_path : str, optional, default /metaflow_temp
1051
- Path to tmpfs mount for this step.
1052
- persistent_volume_claims : Dict[str, str], optional, default None
1053
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1054
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1055
- shared_memory: int, optional
1056
- Shared memory size (in MiB) required for this step
1057
- port: int, optional
1058
- Port number to specify in the Kubernetes job object
1028
+ seconds : int, default 0
1029
+ Number of seconds to wait prior to timing out.
1030
+ minutes : int, default 0
1031
+ Number of minutes to wait prior to timing out.
1032
+ hours : int, default 0
1033
+ Number of hours to wait prior to timing out.
1034
+ """
1035
+ ...
1036
+
1037
+ @typing.overload
1038
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1039
+ ...
1040
+
1041
+ @typing.overload
1042
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1043
+ ...
1044
+
1045
+ 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):
1046
+ """
1047
+ Specifies a timeout for your step.
1048
+
1049
+ This decorator is useful if this step may hang indefinitely.
1050
+
1051
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1052
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1053
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1054
+
1055
+ Note that all the values specified in parameters are added together so if you specify
1056
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1057
+
1058
+ Parameters
1059
+ ----------
1060
+ seconds : int, default 0
1061
+ Number of seconds to wait prior to timing out.
1062
+ minutes : int, default 0
1063
+ Number of minutes to wait prior to timing out.
1064
+ hours : int, default 0
1065
+ Number of hours to wait prior to timing out.
1059
1066
  """
1060
1067
  ...
1061
1068
 
@@ -1091,51 +1098,35 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
1091
1098
  ...
1092
1099
 
1093
1100
  @typing.overload
1094
- 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]]]:
1101
+ 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]]]:
1095
1102
  """
1096
- Specifies that the step will success under all circumstances.
1097
-
1098
- The decorator will create an optional artifact, specified by `var`, which
1099
- contains the exception raised. You can use it to detect the presence
1100
- of errors, indicating that all happy-path artifacts produced by the step
1101
- are missing.
1103
+ Specifies secrets to be retrieved and injected as environment variables prior to
1104
+ the execution of a step.
1102
1105
 
1103
1106
  Parameters
1104
1107
  ----------
1105
- var : str, optional, default None
1106
- Name of the artifact in which to store the caught exception.
1107
- If not specified, the exception is not stored.
1108
- print_exception : bool, default True
1109
- Determines whether or not the exception is printed to
1110
- stdout when caught.
1108
+ sources : List[Union[str, Dict[str, Any]]], default: []
1109
+ List of secret specs, defining how the secrets are to be retrieved
1111
1110
  """
1112
1111
  ...
1113
1112
 
1114
1113
  @typing.overload
1115
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1114
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1116
1115
  ...
1117
1116
 
1118
1117
  @typing.overload
1119
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1118
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1120
1119
  ...
1121
1120
 
1122
- 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):
1121
+ 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]]] = []):
1123
1122
  """
1124
- Specifies that the step will success under all circumstances.
1125
-
1126
- The decorator will create an optional artifact, specified by `var`, which
1127
- contains the exception raised. You can use it to detect the presence
1128
- of errors, indicating that all happy-path artifacts produced by the step
1129
- are missing.
1123
+ Specifies secrets to be retrieved and injected as environment variables prior to
1124
+ the execution of a step.
1130
1125
 
1131
1126
  Parameters
1132
1127
  ----------
1133
- var : str, optional, default None
1134
- Name of the artifact in which to store the caught exception.
1135
- If not specified, the exception is not stored.
1136
- print_exception : bool, default True
1137
- Determines whether or not the exception is printed to
1138
- stdout when caught.
1128
+ sources : List[Union[str, Dict[str, Any]]], default: []
1129
+ List of secret specs, defining how the secrets are to be retrieved
1139
1130
  """
1140
1131
  ...
1141
1132
 
@@ -1193,149 +1184,102 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
1193
1184
  ...
1194
1185
 
1195
1186
  @typing.overload
1196
- 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]]]:
1187
+ 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]]]:
1197
1188
  """
1198
- Specifies secrets to be retrieved and injected as environment variables prior to
1199
- the execution of a step.
1189
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1190
+
1191
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1200
1192
 
1201
1193
  Parameters
1202
1194
  ----------
1203
- sources : List[Union[str, Dict[str, Any]]], default: []
1204
- List of secret specs, defining how the secrets are to be retrieved
1205
- """
1206
- ...
1207
-
1208
- @typing.overload
1209
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1210
- ...
1211
-
1212
- @typing.overload
1213
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1214
- ...
1215
-
1216
- 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]]] = []):
1217
- """
1218
- Specifies secrets to be retrieved and injected as environment variables prior to
1219
- the execution of a step.
1220
-
1221
- Parameters
1222
- ----------
1223
- sources : List[Union[str, Dict[str, Any]]], default: []
1224
- List of secret specs, defining how the secrets are to be retrieved
1225
- """
1226
- ...
1227
-
1228
- @typing.overload
1229
- 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]]]:
1230
- """
1231
- Specifies the Conda environment for the step.
1195
+ type : str, default 'default'
1196
+ Card type.
1197
+ id : str, optional, default None
1198
+ If multiple cards are present, use this id to identify this card.
1199
+ options : Dict[str, Any], default {}
1200
+ Options passed to the card. The contents depend on the card type.
1201
+ timeout : int, default 45
1202
+ Interrupt reporting if it takes more than this many seconds.
1232
1203
 
1233
- Information in this decorator will augment any
1234
- attributes set in the `@conda_base` flow-level decorator. Hence,
1235
- you can use `@conda_base` to set packages required by all
1236
- steps and use `@conda` to specify step-specific overrides.
1237
1204
 
1238
- Parameters
1239
- ----------
1240
- packages : Dict[str, str], default {}
1241
- Packages to use for this step. The key is the name of the package
1242
- and the value is the version to use.
1243
- libraries : Dict[str, str], default {}
1244
- Supported for backward compatibility. When used with packages, packages will take precedence.
1245
- python : str, optional, default None
1246
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1247
- that the version used will correspond to the version of the Python interpreter used to start the run.
1248
- disabled : bool, default False
1249
- If set to True, disables @conda.
1250
1205
  """
1251
1206
  ...
1252
1207
 
1253
1208
  @typing.overload
1254
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1209
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1255
1210
  ...
1256
1211
 
1257
1212
  @typing.overload
1258
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1213
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1259
1214
  ...
1260
1215
 
1261
- 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):
1216
+ 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):
1262
1217
  """
1263
- Specifies the Conda environment for the step.
1218
+ Creates a human-readable report, a Metaflow Card, after this step completes.
1264
1219
 
1265
- Information in this decorator will augment any
1266
- attributes set in the `@conda_base` flow-level decorator. Hence,
1267
- you can use `@conda_base` to set packages required by all
1268
- steps and use `@conda` to specify step-specific overrides.
1220
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1269
1221
 
1270
1222
  Parameters
1271
1223
  ----------
1272
- packages : Dict[str, str], default {}
1273
- Packages to use for this step. The key is the name of the package
1274
- and the value is the version to use.
1275
- libraries : Dict[str, str], default {}
1276
- Supported for backward compatibility. When used with packages, packages will take precedence.
1277
- python : str, optional, default None
1278
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1279
- that the version used will correspond to the version of the Python interpreter used to start the run.
1280
- disabled : bool, default False
1281
- If set to True, disables @conda.
1224
+ type : str, default 'default'
1225
+ Card type.
1226
+ id : str, optional, default None
1227
+ If multiple cards are present, use this id to identify this card.
1228
+ options : Dict[str, Any], default {}
1229
+ Options passed to the card. The contents depend on the card type.
1230
+ timeout : int, default 45
1231
+ Interrupt reporting if it takes more than this many seconds.
1232
+
1233
+
1282
1234
  """
1283
1235
  ...
1284
1236
 
1285
1237
  @typing.overload
1286
- 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]]]:
1238
+ 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]]]:
1287
1239
  """
1288
- Specifies a timeout for your step.
1289
-
1290
- This decorator is useful if this step may hang indefinitely.
1291
-
1292
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1293
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1294
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1240
+ Specifies that the step will success under all circumstances.
1295
1241
 
1296
- Note that all the values specified in parameters are added together so if you specify
1297
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1242
+ The decorator will create an optional artifact, specified by `var`, which
1243
+ contains the exception raised. You can use it to detect the presence
1244
+ of errors, indicating that all happy-path artifacts produced by the step
1245
+ are missing.
1298
1246
 
1299
1247
  Parameters
1300
1248
  ----------
1301
- seconds : int, default 0
1302
- Number of seconds to wait prior to timing out.
1303
- minutes : int, default 0
1304
- Number of minutes to wait prior to timing out.
1305
- hours : int, default 0
1306
- Number of hours to wait prior to timing out.
1249
+ var : str, optional, default None
1250
+ Name of the artifact in which to store the caught exception.
1251
+ If not specified, the exception is not stored.
1252
+ print_exception : bool, default True
1253
+ Determines whether or not the exception is printed to
1254
+ stdout when caught.
1307
1255
  """
1308
1256
  ...
1309
1257
 
1310
1258
  @typing.overload
1311
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1259
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1312
1260
  ...
1313
1261
 
1314
1262
  @typing.overload
1315
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1263
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1316
1264
  ...
1317
1265
 
1318
- 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):
1266
+ 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):
1319
1267
  """
1320
- Specifies a timeout for your step.
1321
-
1322
- This decorator is useful if this step may hang indefinitely.
1323
-
1324
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1325
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
1326
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
1268
+ Specifies that the step will success under all circumstances.
1327
1269
 
1328
- Note that all the values specified in parameters are added together so if you specify
1329
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1270
+ The decorator will create an optional artifact, specified by `var`, which
1271
+ contains the exception raised. You can use it to detect the presence
1272
+ of errors, indicating that all happy-path artifacts produced by the step
1273
+ are missing.
1330
1274
 
1331
1275
  Parameters
1332
1276
  ----------
1333
- seconds : int, default 0
1334
- Number of seconds to wait prior to timing out.
1335
- minutes : int, default 0
1336
- Number of minutes to wait prior to timing out.
1337
- hours : int, default 0
1338
- Number of hours to wait prior to timing out.
1277
+ var : str, optional, default None
1278
+ Name of the artifact in which to store the caught exception.
1279
+ If not specified, the exception is not stored.
1280
+ print_exception : bool, default True
1281
+ Determines whether or not the exception is printed to
1282
+ stdout when caught.
1339
1283
  """
1340
1284
  ...
1341
1285
 
@@ -1389,98 +1333,19 @@ def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
1389
1333
  ...
1390
1334
 
1391
1335
  @typing.overload
1392
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1393
- """
1394
- Specifies the PyPI packages for all steps of the flow.
1395
-
1396
- Use `@pypi_base` to set common packages required by all
1397
- steps and use `@pypi` to specify step-specific overrides.
1398
- Parameters
1399
- ----------
1400
- packages : Dict[str, str], default: {}
1401
- Packages to use for this flow. The key is the name of the package
1402
- and the value is the version to use.
1403
- python : str, optional, default: None
1404
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1405
- that the version used will correspond to the version of the Python interpreter used to start the run.
1406
- """
1407
- ...
1408
-
1409
- @typing.overload
1410
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1411
- ...
1412
-
1413
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1414
- """
1415
- Specifies the PyPI packages for all steps of the flow.
1416
-
1417
- Use `@pypi_base` to set common packages required by all
1418
- steps and use `@pypi` to specify step-specific overrides.
1419
- Parameters
1420
- ----------
1421
- packages : Dict[str, str], default: {}
1422
- Packages to use for this flow. The key is the name of the package
1423
- and the value is the version to use.
1424
- python : str, optional, default: None
1425
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1426
- that the version used will correspond to the version of the Python interpreter used to start the run.
1427
- """
1428
- ...
1429
-
1430
- 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]]:
1431
- """
1432
- 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)
1433
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1434
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1435
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1436
- starts only after all sensors finish.
1437
-
1438
- Parameters
1439
- ----------
1440
- timeout : int
1441
- Time, in seconds before the task times out and fails. (Default: 3600)
1442
- poke_interval : int
1443
- Time in seconds that the job should wait in between each try. (Default: 60)
1444
- mode : str
1445
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1446
- exponential_backoff : bool
1447
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1448
- pool : str
1449
- the slot pool this task should run in,
1450
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1451
- soft_fail : bool
1452
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1453
- name : str
1454
- Name of the sensor on Airflow
1455
- description : str
1456
- Description of sensor in the Airflow UI
1457
- bucket_key : Union[str, List[str]]
1458
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1459
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1460
- bucket_name : str
1461
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1462
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1463
- wildcard_match : bool
1464
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1465
- aws_conn_id : str
1466
- a reference to the s3 connection on Airflow. (Default: None)
1467
- verify : bool
1468
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1469
- """
1470
- ...
1471
-
1472
- @typing.overload
1473
- 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]]:
1336
+ 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]]]:
1474
1337
  """
1475
- Specifies the Conda environment for all steps of the flow.
1338
+ Specifies the Conda environment for the step.
1476
1339
 
1477
- Use `@conda_base` to set common libraries required by all
1478
- steps and use `@conda` to specify step-specific additions.
1340
+ Information in this decorator will augment any
1341
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1342
+ you can use `@conda_base` to set packages required by all
1343
+ steps and use `@conda` to specify step-specific overrides.
1479
1344
 
1480
1345
  Parameters
1481
1346
  ----------
1482
1347
  packages : Dict[str, str], default {}
1483
- Packages to use for this flow. The key is the name of the package
1348
+ Packages to use for this step. The key is the name of the package
1484
1349
  and the value is the version to use.
1485
1350
  libraries : Dict[str, str], default {}
1486
1351
  Supported for backward compatibility. When used with packages, packages will take precedence.
@@ -1488,25 +1353,31 @@ def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[s
1488
1353
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1489
1354
  that the version used will correspond to the version of the Python interpreter used to start the run.
1490
1355
  disabled : bool, default False
1491
- If set to True, disables Conda.
1356
+ If set to True, disables @conda.
1492
1357
  """
1493
1358
  ...
1494
1359
 
1495
1360
  @typing.overload
1496
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1361
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1497
1362
  ...
1498
1363
 
1499
- 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):
1364
+ @typing.overload
1365
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1366
+ ...
1367
+
1368
+ 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):
1500
1369
  """
1501
- Specifies the Conda environment for all steps of the flow.
1370
+ Specifies the Conda environment for the step.
1502
1371
 
1503
- Use `@conda_base` to set common libraries required by all
1504
- steps and use `@conda` to specify step-specific additions.
1372
+ Information in this decorator will augment any
1373
+ attributes set in the `@conda_base` flow-level decorator. Hence,
1374
+ you can use `@conda_base` to set packages required by all
1375
+ steps and use `@conda` to specify step-specific overrides.
1505
1376
 
1506
1377
  Parameters
1507
1378
  ----------
1508
1379
  packages : Dict[str, str], default {}
1509
- Packages to use for this flow. The key is the name of the package
1380
+ Packages to use for this step. The key is the name of the package
1510
1381
  and the value is the version to use.
1511
1382
  libraries : Dict[str, str], default {}
1512
1383
  Supported for backward compatibility. When used with packages, packages will take precedence.
@@ -1514,49 +1385,7 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1514
1385
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1515
1386
  that the version used will correspond to the version of the Python interpreter used to start the run.
1516
1387
  disabled : bool, default False
1517
- If set to True, disables Conda.
1518
- """
1519
- ...
1520
-
1521
- 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]]:
1522
- """
1523
- 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.
1524
- 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.
1525
-
1526
- Parameters
1527
- ----------
1528
- timeout : int
1529
- Time, in seconds before the task times out and fails. (Default: 3600)
1530
- poke_interval : int
1531
- Time in seconds that the job should wait in between each try. (Default: 60)
1532
- mode : str
1533
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1534
- exponential_backoff : bool
1535
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1536
- pool : str
1537
- the slot pool this task should run in,
1538
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1539
- soft_fail : bool
1540
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1541
- name : str
1542
- Name of the sensor on Airflow
1543
- description : str
1544
- Description of sensor in the Airflow UI
1545
- external_dag_id : str
1546
- The dag_id that contains the task you want to wait for.
1547
- external_task_ids : List[str]
1548
- The list of task_ids that you want to wait for.
1549
- If None (default value) the sensor waits for the DAG. (Default: None)
1550
- allowed_states : List[str]
1551
- Iterable of allowed states, (Default: ['success'])
1552
- failed_states : List[str]
1553
- Iterable of failed or dis-allowed states. (Default: None)
1554
- execution_delta : datetime.timedelta
1555
- time difference with the previous execution to look at,
1556
- the default is the same logical date as the current task or DAG. (Default: None)
1557
- check_existence: bool
1558
- Set to True to check if the external task exists or check if
1559
- the DAG to wait for exists. (Default: True)
1388
+ If set to True, disables @conda.
1560
1389
  """
1561
1390
  ...
1562
1391
 
@@ -1644,14 +1473,113 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1644
1473
 
1645
1474
  Parameters
1646
1475
  ----------
1647
- event : Union[str, Dict[str, Any]], optional, default None
1648
- Event dependency for this flow.
1649
- events : List[Union[str, Dict[str, Any]]], default []
1650
- Events dependency for this flow.
1651
- options : Dict[str, Any], default {}
1652
- Backend-specific configuration for tuning eventing behavior.
1653
-
1654
-
1476
+ event : Union[str, Dict[str, Any]], optional, default None
1477
+ Event dependency for this flow.
1478
+ events : List[Union[str, Dict[str, Any]]], default []
1479
+ Events dependency for this flow.
1480
+ options : Dict[str, Any], default {}
1481
+ Backend-specific configuration for tuning eventing behavior.
1482
+
1483
+
1484
+ """
1485
+ ...
1486
+
1487
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1488
+ """
1489
+ Specifies what flows belong to the same project.
1490
+
1491
+ A project-specific namespace is created for all flows that
1492
+ use the same `@project(name)`.
1493
+
1494
+ Parameters
1495
+ ----------
1496
+ name : str
1497
+ Project name. Make sure that the name is unique amongst all
1498
+ projects that use the same production scheduler. The name may
1499
+ contain only lowercase alphanumeric characters and underscores.
1500
+
1501
+
1502
+ """
1503
+ ...
1504
+
1505
+ @typing.overload
1506
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1507
+ """
1508
+ Specifies the PyPI packages for all steps of the flow.
1509
+
1510
+ Use `@pypi_base` to set common packages required by all
1511
+ steps and use `@pypi` to specify step-specific overrides.
1512
+ Parameters
1513
+ ----------
1514
+ packages : Dict[str, str], default: {}
1515
+ Packages to use for this flow. The key is the name of the package
1516
+ and the value is the version to use.
1517
+ python : str, optional, default: None
1518
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1519
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1520
+ """
1521
+ ...
1522
+
1523
+ @typing.overload
1524
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1525
+ ...
1526
+
1527
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1528
+ """
1529
+ Specifies the PyPI packages for all steps of the flow.
1530
+
1531
+ Use `@pypi_base` to set common packages required by all
1532
+ steps and use `@pypi` to specify step-specific overrides.
1533
+ Parameters
1534
+ ----------
1535
+ packages : Dict[str, str], default: {}
1536
+ Packages to use for this flow. The key is the name of the package
1537
+ and the value is the version to use.
1538
+ python : str, optional, default: None
1539
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1540
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1541
+ """
1542
+ ...
1543
+
1544
+ 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]]:
1545
+ """
1546
+ 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.
1547
+ 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.
1548
+
1549
+ Parameters
1550
+ ----------
1551
+ timeout : int
1552
+ Time, in seconds before the task times out and fails. (Default: 3600)
1553
+ poke_interval : int
1554
+ Time in seconds that the job should wait in between each try. (Default: 60)
1555
+ mode : str
1556
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1557
+ exponential_backoff : bool
1558
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1559
+ pool : str
1560
+ the slot pool this task should run in,
1561
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1562
+ soft_fail : bool
1563
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1564
+ name : str
1565
+ Name of the sensor on Airflow
1566
+ description : str
1567
+ Description of sensor in the Airflow UI
1568
+ external_dag_id : str
1569
+ The dag_id that contains the task you want to wait for.
1570
+ external_task_ids : List[str]
1571
+ The list of task_ids that you want to wait for.
1572
+ If None (default value) the sensor waits for the DAG. (Default: None)
1573
+ allowed_states : List[str]
1574
+ Iterable of allowed states, (Default: ['success'])
1575
+ failed_states : List[str]
1576
+ Iterable of failed or dis-allowed states. (Default: None)
1577
+ execution_delta : datetime.timedelta
1578
+ time difference with the previous execution to look at,
1579
+ the default is the same logical date as the current task or DAG. (Default: None)
1580
+ check_existence: bool
1581
+ Set to True to check if the external task exists or check if
1582
+ the DAG to wait for exists. (Default: True)
1655
1583
  """
1656
1584
  ...
1657
1585
 
@@ -1758,24 +1686,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1758
1686
  """
1759
1687
  ...
1760
1688
 
1761
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1762
- """
1763
- Specifies what flows belong to the same project.
1764
-
1765
- A project-specific namespace is created for all flows that
1766
- use the same `@project(name)`.
1767
-
1768
- Parameters
1769
- ----------
1770
- name : str
1771
- Project name. Make sure that the name is unique amongst all
1772
- projects that use the same production scheduler. The name may
1773
- contain only lowercase alphanumeric characters and underscores.
1774
-
1775
-
1776
- """
1777
- ...
1778
-
1779
1689
  @typing.overload
1780
1690
  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]]:
1781
1691
  """
@@ -1825,6 +1735,97 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1825
1735
  """
1826
1736
  ...
1827
1737
 
1738
+ 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]]:
1739
+ """
1740
+ 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)
1741
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1742
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1743
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1744
+ starts only after all sensors finish.
1745
+
1746
+ Parameters
1747
+ ----------
1748
+ timeout : int
1749
+ Time, in seconds before the task times out and fails. (Default: 3600)
1750
+ poke_interval : int
1751
+ Time in seconds that the job should wait in between each try. (Default: 60)
1752
+ mode : str
1753
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1754
+ exponential_backoff : bool
1755
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1756
+ pool : str
1757
+ the slot pool this task should run in,
1758
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1759
+ soft_fail : bool
1760
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1761
+ name : str
1762
+ Name of the sensor on Airflow
1763
+ description : str
1764
+ Description of sensor in the Airflow UI
1765
+ bucket_key : Union[str, List[str]]
1766
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1767
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1768
+ bucket_name : str
1769
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1770
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1771
+ wildcard_match : bool
1772
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1773
+ aws_conn_id : str
1774
+ a reference to the s3 connection on Airflow. (Default: None)
1775
+ verify : bool
1776
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1777
+ """
1778
+ ...
1779
+
1780
+ @typing.overload
1781
+ 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]]:
1782
+ """
1783
+ Specifies the Conda environment for all steps of the flow.
1784
+
1785
+ Use `@conda_base` to set common libraries required by all
1786
+ steps and use `@conda` to specify step-specific additions.
1787
+
1788
+ Parameters
1789
+ ----------
1790
+ packages : Dict[str, str], default {}
1791
+ Packages to use for this flow. The key is the name of the package
1792
+ and the value is the version to use.
1793
+ libraries : Dict[str, str], default {}
1794
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1795
+ python : str, optional, default None
1796
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1797
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1798
+ disabled : bool, default False
1799
+ If set to True, disables Conda.
1800
+ """
1801
+ ...
1802
+
1803
+ @typing.overload
1804
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1805
+ ...
1806
+
1807
+ 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):
1808
+ """
1809
+ Specifies the Conda environment for all steps of the flow.
1810
+
1811
+ Use `@conda_base` to set common libraries required by all
1812
+ steps and use `@conda` to specify step-specific additions.
1813
+
1814
+ Parameters
1815
+ ----------
1816
+ packages : Dict[str, str], default {}
1817
+ Packages to use for this flow. The key is the name of the package
1818
+ and the value is the version to use.
1819
+ libraries : Dict[str, str], default {}
1820
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1821
+ python : str, optional, default None
1822
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1823
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1824
+ disabled : bool, default False
1825
+ If set to True, disables Conda.
1826
+ """
1827
+ ...
1828
+
1828
1829
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1829
1830
  """
1830
1831
  Switch namespace to the one provided.
@@ -2775,3 +2776,201 @@ class DataArtifact(metaflow.client.core.MetaflowObject, metaclass=type):
2775
2776
  ...
2776
2777
  ...
2777
2778
 
2779
+ class Runner(object, metaclass=type):
2780
+ def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, **kwargs):
2781
+ ...
2782
+ def __enter__(self) -> metaflow.runner.metaflow_runner.Runner:
2783
+ ...
2784
+ def __aenter__(self) -> metaflow.runner.metaflow_runner.Runner:
2785
+ ...
2786
+ def _Runner__get_executing_run(self, tfp_runner_attribute, command_obj):
2787
+ ...
2788
+ def run(self, **kwargs) -> metaflow.runner.metaflow_runner.ExecutingRun:
2789
+ """
2790
+ Blocking execution of the run. This method will wait until
2791
+ the run has completed execution.
2792
+
2793
+ Parameters
2794
+ ----------
2795
+ **kwargs : Any
2796
+ Additional arguments that you would pass to `python myflow.py` after
2797
+ the `run` command, in particular, any parameters accepted by the flow.
2798
+
2799
+ Returns
2800
+ -------
2801
+ ExecutingRun
2802
+ ExecutingRun containing the results of the run.
2803
+ """
2804
+ ...
2805
+ def resume(self, **kwargs):
2806
+ """
2807
+ Blocking resume execution of the run.
2808
+ This method will wait until the resumed run has completed execution.
2809
+
2810
+ Parameters
2811
+ ----------
2812
+ **kwargs : Any
2813
+ Additional arguments that you would pass to `python ./myflow.py` after
2814
+ the `resume` command.
2815
+
2816
+ Returns
2817
+ -------
2818
+ ExecutingRun
2819
+ ExecutingRun containing the results of the resumed run.
2820
+ """
2821
+ ...
2822
+ def async_run(self, **kwargs) -> metaflow.runner.metaflow_runner.ExecutingRun:
2823
+ """
2824
+ Non-blocking execution of the run. This method will return as soon as the
2825
+ run has launched.
2826
+
2827
+ Note that this method is asynchronous and needs to be `await`ed.
2828
+
2829
+ Parameters
2830
+ ----------
2831
+ **kwargs : Any
2832
+ Additional arguments that you would pass to `python myflow.py` after
2833
+ the `run` command, in particular, any parameters accepted by the flow.
2834
+
2835
+ Returns
2836
+ -------
2837
+ ExecutingRun
2838
+ ExecutingRun representing the run that was started.
2839
+ """
2840
+ ...
2841
+ def async_resume(self, **kwargs):
2842
+ """
2843
+ Non-blocking resume execution of the run.
2844
+ This method will return as soon as the resume has launched.
2845
+
2846
+ Note that this method is asynchronous and needs to be `await`ed.
2847
+
2848
+ Parameters
2849
+ ----------
2850
+ **kwargs : Any
2851
+ Additional arguments that you would pass to `python myflow.py` after
2852
+ the `resume` command.
2853
+
2854
+ Returns
2855
+ -------
2856
+ ExecutingRun
2857
+ ExecutingRun representing the resumed run that was started.
2858
+ """
2859
+ ...
2860
+ def __exit__(self, exc_type, exc_value, traceback):
2861
+ ...
2862
+ def __aexit__(self, exc_type, exc_value, traceback):
2863
+ ...
2864
+ def cleanup(self):
2865
+ """
2866
+ Delete any temporary files created during execution.
2867
+ """
2868
+ ...
2869
+ ...
2870
+
2871
+ class NBRunner(object, metaclass=type):
2872
+ def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", **kwargs):
2873
+ ...
2874
+ def nbrun(self, **kwargs):
2875
+ """
2876
+ Blocking execution of the run. This method will wait until
2877
+ the run has completed execution.
2878
+
2879
+ Note that in contrast to `run`, this method returns a
2880
+ `metaflow.Run` object directly and calls `cleanup()` internally
2881
+ to support a common notebook pattern of executing a flow and
2882
+ retrieving its results immediately.
2883
+
2884
+ Parameters
2885
+ ----------
2886
+ **kwargs : Any
2887
+ Additional arguments that you would pass to `python myflow.py` after
2888
+ the `run` command, in particular, any parameters accepted by the flow.
2889
+
2890
+ Returns
2891
+ -------
2892
+ Run
2893
+ A `metaflow.Run` object representing the finished run.
2894
+ """
2895
+ ...
2896
+ def nbresume(self, **kwargs):
2897
+ """
2898
+ Blocking resuming of a run. This method will wait until
2899
+ the resumed run has completed execution.
2900
+
2901
+ Note that in contrast to `resume`, this method returns a
2902
+ `metaflow.Run` object directly and calls `cleanup()` internally
2903
+ to support a common notebook pattern of executing a flow and
2904
+ retrieving its results immediately.
2905
+
2906
+ Parameters
2907
+ ----------
2908
+ **kwargs : Any
2909
+ Additional arguments that you would pass to `python myflow.py` after
2910
+ the `resume` command.
2911
+
2912
+ Returns
2913
+ -------
2914
+ Run
2915
+ A `metaflow.Run` object representing the resumed run.
2916
+ """
2917
+ ...
2918
+ def run(self, **kwargs):
2919
+ """
2920
+ Runs the flow.
2921
+ """
2922
+ ...
2923
+ def resume(self, **kwargs):
2924
+ """
2925
+ Resumes the flow.
2926
+ """
2927
+ ...
2928
+ def async_run(self, **kwargs):
2929
+ """
2930
+ Non-blocking execution of the run. This method will return as soon as the
2931
+ run has launched. This method is equivalent to `Runner.async_run`.
2932
+
2933
+ Note that this method is asynchronous and needs to be `await`ed.
2934
+
2935
+
2936
+ Parameters
2937
+ ----------
2938
+ **kwargs : Any
2939
+ Additional arguments that you would pass to `python myflow.py` after
2940
+ the `run` command, in particular, any parameters accepted by the flow.
2941
+
2942
+ Returns
2943
+ -------
2944
+ ExecutingRun
2945
+ ExecutingRun representing the run that was started.
2946
+ """
2947
+ ...
2948
+ def async_resume(self, **kwargs):
2949
+ """
2950
+ Non-blocking execution of the run. This method will return as soon as the
2951
+ run has launched. This method is equivalent to `Runner.async_resume`.
2952
+
2953
+ Note that this method is asynchronous and needs to be `await`ed.
2954
+
2955
+ Parameters
2956
+ ----------
2957
+ **kwargs : Any
2958
+ Additional arguments that you would pass to `python myflow.py` after
2959
+ the `run` command, in particular, any parameters accepted by the flow.
2960
+
2961
+ Returns
2962
+ -------
2963
+ ExecutingRun
2964
+ ExecutingRun representing the run that was started.
2965
+ """
2966
+ ...
2967
+ def cleanup(self):
2968
+ """
2969
+ Delete any temporary files created during execution.
2970
+
2971
+ Call this method after using `async_run` or `async_resume`. You don't
2972
+ have to call this after `nbrun` or `nbresume`.
2973
+ """
2974
+ ...
2975
+ ...
2976
+