ob-metaflow-stubs 2.11.4.1__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 (131) hide show
  1. metaflow-stubs/__init__.pyi +2753 -0
  2. metaflow-stubs/cards.pyi +266 -0
  3. metaflow-stubs/cli.pyi +137 -0
  4. metaflow-stubs/client/__init__.pyi +993 -0
  5. metaflow-stubs/client/core.pyi +1425 -0
  6. metaflow-stubs/client/filecache.pyi +87 -0
  7. metaflow-stubs/events.pyi +107 -0
  8. metaflow-stubs/exception.pyi +98 -0
  9. metaflow-stubs/flowspec.pyi +297 -0
  10. metaflow-stubs/generated_for.txt +1 -0
  11. metaflow-stubs/includefile.pyi +524 -0
  12. metaflow-stubs/metadata/metadata.pyi +377 -0
  13. metaflow-stubs/metadata/util.pyi +18 -0
  14. metaflow-stubs/metaflow_config.pyi +263 -0
  15. metaflow-stubs/metaflow_current.pyi +327 -0
  16. metaflow-stubs/mflog/mflog.pyi +22 -0
  17. metaflow-stubs/multicore_utils.pyi +62 -0
  18. metaflow-stubs/parameters.pyi +114 -0
  19. metaflow-stubs/plugins/__init__.pyi +209 -0
  20. metaflow-stubs/plugins/airflow/__init__.pyi +9 -0
  21. metaflow-stubs/plugins/airflow/airflow.pyi +179 -0
  22. metaflow-stubs/plugins/airflow/airflow_cli.pyi +90 -0
  23. metaflow-stubs/plugins/airflow/airflow_decorator.pyi +50 -0
  24. metaflow-stubs/plugins/airflow/airflow_utils.pyi +137 -0
  25. metaflow-stubs/plugins/airflow/exception.pyi +27 -0
  26. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +26 -0
  27. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +60 -0
  28. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +54 -0
  29. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +50 -0
  30. metaflow-stubs/plugins/argo/__init__.pyi +9 -0
  31. metaflow-stubs/plugins/argo/argo_client.pyi +77 -0
  32. metaflow-stubs/plugins/argo/argo_events.pyi +79 -0
  33. metaflow-stubs/plugins/argo/argo_workflows.pyi +604 -0
  34. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +180 -0
  35. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +169 -0
  36. metaflow-stubs/plugins/aws/__init__.pyi +9 -0
  37. metaflow-stubs/plugins/aws/aws_client.pyi +22 -0
  38. metaflow-stubs/plugins/aws/aws_utils.pyi +93 -0
  39. metaflow-stubs/plugins/aws/batch/__init__.pyi +9 -0
  40. metaflow-stubs/plugins/aws/batch/batch.pyi +120 -0
  41. metaflow-stubs/plugins/aws/batch/batch_cli.pyi +42 -0
  42. metaflow-stubs/plugins/aws/batch/batch_client.pyi +159 -0
  43. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +145 -0
  44. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +9 -0
  45. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +73 -0
  46. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +9 -0
  47. metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +22 -0
  48. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +27 -0
  49. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +18 -0
  50. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +17 -0
  51. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +220 -0
  52. metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +139 -0
  53. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +36 -0
  54. metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +49 -0
  55. metaflow-stubs/plugins/azure/__init__.pyi +9 -0
  56. metaflow-stubs/plugins/azure/azure_credential.pyi +28 -0
  57. metaflow-stubs/plugins/azure/azure_exceptions.pyi +28 -0
  58. metaflow-stubs/plugins/azure/azure_utils.pyi +76 -0
  59. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +52 -0
  60. metaflow-stubs/plugins/azure/includefile_support.pyi +63 -0
  61. metaflow-stubs/plugins/cards/__init__.pyi +9 -0
  62. metaflow-stubs/plugins/cards/card_cli.pyi +557 -0
  63. metaflow-stubs/plugins/cards/card_client.pyi +178 -0
  64. metaflow-stubs/plugins/cards/card_creator.pyi +26 -0
  65. metaflow-stubs/plugins/cards/card_datastore.pyi +111 -0
  66. metaflow-stubs/plugins/cards/card_decorator.pyi +133 -0
  67. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +67 -0
  68. metaflow-stubs/plugins/cards/card_modules/basic.pyi +263 -0
  69. metaflow-stubs/plugins/cards/card_modules/card.pyi +62 -0
  70. metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +78 -0
  71. metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +77 -0
  72. metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +11 -0
  73. metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +114 -0
  74. metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +75 -0
  75. metaflow-stubs/plugins/cards/card_modules/components.pyi +251 -0
  76. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +45 -0
  77. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +24 -0
  78. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +155 -0
  79. metaflow-stubs/plugins/cards/card_resolver.pyi +60 -0
  80. metaflow-stubs/plugins/cards/component_serializer.pyi +227 -0
  81. metaflow-stubs/plugins/cards/exception.pyi +71 -0
  82. metaflow-stubs/plugins/catch_decorator.pyi +58 -0
  83. metaflow-stubs/plugins/datatools/__init__.pyi +339 -0
  84. metaflow-stubs/plugins/datatools/local.pyi +82 -0
  85. metaflow-stubs/plugins/datatools/s3/__init__.pyi +589 -0
  86. metaflow-stubs/plugins/datatools/s3/s3.pyi +875 -0
  87. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +34 -0
  88. metaflow-stubs/plugins/datatools/s3/s3util.pyi +45 -0
  89. metaflow-stubs/plugins/debug_logger.pyi +25 -0
  90. metaflow-stubs/plugins/debug_monitor.pyi +25 -0
  91. metaflow-stubs/plugins/environment_decorator.pyi +17 -0
  92. metaflow-stubs/plugins/events_decorator.pyi +34 -0
  93. metaflow-stubs/plugins/frameworks/__init__.pyi +9 -0
  94. metaflow-stubs/plugins/frameworks/pytorch.pyi +42 -0
  95. metaflow-stubs/plugins/gcp/__init__.pyi +9 -0
  96. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +22 -0
  97. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +26 -0
  98. metaflow-stubs/plugins/gcp/gs_utils.pyi +38 -0
  99. metaflow-stubs/plugins/gcp/includefile_support.pyi +63 -0
  100. metaflow-stubs/plugins/kubernetes/__init__.pyi +9 -0
  101. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +127 -0
  102. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +73 -0
  103. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +62 -0
  104. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +165 -0
  105. metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +100 -0
  106. metaflow-stubs/plugins/package_cli.pyi +9 -0
  107. metaflow-stubs/plugins/parallel_decorator.pyi +34 -0
  108. metaflow-stubs/plugins/project_decorator.pyi +36 -0
  109. metaflow-stubs/plugins/pypi/__init__.pyi +18 -0
  110. metaflow-stubs/plugins/pypi/conda_decorator.pyi +59 -0
  111. metaflow-stubs/plugins/pypi/conda_environment.pyi +86 -0
  112. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +22 -0
  113. metaflow-stubs/plugins/pypi/pypi_environment.pyi +50 -0
  114. metaflow-stubs/plugins/pypi/utils.pyi +28 -0
  115. metaflow-stubs/plugins/resources_decorator.pyi +15 -0
  116. metaflow-stubs/plugins/retry_decorator.pyi +28 -0
  117. metaflow-stubs/plugins/secrets/__init__.pyi +21 -0
  118. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +30 -0
  119. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +75 -0
  120. metaflow-stubs/plugins/storage_executor.pyi +33 -0
  121. metaflow-stubs/plugins/tag_cli.pyi +370 -0
  122. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +54 -0
  123. metaflow-stubs/plugins/timeout_decorator.pyi +39 -0
  124. metaflow-stubs/procpoll.pyi +51 -0
  125. metaflow-stubs/py.typed +0 -0
  126. metaflow-stubs/pylint_wrapper.pyi +31 -0
  127. metaflow-stubs/tagging_util.pyi +52 -0
  128. ob_metaflow_stubs-2.11.4.1.dist-info/METADATA +22 -0
  129. ob_metaflow_stubs-2.11.4.1.dist-info/RECORD +131 -0
  130. ob_metaflow_stubs-2.11.4.1.dist-info/WHEEL +6 -0
  131. ob_metaflow_stubs-2.11.4.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,63 @@
