metaflow-stubs 2.12.27__py2.py3-none-any.whl → 2.12.29__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 (159) hide show
  1. metaflow-stubs/__init__.pyi +217 -2921
  2. metaflow-stubs/cards.pyi +19 -473
  3. metaflow-stubs/cli.pyi +17 -81
  4. metaflow-stubs/client/__init__.pyi +19 -1113
  5. metaflow-stubs/client/core.pyi +19 -159
  6. metaflow-stubs/client/filecache.pyi +8 -12
  7. metaflow-stubs/clone_util.pyi +6 -26
  8. metaflow-stubs/events.pyi +7 -6
  9. metaflow-stubs/exception.pyi +8 -6
  10. metaflow-stubs/flowspec.pyi +22 -106
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +16 -564
  13. metaflow-stubs/info_file.pyi +6 -5
  14. metaflow-stubs/metadata_provider/__init__.pyi +16 -0
  15. metaflow-stubs/metadata_provider/heartbeat.pyi +34 -0
  16. metaflow-stubs/{metadata → metadata_provider}/metadata.pyi +10 -22
  17. metaflow-stubs/metadata_provider/util.pyi +19 -0
  18. metaflow-stubs/metaflow_config.pyi +8 -11
  19. metaflow-stubs/metaflow_current.pyi +8 -7
  20. metaflow-stubs/mflog/__init__.pyi +6 -0
  21. metaflow-stubs/mflog/mflog.pyi +52 -5
  22. metaflow-stubs/multicore_utils.pyi +6 -5
  23. metaflow-stubs/parameters.pyi +13 -23
  24. metaflow-stubs/plugins/__init__.pyi +51 -163
  25. metaflow-stubs/plugins/airflow/__init__.pyi +12 -5
  26. metaflow-stubs/plugins/airflow/airflow.pyi +19 -130
  27. metaflow-stubs/plugins/airflow/airflow_cli.pyi +17 -136
  28. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +7 -26
  29. metaflow-stubs/plugins/airflow/airflow_utils.pyi +7 -6
  30. metaflow-stubs/plugins/airflow/exception.pyi +7 -11
  31. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +10 -97
  32. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +9 -30
  33. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +9 -40
  34. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +9 -40
  35. metaflow-stubs/plugins/argo/__init__.pyi +12 -5
  36. metaflow-stubs/plugins/argo/argo_client.pyi +8 -26
  37. metaflow-stubs/plugins/argo/argo_events.pyi +7 -11
  38. metaflow-stubs/plugins/argo/argo_workflows.pyi +17 -121
  39. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +22 -460
  40. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +13 -405
  41. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +65 -322
  42. metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +165 -0
  43. metaflow-stubs/plugins/aws/__init__.pyi +11 -5
  44. metaflow-stubs/plugins/aws/aws_client.pyi +6 -5
  45. metaflow-stubs/plugins/aws/aws_utils.pyi +6 -11
  46. metaflow-stubs/plugins/aws/batch/__init__.pyi +10 -5
  47. metaflow-stubs/plugins/aws/batch/batch.pyi +10 -55
  48. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +10 -31
  49. metaflow-stubs/plugins/aws/batch/batch_client.pyi +7 -11
  50. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +15 -140
  51. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +7 -5
  52. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +10 -21
  53. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +15 -5
  54. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +6 -5
  55. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +6 -5
  56. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +6 -5
  57. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +7 -5
  58. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +11 -65
  59. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +19 -175
  60. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +6 -5
  61. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +8 -37
  62. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +53 -290
  63. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +127 -0
  64. metaflow-stubs/plugins/azure/__init__.pyi +12 -7
  65. metaflow-stubs/plugins/azure/azure_credential.pyi +6 -5
  66. metaflow-stubs/plugins/azure/azure_exceptions.pyi +7 -11
  67. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +11 -24
  68. metaflow-stubs/plugins/azure/azure_utils.pyi +11 -29
  69. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +8 -23
  70. metaflow-stubs/plugins/azure/includefile_support.pyi +7 -17
  71. metaflow-stubs/plugins/cards/__init__.pyi +15 -5
  72. metaflow-stubs/plugins/cards/card_cli.pyi +22 -491
  73. metaflow-stubs/plugins/cards/card_client.pyi +14 -76
  74. metaflow-stubs/plugins/cards/card_creator.pyi +7 -10
  75. metaflow-stubs/plugins/cards/card_datastore.pyi +10 -18
  76. metaflow-stubs/plugins/cards/card_decorator.pyi +10 -126
  77. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +14 -81
  78. metaflow-stubs/plugins/cards/card_modules/basic.pyi +13 -96
  79. metaflow-stubs/plugins/cards/card_modules/card.pyi +6 -5
  80. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +12 -73
  81. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +6 -61
  82. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +6 -5
  83. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +8 -45
  84. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +7 -6
  85. metaflow-stubs/plugins/cards/card_modules/components.pyi +24 -107
  86. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +6 -5
  87. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +6 -12
  88. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +11 -88
  89. metaflow-stubs/plugins/cards/card_resolver.pyi +6 -49
  90. metaflow-stubs/plugins/cards/component_serializer.pyi +13 -63
  91. metaflow-stubs/plugins/cards/exception.pyi +7 -11
  92. metaflow-stubs/plugins/catch_decorator.pyi +9 -29
  93. metaflow-stubs/plugins/datatools/__init__.pyi +13 -392
  94. metaflow-stubs/plugins/datatools/local.pyi +7 -11
  95. metaflow-stubs/plugins/datatools/s3/__init__.pyi +19 -653
  96. metaflow-stubs/plugins/datatools/s3/s3.pyi +16 -264
  97. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +7 -10
  98. metaflow-stubs/plugins/datatools/s3/s3util.pyi +6 -11
  99. metaflow-stubs/plugins/debug_logger.pyi +7 -5
  100. metaflow-stubs/plugins/debug_monitor.pyi +7 -5
  101. metaflow-stubs/plugins/environment_decorator.pyi +7 -5
  102. metaflow-stubs/plugins/events_decorator.pyi +8 -14
  103. metaflow-stubs/plugins/frameworks/__init__.pyi +7 -5
  104. metaflow-stubs/plugins/frameworks/pytorch.pyi +8 -45
  105. metaflow-stubs/plugins/gcp/__init__.pyi +11 -7
  106. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +11 -24
  107. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +7 -11
  108. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +6 -5
  109. metaflow-stubs/plugins/gcp/gs_utils.pyi +8 -20
  110. metaflow-stubs/plugins/gcp/includefile_support.pyi +7 -17
  111. metaflow-stubs/plugins/kubernetes/__init__.pyi +13 -5
  112. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +6 -10
  113. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +9 -29
  114. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +16 -155
  115. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +9 -72
  116. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +19 -142
  117. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +8 -41
  118. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +7 -11
  119. metaflow-stubs/plugins/logs_cli.pyi +10 -9
  120. metaflow-stubs/plugins/package_cli.pyi +7 -5
  121. metaflow-stubs/plugins/parallel_decorator.pyi +11 -59
  122. metaflow-stubs/plugins/project_decorator.pyi +8 -14
  123. metaflow-stubs/plugins/pypi/__init__.pyi +12 -11
  124. metaflow-stubs/plugins/pypi/conda_decorator.pyi +8 -27
  125. metaflow-stubs/plugins/pypi/conda_environment.pyi +12 -18
  126. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +7 -5
  127. metaflow-stubs/plugins/pypi/pypi_environment.pyi +7 -39
  128. metaflow-stubs/plugins/pypi/utils.pyi +7 -11
  129. metaflow-stubs/plugins/resources_decorator.pyi +7 -5
  130. metaflow-stubs/plugins/retry_decorator.pyi +7 -11
  131. metaflow-stubs/plugins/secrets/__init__.pyi +9 -5
  132. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +8 -13
  133. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +7 -11
  134. metaflow-stubs/plugins/storage_executor.pyi +6 -11
  135. metaflow-stubs/plugins/tag_cli.pyi +14 -396
  136. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +9 -34
  137. metaflow-stubs/plugins/timeout_decorator.pyi +7 -11
  138. metaflow-stubs/procpoll.pyi +7 -5
  139. metaflow-stubs/pylint_wrapper.pyi +7 -11
  140. metaflow-stubs/runner/__init__.pyi +13 -5
  141. metaflow-stubs/runner/deployer.pyi +102 -210
  142. metaflow-stubs/runner/deployer_impl.pyi +87 -0
  143. metaflow-stubs/runner/metaflow_runner.pyi +24 -508
  144. metaflow-stubs/runner/nbdeploy.pyi +16 -60
  145. metaflow-stubs/runner/nbrun.pyi +11 -148
  146. metaflow-stubs/runner/subprocess_manager.pyi +9 -10
  147. metaflow-stubs/runner/utils.pyi +44 -9
  148. metaflow-stubs/system/__init__.pyi +9 -107
  149. metaflow-stubs/system/system_logger.pyi +6 -15
  150. metaflow-stubs/system/system_monitor.pyi +6 -16
  151. metaflow-stubs/tagging_util.pyi +6 -10
  152. metaflow-stubs/tuple_util.pyi +6 -5
  153. metaflow-stubs/version.pyi +6 -5
  154. {metaflow_stubs-2.12.27.dist-info → metaflow_stubs-2.12.29.dist-info}/METADATA +2 -2
  155. metaflow_stubs-2.12.29.dist-info/RECORD +158 -0
  156. {metaflow_stubs-2.12.27.dist-info → metaflow_stubs-2.12.29.dist-info}/WHEEL +1 -1
  157. metaflow-stubs/metadata/util.pyi +0 -18
  158. metaflow_stubs-2.12.27.dist-info/RECORD +0 -152
  159. {metaflow_stubs-2.12.27.dist-info → metaflow_stubs-2.12.29.dist-info}/top_level.txt +0 -0
@@ -1,155 +1,34 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.907372 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.661073 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
+ import metaflow
10
11
  if typing.TYPE_CHECKING:
11
- import metaflow.runner.subprocess_manager
12
- import metaflow.exception
12
+ import metaflow
13
13
  import metaflow.runner.deployer
14
+ import metaflow.plugins.argo.argo_workflows_deployer_objects
15
+ import metaflow.plugins.argo.argo_workflows_deployer
16
+ import metaflow.plugins.aws.step_functions.step_functions_deployer_objects
17
+ import metaflow.plugins.aws.step_functions.step_functions_deployer
14
18
 
15
- class MetaflowNotFound(metaflow.exception.MetaflowException, metaclass=type):
16
- ...
19
+ from ..exception import MetaflowNotFound as MetaflowNotFound
17
20
 
18
- class SubprocessManager(object, metaclass=type):
19
- """
20
- A manager for subprocesses. The subprocess manager manages one or more
21
- CommandManager objects, each of which manages an individual subprocess.
22
- """
23
- def __init__(self):
24
- ...
25
- def __aenter__(self) -> metaflow.runner.subprocess_manager.SubprocessManager:
26
- ...
27
- def __aexit__(self, exc_type, exc_value, traceback):
28
- ...
29
- def run_command(self, command: typing.List[str], env: typing.Optional[typing.Dict[str, str]] = None, cwd: typing.Optional[str] = None, show_output: bool = False) -> int:
30
- """
31
- Run a command synchronously and return its process ID.
32
-
33
- Parameters
34
- ----------
35
- command : List[str]
36
- The command to run in List form.
37
- env : Optional[Dict[str, str]], default None
38
- Environment variables to set for the subprocess; if not specified,
39
- the current enviornment variables are used.
40
- cwd : Optional[str], default None
41
- The directory to run the subprocess in; if not specified, the current
42
- directory is used.
43
- show_output : bool, default False
44
- Suppress the 'stdout' and 'stderr' to the console by default.
45
- They can be accessed later by reading the files present in the
46
- CommandManager object:
47
- - command_obj.log_files["stdout"]
48
- - command_obj.log_files["stderr"]
49
- Returns
50
- -------
51
- int
52
- The process ID of the subprocess.
53
- """
54
- ...
55
- def async_run_command(self, command: typing.List[str], env: typing.Optional[typing.Dict[str, str]] = None, cwd: typing.Optional[str] = None) -> int:
56
- """
57
- Run a command asynchronously and return its process ID.
58
-
59
- Parameters
60
- ----------
61
- command : List[str]
62
- The command to run in List form.
63
- env : Optional[Dict[str, str]], default None
64
- Environment variables to set for the subprocess; if not specified,
65
- the current enviornment variables are used.
66
- cwd : Optional[str], default None
67
- The directory to run the subprocess in; if not specified, the current
68
- directory is used.
69
-
70
- Returns
71
- -------
72
- int
73
- The process ID of the subprocess.
74
- """
75
- ...
76
- def get(self, pid: int) -> typing.Optional["CommandManager"]:
77
- """
78
- Get one of the CommandManager managed by this SubprocessManager.
79
-
80
- Parameters
81
- ----------
82
- pid : int
83
- The process ID of the subprocess (returned by run_command or async_run_command).
84
-
85
- Returns
86
- -------
87
- Optional[CommandManager]
88
- The CommandManager object for the given process ID, or None if not found.
89
- """
90
- ...
91
- def cleanup(self):
92
- """
93
- Clean up log files for all running subprocesses.
94
- """
95
- ...
96
- ...
21
+ TYPE_CHECKING: bool
97
22
 