1
+ ##################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.11.4.1 #
4
+ # Generated on 2024-02-28T05:30:43.943735 #
5
+ ##################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import typing
10
+ if typing.TYPE_CHECKING:
11
+ import metaflow.exception
12
+
13
+ class MetaflowException(Exception, metaclass=type):
14
+ def __init__(self, msg = "", lineno = None):
15
+ ...
16
+ def __str__(self):
17
+ ...
18
+ ...
19
+
20
+ class MetaflowInternalError(metaflow.exception.MetaflowException, metaclass=type):
21
+ ...
22
+
23
+ class Azure(object, metaclass=type):
24
+ @classmethod
25
+ def get_root_from_config(cls, echo, create_on_absent = True):
26
+ ...
27
+ def __init__(self):
28
+ ...
29
+ def __enter__(self):
30
+ ...
31
+ def __exit__(self, *args):
32
+ ...
33
+ def get(self, key = None, return_missing = False):
34
+ """
35
+ Key MUST be a fully qualified path with uri scheme. azure://<container_name>/b/l/o/b/n/a/m/e
36
+ """
37
+ ...
38
+ def put(self, key, obj, overwrite = True):
39
+ """
40
+ Key MUST be a fully qualified path. <container_name>/b/l/o/b/n/a/m/e
41
+ """
42
+ ...
43
+ def info(self, key = None, return_missing = False):
44
+ ...
45
+ ...
46
+
47
+ class AzureObject(object, metaclass=type):
48
+ def __init__(self, url, path, exists, size):
49
+ ...
50
+ @property
51
+ def path(self):
52
+ ...
53
+ @property
54
+ def url(self):
55
+ ...
56
+ @property
57
+ def exists(self):
58
+ ...
59
+ @property
60
+ def size(self):
61
+ ...
62
+ ...
63
+
@@ -0,0 +1,9 @@
1
+ ##################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.11.4.1 #
4
+ # Generated on 2024-02-28T05:30:43.929190 #
5
+ ##################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+
@@ -0,0 +1,557 @@
1
+ ##################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.11.4.1 #
4
+ # Generated on 2024-02-28T05:30:43.981821 #
5
+ ##################################################################################
6
+
7
+ from __future__ import annotations
8
+
9
+ import typing
10
+ if typing.TYPE_CHECKING:
11
+ import metaflow.exception
12
+ import metaflow.client.core
13
+ import metaflow.parameters
14
+ import datetime
15
+ import typing
16
+
17
+ class Task(metaflow.client.core.MetaflowObject, metaclass=type):
18
+ def __init__(self, *args, **kwargs):
19
+ ...
20
+ @property
21
+ def metadata(self) -> typing.List[metaflow.client.core.Metadata]:
22
+ """
23
+ Metadata events produced by this task across all attempts of the task
24
+ *except* if you selected a specific task attempt.
25
+
26
+ Note that Metadata is different from tags.
27
+
28
+ Returns
29
+ -------
30
+ List[Metadata]
31
+ Metadata produced by this task
32
+ """
33
+ ...
34
+ @property
35
+ def metadata_dict(self) -> typing.Dict[str, str]:
36
+ """
37
+ Dictionary mapping metadata names (keys) and their associated values.
38
+
39
+ Note that unlike the metadata() method, this call will only return the latest
40
+ metadata for a given name. For example, if a task executes multiple times (retries),
41
+ the same metadata name will be generated multiple times (one for each execution of the
42
+ task). The metadata() method returns all those metadata elements whereas this call will
43
+ return the metadata associated with the latest execution of the task.
44
+
45
+ Returns
46
+ -------
47
+ Dict[str, str]
48
+ Dictionary mapping metadata name with value
49
+ """
50
+ ...
51
+ @property
52
+ def index(self) -> typing.Optional[int]:
53
+ """
54
+ Returns the index of the innermost foreach loop if this task is run inside at least
55
+ one foreach.
56
+
57
+ The index is what distinguishes the various tasks inside a given step.
58
+ This call returns None if this task was not run in a foreach loop.
59
+
60
+ Returns
61
+ -------
62
+ int, optional
63
+ Index in the innermost loop for this task
64
+ """
65
+ ...
66
+ @property
67
+ def data(self) -> metaflow.client.core.MetaflowData:
68
+ """
69
+ Returns a container of data artifacts produced by this task.
70
+
71
+ You can access data produced by this task as follows:
72
+ ```
73
+ print(task.data.my_var)
74
+ ```
75
+
76
+ Returns
77
+ -------
78
+ MetaflowData
79
+ Container of all artifacts produced by this task
80
+ """
81
+ ...
82
+ @property
83
+ def artifacts(self) -> typing.NamedTuple:
84
+ """
85
+ Returns a container of DataArtifacts produced by this task.
86
+
87
+ You can access each DataArtifact by name like so:
88
+ ```
89
+ print(task.artifacts.my_var)
90
+ ```
91
+ This method differs from data() because it returns DataArtifact objects
92
+ (which contain additional metadata) as opposed to just the data.
93
+
94
+ Returns
95
+ -------
96
+ MetaflowArtifacts
97
+ Container of all DataArtifacts produced by this task
98
+ """
99
+ ...
100
+ @property
101
+ def successful(self) -> bool:
102
+ """
103
+ Indicates whether or not the task completed successfully.
104
+
105
+ This information is always about the latest task to have completed (in case
106
+ of retries).
107
+
108
+ Returns
109
+ -------
110
+ bool
111
+ True if the task completed successfully and False otherwise
112
+ """
113
+ ...
114
+ @property
115
+ def finished(self) -> bool:
116
+ """
117
+ Indicates whether or not the task completed.
118
+
119
+ This information is always about the latest task to have completed (in case
120
+ of retries).
121
+
122
+ Returns
123
+ -------
124
+ bool
125
+ True if the task completed and False otherwise
126
+ """
127
+ ...
128
+ @property
129
+ def exception(self) -> typing.Optional[typing.Any]:
130
+ """
131
+ Returns the exception that caused the task to fail, if any.
132
+
133
+ This information is always about the latest task to have completed (in case
134
+ of retries). If successful() returns False and finished() returns True,
135
+ this method can help determine what went wrong.
136
+
137
+ Returns
138
+ -------
139
+ object
140
+ Exception raised by the task or None if not applicable
141
+ """
142
+ ...
143
+ @property
144
+ def finished_at(self) -> typing.Optional[datetime.datetime]:
145
+ """
146
+ Returns the datetime object of when the task finished (successfully or not).
147
+
148
+ This information is always about the latest task to have completed (in case
149
+ of retries). This call will return None if the task is not finished.
150
+
151
+ Returns
152
+ -------
153
+ datetime
154
+ Datetime of when the task finished
155
+ """
156
+ ...
157
+ @property
158
+ def runtime_name(self) -> typing.Optional[str]:
159
+ """
160
+ Returns the name of the runtime this task executed on.
161
+
162
+
163
+ Returns
164
+ -------
165
+ str
166
+ Name of the runtime this task executed on
167
+ """
168
+ ...
169
+ @property
170
+ def stdout(self) -> str:
171
+ """
172
+ Returns the full standard out of this task.
173
+
174
+ If you specify a specific attempt for this task, it will return the
175
+ standard out for that attempt. If you do not specify an attempt,
176
+ this will return the current standard out for the latest *started*
177
+ attempt of the task. In both cases, multiple calls to this
178
+ method will return the most up-to-date log (so if an attempt is not
179
+ done, each call will fetch the latest log).
180
+
181
+ Returns
182
+ -------
183
+ str
184
+ Standard output of this task
185
+ """
186
+ ...
187
+ @property
188
+ def stdout_size(self) -> int:
189
+ """
190
+ Returns the size of the stdout log of this task.
191
+
192
+ Similar to `stdout`, the size returned is the latest size of the log
193
+ (so for a running attempt, this value will increase as the task produces
194
+ more output).
195
+
196
+ Returns
197
+ -------
198
+ int
199
+ Size of the stdout log content (in bytes)
200
+ """
201
+ ...
202
+ @property
203
+ def stderr(self) -> str:
204
+ """
205
+ Returns the full standard error of this task.
206
+
207
+ If you specify a specific attempt for this task, it will return the
208
+ standard error for that attempt. If you do not specify an attempt,
209
+ this will return the current standard error for the latest *started*
210
+ attempt. In both cases, multiple calls to this
211
+ method will return the most up-to-date log (so if an attempt is not
212
+ done, each call will fetch the latest log).
213
+
214
+ Returns
215
+ -------
216
+ str
217
+ Standard error of this task
218
+ """
219
+ ...
220
+ @property
221
+ def stderr_size(self) -> int:
222
+ """
223
+ Returns the size of the stderr log of this task.
224
+
225
+ Similar to `stderr`, the size returned is the latest size of the log
226
+ (so for a running attempt, this value will increase as the task produces
227
+ more output).
228
+
229
+ Returns
230
+ -------
231
+ int
232
+ Size of the stderr log content (in bytes)
233
+ """
234
+ ...
235
+ @property
236
+ def current_attempt(self) -> int:
237
+ """
238
+ Get the relevant attempt for this Task.
239
+
240
+ Returns the specific attempt used when
241
+ initializing the instance, or the latest *started* attempt for the Task.
242
+
243
+ Returns
244
+ -------
245
+ int
246
+ attempt id for this task object
247
+ """
248
+ ...
249
+ @property
250
+ def code(self) -> typing.Optional[metaflow.client.core.MetaflowCode]:
251
+ """
252
+ Returns the MetaflowCode object for this task, if present.
253
+
254
+ Not all tasks save their code so this call may return None in those cases.
255
+
256
+ Returns
257
+ -------
258
+ MetaflowCode
259
+ Code package for this task
260
+ """
261
+ ...
262
+ @property
263
+ def environment_info(self) -> typing.Dict[str, typing.Any]:
264
+ """
265
+ Returns information about the environment that was used to execute this task. As an
266
+ example, if the Conda environment is selected, this will return information about the
267
+ dependencies that were used in the environment.
268
+
269
+ This environment information is only available for tasks that have a code package.
270
+
271
+ Returns
272
+ -------
273
+ Dict
274
+ Dictionary describing the environment
275
+ """
276
+ ...
277
+ def loglines(self, stream: str, as_unicode: bool = True, meta_dict: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Iterator[typing.Tuple[datetime.datetime, str]]:
278
+ """
279
+ Return an iterator over (utc_timestamp, logline) tuples.
280
+
281
+ Parameters
282
+ ----------
283
+ stream : str
284
+ Either 'stdout' or 'stderr'.
285
+ as_unicode : bool, default: True
286
+ If as_unicode=False, each logline is returned as a byte object. Otherwise,
287
+ it is returned as a (unicode) string.
288
+
289
+ Yields
290
+ ------
291
+ Tuple[datetime, str]
292
+ Tuple of timestamp, logline pairs.
293
+ """
294
+ ...
295
+ def __iter__(self) -> typing.Iterator[metaflow.client.core.DataArtifact]:
296
+ """
297
+ Iterate over all children DataArtifact of this Task
298
+
299
+ Yields
300
+ ------
301
+ DataArtifact
302
+ A DataArtifact in this Step
303
+ """
304
+ ...
305
+ def __getitem__(self, name: str) -> metaflow.client.core.DataArtifact:
306
+ """
307
+ Returns the DataArtifact object with the artifact name 'name'
308
+
309
+ Parameters
310
+ ----------
311
+ name : str
312
+ Data artifact name
313
+
314
+ Returns
315
+ -------
316
+ DataArtifact
317
+ DataArtifact for this artifact name in this task
318
+
319
+ Raises
320
+ ------
321
+ KeyError
322
+ If the name does not identify a valid DataArtifact object
323
+ """
324
+ ...
325
+ def __getstate__(self):
326
+ ...
327
+ def __setstate__(self, state):
328
+ ...
329
+ ...
330
+
331
+ JSONType: metaflow.parameters.JSONTypeClass
332
+
333
+ def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
334
+ """
335
+ Switch namespace to the one provided.
336
+
337
+ This call has a global effect. No objects outside this namespace
338
+ will be accessible. To access all objects regardless of namespaces,
339
+ pass None to this call.
340
+
341
+ Parameters
342
+ ----------
343
+ ns : str, optional
344
+ Namespace to switch to or None to ignore namespaces.
345
+
346
+ Returns
347
+ -------
348
+ str, optional
349
+ Namespace set (result of get_namespace()).
350
+ """
351
+ ...
352
+
353
+ class CommandException(metaflow.exception.MetaflowException, metaclass=type):
354
+ ...
355
+
356
+ class MetaflowNotFound(metaflow.exception.MetaflowException, metaclass=type):
357
+ ...
358
+
359
+ class MetaflowNamespaceMismatch(metaflow.exception.MetaflowException, metaclass=type):
360
+ def __init__(self, namespace):
361
+ ...
362
+ ...
363
+
364
+ class CardDatastore(object, metaclass=type):
365
+ @classmethod
366
+ def get_storage_root(cls, storage_type):
367
+ ...
368
+ def __init__(self, flow_datastore, pathspec = None):
369
+ ...
370
+ @classmethod
371
+ def get_card_location(cls, base_path, card_name, uuid, card_id = None, suffix = "html"):
372
+ ...
373
+ @staticmethod
374
+ def info_from_path(path, suffix = "html"):
375
+ """
376
+ Args:
377
+ path (str): The path to the card
378
+
379
+ Raises:
380
+ Exception: When the card_path is invalid
381
+
382
+ Returns:
383
+ CardInfo
384
+ """
385
+ ...
386
+ def save_data(self, uuid, card_type, json_data, card_id = None):
387
+ ...
388
+ def save_card(self, uuid, card_type, card_html, card_id = None, overwrite = True):
389
+ ...
390
+ def create_full_path(self, card_path):
391
+ ...
392
+ def get_card_names(self, card_paths):
393
+ ...
394
+ def get_card_html(self, path):
395
+ ...
396
+ def get_card_data(self, path):
397
+ ...
398
+ def cache_locally(self, path, save_path = None):
399
+ """
400
+ Saves the data present in the `path` the `metaflow_card_cache` directory or to the `save_path`.
401
+ """
402
+ ...
403
+ def extract_data_paths(self, card_type = None, card_hash = None, card_id = None):
404
+ ...
405
+ def extract_card_paths(self, card_type = None, card_hash = None, card_id = None):
406
+ ...
407
+ ...
408
+
409
+ NUM_SHORT_HASH_CHARS: int
410
+
411
+ class CardClassFoundException(metaflow.exception.MetaflowException, metaclass=type):
412
+ def __init__(self, card_name):
413
+ ...
414
+ ...
415
+
416
+ class IncorrectCardArgsException(metaflow.exception.MetaflowException, metaclass=type):
417
+ def __init__(self, card_type, args):
418
+ ...
419
+ ...
420
+
421
+ class UnrenderableCardException(metaflow.exception.MetaflowException, metaclass=type):
422
+ def __init__(self, card_type, args):
423
+ ...
424
+ ...
425
+
426
+ class CardNotPresentException(metaflow.exception.MetaflowException, metaclass=type):
427
+ def __init__(self, pathspec, card_type = None, card_hash = None, card_id = None):
428
+ ...
429
+ ...
430
+
431
+ class TaskNotFoundException(metaflow.exception.MetaflowException, metaclass=type):
432
+ def __init__(self, pathspec_query, resolved_from, run_id = None):
433
+ ...
434
+ ...
435
+
436
+ def resolve_paths_from_task(flow_datastore, pathspec = None, type = None, hash = None, card_id = None):
437
+ ...
438
+
439
+ def resumed_info(task):
440
+ ...
441
+
442
+ class CardRenderInfo(tuple, metaclass=type):
443
+ @staticmethod
444
+ def __new__(_cls, mode, is_implemented, data, timed_out, timeout_stack_trace):
445
+ """
446
+ Create new instance of CardRenderInfo(mode, is_implemented, data, timed_out, timeout_stack_trace)
447
+ """
448
+ ...
449
+ def __repr__(self):
450
+ """
451
+ Return a nicely formatted representation string
452
+ """
453
+ ...
454
+ def __getnewargs__(self):
455
+ """
456
+ Return self as a plain tuple. Used by copy and pickle.
457
+ """
458
+ ...
459
+ ...
460
+
461
+ def open_in_browser(card_path):
462
+ ...
463
+
464
+ def resolve_task_from_pathspec(flow_name, pathspec):
465
+ """
466
+ resolves a task object for the pathspec query on the CLI.
467
+ Args:
468
+ flow_name : (str) : name of flow
469
+ pathspec (str) : can be `stepname` / `runid/stepname` / `runid/stepname/taskid`
470
+
471
+ Returns:
472
+ metaflow.Task | None
473
+ """
474
+ ...
475
+
476
+ def resolve_card(ctx, pathspec, follow_resumed = True, hash = None, type = None, card_id = None, no_echo = False):
477
+ """
478
+ Resolves the card path for a query.
479
+
480
+ Args:
481
+ ctx: click context object
482
+ pathspec: pathspec can be `stepname` or `runid/stepname` or `runid/stepname/taskid`
483
+ hash (optional): This is to specifically resolve the card via the hash. This is useful when there may be many card with same id or type for a pathspec.
484
+ type : type of card
485
+ card_id : `id` given to card
486
+ no_echo : if set to `True` then supress logs about pathspec resolution.
487
+ Raises:
488
+ CardNotPresentException: No card could be found for the pathspec
489
+
490
+ Returns:
491
+ (card_paths, card_datastore, taskpathspec) : Tuple[List[str], CardDatastore, str]
492
+ """
493
+ ...
494
+
495
+ def timeout(time):
496
+ ...
497
+
498
+ def raise_timeout(signum, frame):
499
+ ...
500
+
501
+ def list_available_cards(ctx, pathspec, card_paths, card_datastore, command = "view", show_list_as_json = False, list_many = False, file = None):
502
+ ...
503
+
504
+ def make_command(script_name, taskspec, command = "get", hash = None):
505
+ ...
506
+
507
+ def list_many_cards(ctx, type = None, hash = None, card_id = None, follow_resumed = None, as_json = None, file = None):
508
+ ...
509
+
510
+ def card_read_options_and_arguments(func):
511
+ ...
512
+
513
+ def update_card(mf_card, mode, task, data, timeout_value = None):
514
+ """
515
+ This method will be responsible for creating a card/data-update based on the `mode`.
516
+ There are three possible modes taken by this function.
517
+ - render :
518
+ - This will render the "final" card.
519
+ - This mode is passed at task completion.
520
+ - Setting this mode will call the `render` method of a MetaflowCard.
521
+ - It will result in the creation of an HTML page.
522
+ - render_runtime:
523
+ - Setting this mode will render a card during task "runtime".
524
+ - Setting this mode will call the `render_runtime` method of a MetaflowCard.
525
+ - It will result in the creation of an HTML page.
526
+ - refresh:
527
+ - Setting this mode will refresh the data update for a card.
528
+ - We support this mode because rendering a full card can be an expensive operation, but shipping tiny data updates can be cheap.
529
+ - Setting this mode will call the `refresh` method of a MetaflowCard.
530
+ - It will result in the creation of a JSON object.
531
+
532
+ Parameters
533
+ ----------
534
+ mf_card : MetaflowCard
535
+ MetaflowCard object which will be used to render the card.
536
+ mode : str
537
+ Mode of rendering the card.
538
+ task : Task
539
+ Task object which will be passed to render the card.
540
+ data : dict
541
+ object created and passed down from `current.card._get_latest_data` method.
542
+ For more information on this object's schema have a look at `current.card._get_latest_data` method.
543
+ timeout_value : int
544
+ Timeout value for rendering the card.
545
+
546
+ Returns
547
+ -------
548
+ CardRenderInfo
549
+ - NamedTuple which will contain:
550
+ - `mode`: The mode of rendering the card.
551
+ - `is_implemented`: whether the function was implemented or not.
552
+ - `data` : output from rendering the card (Can be string/dict)
553
+ - `timed_out` : whether the function timed out or not.
554
+ - `timeout_stack_trace` : stack trace of the function if it timed out.
555
+ """
556
+ ...
557
+