98
- def handle_timeout(tfp_runner_attribute, command_obj: "CommandManager", file_read_timeout: int):
99
- """
100
- Handle the timeout for a running subprocess command that reads a file
101
- and raises an error with appropriate logs if a TimeoutError occurs.
102
-
103
- Parameters
104
- ----------
105
- tfp_runner_attribute : NamedTemporaryFile
106
- Temporary file that stores runner attribute data.
107
- command_obj : CommandManager
108
- Command manager object that encapsulates the running command details.
109
- file_read_timeout : int
110
- Timeout for reading the file.
111
-
112
- Returns
113
- -------
114
- str
115
- Content read from the temporary file.
116
-
117
- Raises
118
- ------
119
- RuntimeError
120
- If a TimeoutError occurs, it raises a RuntimeError with the command's
121
- stdout and stderr logs.
122
- """
123
- ...
23
+ DEFAULT_FROM_DEPLOYMENT_IMPL: str
124
24
 
125
- def get_lower_level_group(api, top_level_kwargs: typing.Dict, _type: typing.Optional[str], deployer_kwargs: typing.Dict):
126
- """
127
- Retrieve a lower-level group from the API based on the type and provided arguments.
128
-
129
- Parameters
130
- ----------
131
- api : MetaflowAPI
132
- Metaflow API instance.
133
- top_level_kwargs : Dict
134
- Top-level keyword arguments to pass to the API.
135
- _type : str
136
- Type of the deployer implementation to target.
137
- deployer_kwargs : Dict
138
- Keyword arguments specific to the deployer.
139
-
140
- Returns
141
- -------
142
- Any
143
- The lower-level group object retrieved from the API.
144
-
145
- Raises
146
- ------
147
- ValueError
148
- If the `_type` is None.
149
- """
25
+ class DeployerMeta(type, metaclass=type):
26
+ @staticmethod
27
+ def __new__(mcs, name, bases, dct):
28
+ ...
150
29
  ...
151
30
 
152
- class Deployer(object, metaclass=type):
31
+ class Deployer(object, metaclass=DeployerMeta):
153
32
  """
154
33
  Use the `Deployer` class to configure and access one of the production
155
34
  orchestrators supported by Metaflow.
@@ -176,40 +55,45 @@ class Deployer(object, metaclass=type):
176
55
  """
177
56
  def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
178
57
  ...
179
- def _Deployer__make_function(self, deployer_class):
58
+ def step_functions(self, *, name: typing.Optional[str] = None) -> "metaflow.plugins.aws.step_functions.step_functions_deployer.StepFunctionsDeployer":
180
59
  """
181
- Create a function for the given deployer class.
60
+ Deployer implementation for AWS Step Functions.
182
61
 
183
62
  Parameters
184
63
  ----------
185
- deployer_class : Type[DeployerImpl]
186
- Deployer implementation class.
64
+ name : str, optional, default None
65
+ State Machine name. The flow name is used instead if this option is not specified.
66
+ """
67
+ ...
68
+ def argo_workflows(self, *, name: typing.Optional[str] = None) -> "metaflow.plugins.argo.argo_workflows_deployer.ArgoWorkflowsDeployer":
69
+ """
70
+ Deployer implementation for Argo Workflows.
187
71
 
188
- Returns
189
- -------
190
- Callable
191
- Function that initializes and returns an instance of the deployer class.
72
+ Parameters
73
+ ----------
74
+ name : str, optional, default None
75
+ Argo workflow name. The flow name is used instead if this option is not specified.
192
76
  """
193
77
  ...
194
78
  ...
195
79
 
196
80
  class TriggeredRun(object, metaclass=type):
197
81
  """
198
- TriggeredRun class represents a run that has been triggered on a production orchestrator.
199
-
200
- Only when the `start` task starts running, the `run` object corresponding to the run
201
- becomes available.
82
+ TriggeredRun class represents a run that has been triggered on a
83
+ production orchestrator.
202
84
  """
203
- def __init__(self, deployer: DeployerImpl, content: str):
204
- ...
205
- def wait_for_run(self, timeout = None):
85
+ def wait_for_run(self, timeout: typing.Optional[int] = None):
206
86
  """
207
87
  Wait for the `run` property to become available.
208
88
 
89
+ The `run` property becomes available only after the `start` task of the triggered
90
+ flow starts running.
91
+
209
92
  Parameters
210
93
  ----------
211
- timeout : int, optional
212
- Maximum time to wait for the `run` to become available, in seconds. If None, wait indefinitely.
94
+ timeout : int, optional, default None
95
+ Maximum time to wait for the `run` to become available, in seconds. If
96
+ None, wait indefinitely.
213
97
 
214
98
  Raises
215
99
  ------
@@ -218,7 +102,7 @@ class TriggeredRun(object, metaclass=type):
218
102
  """
219
103
  ...
220
104
  @property
221
- def run(self):
105
+ def run(self) -> typing.Optional["metaflow.Run"]:
222
106
  """
223
107
  Retrieve the `Run` object for the triggered run.
224
108
 
@@ -233,77 +117,85 @@ class TriggeredRun(object, metaclass=type):
233
117
  ...
234
118
  ...
235
119
 
236
- class DeployedFlow(object, metaclass=type):
237
- """
238
- DeployedFlow class represents a flow that has been deployed.
239
-
240
- Parameters
241
- ----------
242
- deployer : DeployerImpl
243
- Instance of the deployer implementation.
244
- """
245
- def __init__(self, deployer: DeployerImpl):
120
+ class DeployedFlowMeta(type, metaclass=type):
121
+ @staticmethod
122
+ def __new__(mcs, name, bases, dct):
246
123
  ...
247
124
  ...
248
125
 
249
- class DeployerImpl(object, metaclass=type):
126
+ class DeployedFlow(object, metaclass=DeployedFlowMeta):
250
127
  """
251
- Base class for deployer implementations. Each implementation should define a TYPE
252
- class variable that matches the name of the CLI group.
128
+ DeployedFlow class represents a flow that has been deployed.
253
129
 
254
- Parameters
255
- ----------
256
- flow_file : str
257
- Path to the flow file to deploy.
258
- show_output : bool, default True
259
- Show the 'stdout' and 'stderr' to the console by default.
260
- profile : Optional[str], default None
261
- Metaflow profile to use for the deployment. If not specified, the default
262
- profile is used.
263
- env : Optional[Dict], default None
264
- Additional environment variables to set for the deployment.
265
- cwd : Optional[str], default None
266
- The directory to run the subprocess in; if not specified, the current
267
- directory is used.
268
- file_read_timeout : int, default 3600
269
- The timeout until which we try to read the deployer attribute file.
270
- **kwargs : Any
271
- Additional arguments that you would pass to `python myflow.py` before
272
- the deployment command.
130
+ This class is not meant to be instantiated directly. Instead, it is returned from
131
+ methods of `Deployer`.
273
132
  """
274
- def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
275
- ...
276
- def __enter__(self) -> DeployerImpl:
277
- ...
278
- def create(self, **kwargs) -> DeployedFlow:
133
+ @classmethod
134
+ def from_deployment(cls, *, identifier: str, metadata: typing.Optional[str] = None, impl: typing.Optional[str] = 'given by METAFLOW_DEFAULT_FROM_DEPLOYMENT_IMPL') -> typing.Union["metaflow.plugins.argo.argo_workflows_deployer_objects.ArgoWorkflowsDeployedFlow", "metaflow.plugins.aws.step_functions.step_functions_deployer_objects.StepFunctionsDeployedFlow"]:
279
135
  """
280
- Create a deployed flow using the deployer implementation.
136
+ Retrieves a `DeployedFlow` object from an identifier and optional
137
+ metadata. The `impl` parameter specifies the deployer implementation
138
+ to use (like `argo-workflows`).
139
+
140
+
281
141
 
282
142
  Parameters
283
143
  ----------
284
- **kwargs : Any
285
- Additional arguments to pass to `create` corresponding to the
286
- command line arguments of `create`
144
+ identifier : str
145
+ Deployer specific identifier for the workflow to retrieve
146
+ metadata : str, optional, default None
147
+ Optional deployer specific metadata.
148
+ impl : str, optional, default given by METAFLOW_DEFAULT_FROM_DEPLOYMENT_IMPL
149
+ The default implementation to use if not specified
150
+
151
+
287
152
 
288
153
  Returns
289
154
  -------
290
- DeployedFlow
291
- DeployedFlow object representing the deployed flow.
292
-
293
- Raises
294
- ------
295
- Exception
296
- If there is an error during deployment.
155
+ typing.Union[ForwardRef('metaflow.plugins.argo.argo_workflows_deployer_objects.ArgoWorkflowsDeployedFlow'), ForwardRef('metaflow.plugins.aws.step_functions.step_functions_deployer_objects.StepFunctionsDeployedFlow')]
156
+ A `DeployedFlow` object
297
157
  """
298
158
  ...
299
- def __exit__(self, exc_type, exc_value, traceback):
159
+ @classmethod
160
+ def from_step_functions(cls) -> "metaflow.plugins.aws.step_functions.step_functions_deployer_objects.StepFunctionsDeployedFlow":
300
161
  """
301
- Cleanup resources on exit.
162
+ This method is not currently implemented for Step Functions.
163
+
164
+ Raises
165
+ ------
166
+ NotImplementedError
167
+ This method is not implemented for Step Functions.
168
+
169
+ Parameters
170
+ ----------
171
+
172
+
173
+ Returns
174
+ -------
302
175
  """
303
176
  ...
304
- def cleanup(self):
177
+ @classmethod
178
+ def from_argo_workflows(cls, *, identifier: str, metadata: typing.Optional[str] = None) -> "metaflow.plugins.argo.argo_workflows_deployer_objects.ArgoWorkflowsDeployedFlow":
305
179
  """
306
- Cleanup resources.
180
+ Retrieves a `ArgoWorkflowsDeployedFlow` object from an identifier and optional
181
+ metadata.
182
+
183
+
184
+
185
+ Parameters
186
+ ----------
187
+ identifier : str
188
+ Deployer specific identifier for the workflow to retrieve
189
+ metadata : str, optional, default None
190
+ Optional deployer specific metadata.
191
+
192
+
193
+
194
+ Returns
195
+ -------
196
+ ArgoWorkflowsDeployedFlow
197
+ A `ArgoWorkflowsDeployedFlow` object representing the
198
+ deployed flow on argo workflows.
307
199
  """
308
200
  ...
309
201
  ...
@@ -0,0 +1,87 @@
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.582946 #
5
+ ######################################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import typing
10
+ if typing.TYPE_CHECKING:
11
+ import metaflow.runner.deployer
12
+ import typing
13
+
14
+ from .subprocess_manager import SubprocessManager as SubprocessManager
15
+ from .utils import get_lower_level_group as get_lower_level_group
16
+ from .utils import handle_timeout as handle_timeout
17
+
18
+ TYPE_CHECKING: bool
19
+
20
+ class DeployerImpl(object, metaclass=type):
21
+ """
22
+ Base class for deployer implementations. Each implementation should define a TYPE
23
+ class variable that matches the name of the CLI group.
24
+
25
+ Parameters
26
+ ----------
27
+ flow_file : str
28
+ Path to the flow file to deploy.
29
+ show_output : bool, default True
30
+ Show the 'stdout' and 'stderr' to the console by default.
31
+ profile : Optional[str], default None
32
+ Metaflow profile to use for the deployment. If not specified, the default
33
+ profile is used.
34
+ env : Optional[Dict], default None
35
+ Additional environment variables to set for the deployment.
36
+ cwd : Optional[str], default None
37
+ The directory to run the subprocess in; if not specified, the current
38
+ directory is used.
39
+ file_read_timeout : int, default 3600
40
+ The timeout until which we try to read the deployer attribute file.
41
+ **kwargs : Any
42
+ Additional arguments that you would pass to `python myflow.py` before
43
+ the deployment command.
44
+ """
45
+ def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
46
+ ...
47
+ @property
48
+ def deployer_kwargs(self) -> typing.Dict[str, typing.Any]:
49
+ ...
50
+ @staticmethod
51
+ def deployed_flow_type() -> typing.Type["metaflow.runner.deployer.DeployedFlow"]:
52
+ ...
53
+ def __enter__(self) -> "DeployerImpl":
54
+ ...
55
+ def create(self, **kwargs) -> "metaflow.runner.deployer.DeployedFlow":
56
+ """
57
+ Create a sub-class of a `DeployedFlow` depending on the deployer implementation.
58
+
59
+ Parameters
60
+ ----------
61
+ **kwargs : Any
62
+ Additional arguments to pass to `create` corresponding to the
63
+ command line arguments of `create`
64
+
65
+ Returns
66
+ -------
67
+ DeployedFlow
68
+ DeployedFlow object representing the deployed flow.
69
+
70
+ Raises
71
+ ------
72
+ Exception
73
+ If there is an error during deployment.
74
+ """
75
+ ...
76
+ def __exit__(self, exc_type, exc_value, traceback):
77
+ """
78
+ Cleanup resources on exit.
79
+ """
80
+ ...
81
+ def cleanup(self):
82
+ """
83
+ Cleanup resources.
84
+ """
85
+ ...
86
+ ...
87
+