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
metaflow-stubs/cards.pyi CHANGED
@@ -1,478 +1,24 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.898655 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.567231 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- import typing
10
- if typing.TYPE_CHECKING:
11
- import metaflow.plugins.cards.card_client
12
- import metaflow.plugins.cards.card_modules.card
13
- import metaflow.plugins.cards.card_modules.basic
14
- import metaflow
15
- import typing
16
- import metaflow.plugins.cards.card_modules.components
17
9
 
18
- def get_cards(task: typing.Union[str, "metaflow.Task"], id: typing.Optional[str] = None, type: typing.Optional[str] = None, follow_resumed: bool = True) -> metaflow.plugins.cards.card_client.CardContainer:
19
- """
20
- Get cards related to a `Task`.
21
-
22
- Note that `get_cards` resolves the cards contained by the task, but it doesn't actually
23
- retrieve them from the datastore. Actual card contents are retrieved lazily either when
24
- the card is rendered in a notebook to when you call `Card.get`. This means that
25
- `get_cards` is a fast call even when individual cards contain a lot of data.
26
-
27
- Parameters
28
- ----------
29
- task : Union[str, `Task`]
30
- A `Task` object or pathspec `{flow_name}/{run_id}/{step_name}/{task_id}` that
31
- uniquely identifies a task.
32
- id : str, optional, default None
33
- The ID of card to retrieve if multiple cards are present.
34
- type : str, optional, default None
35
- The type of card to retrieve if multiple cards are present.
36
- follow_resumed : bool, default True
37
- If the task has been resumed, then setting this flag will resolve the card for
38
- the origin task.
39
-
40
- Returns
41
- -------
42
- CardContainer
43
- A list-like object that holds `Card` objects.
44
- """
45
- ...
46
-
47
- class MetaflowCardComponent(object, metaclass=type):
48
- @property
49
- def component_id(self):
50
- ...
51
- @component_id.setter
52
- def component_id(self, value):
53
- ...
54
- def update(self, *args, **kwargs):
55
- """
56
- #FIXME document
57
- """
58
- ...
59
- def render(self):
60
- """
61
- `render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard`
62
- """
63
- ...
64
- ...
65
-
66
- class MetaflowCard(object, metaclass=type):
67
- """
68
- Metaflow cards derive from this base class.
69
-
70
- Subclasses of this class are called *card types*. The desired card
71
- type `T` is defined in the `@card` decorator as `@card(type=T)`.
72
-
73
- After a task with `@card(type=T, options=S)` finishes executing, Metaflow instantiates
74
- a subclass `C` of `MetaflowCard` that has its `type` attribute set to `T`, i.e. `C.type=T`.
75
- The constructor is given the options dictionary `S` that contains arbitrary
76
- JSON-encodable data that is passed to the instance, parametrizing the card. The subclass
77
- may override the constructor to capture and process the options.
78
-
79
- The subclass needs to implement a `render(task)` method that produces the card
80
- contents in HTML, given the finished task that is represented by a `Task` object.
81
-
82
- Attributes
83
- ----------
84
- type : str
85
- Card type string. Note that this should be a globally unique name, similar to a
86
- Python package name, to avoid name clashes between different custom cards.
87
-
88
- Parameters
89
- ----------
90
- options : Dict
91
- JSON-encodable dictionary containing user-definable options for the class.
92
- """
93
- def __init__(self, options = {}, components = [], graph = None):
94
- ...
95
- def render(self, task: "metaflow.Task") -> str:
96
- """
97
- Produce custom card contents in HTML.
98
-
99
- Subclasses override this method to customize the card contents.
100
-
101
- Parameters
102
- ----------
103
- task : Task
104
- A `Task` object that allows you to access data from the finished task and tasks
105
- preceding it.
106
-
107
- Returns
108
- -------
109
- str
110
- Card contents as an HTML string.
111
- """
112
- ...
113
- def render_runtime(self, task, data):
114
- ...
115
- def refresh(self, task, data):
116
- ...
117
- def reload_content_token(self, task, data):
118
- ...
119
- ...
120
-
121
- class Artifact(metaflow.plugins.cards.card_modules.components.UserComponent, metaclass=type):
122
- """
123
- A pretty-printed version of any Python object.
124
-
125
- Large objects are truncated using Python's built-in [`reprlib`](https://docs.python.org/3/library/reprlib.html).
126
-
127
- Example:
128
- ```
129
- from datetime import datetime
130
- current.card.append(Artifact({'now': datetime.utcnow()}))
131
- ```
132
-
133
- Parameters
134
- ----------
135
- artifact : object
136
- Any Python object.
137
- name : str, optional
138
- Optional label for the object.
139
- compressed : bool, default: True
140
- Use a truncated representation.
141
- """
142
- def update(self, artifact):
143
- ...
144
- def __init__(self, artifact: typing.Any, name: typing.Optional[str] = None, compressed: bool = True):
145
- ...
146
- def render(self, *args, **kwargs):
147
- ...
148
- ...
149
-
150
- class Table(metaflow.plugins.cards.card_modules.components.UserComponent, metaclass=type):
151
- """
152
- A table.
153
-
154
- The contents of the table can be text or numerical data, a Pandas dataframe,
155
- or other card components: `Artifact`, `Image`, `Markdown` objects.
156
-
157
- Example: Text and artifacts
158
- ```
159
- from metaflow.cards import Table, Artifact
160
- current.card.append(
161
- Table([
162
- ['first row', Artifact({'a': 2})],
163
- ['second row', Artifact(3)]
164
- ])
165
- )
166
- ```
167
-
168
- Example: Table from a Pandas dataframe
169
- ```
170
- from metaflow.cards import Table
171
- import pandas as pd
172
- import numpy as np
173
- current.card.append(
174
- Table.from_dataframe(
175
- pd.DataFrame(
176
- np.random.randint(0, 100, size=(15, 4)),
177
- columns=list("ABCD")
178
- )
179
- )
180
- )
181
- ```
182
-
183
- Parameters
184
- ----------
185
- data : List[List[str or MetaflowCardComponent]], optional
186
- List (rows) of lists (columns). Each item can be a string or a `MetaflowCardComponent`.
187
- headers : List[str], optional
188
- Optional header row for the table.
189
- """
190
- def update(self, *args, **kwargs):
191
- ...
192
- def __init__(self, data: typing.Optional[typing.List[typing.List[typing.Union[str, metaflow.plugins.cards.card_modules.card.MetaflowCardComponent]]]] = None, headers: typing.Optional[typing.List[str]] = None, disable_updates: bool = False):
193
- ...
194
- @classmethod
195
- def from_dataframe(cls, dataframe = None, truncate: bool = True):
196
- """
197
- Create a `Table` based on a Pandas dataframe.
198
-
199
- Parameters
200
- ----------
201
- dataframe : Optional[pandas.DataFrame]
202
- Pandas dataframe.
203
- truncate : bool, default: True
204
- Truncate large dataframe instead of showing all rows (default: True).
205
- """
206
- ...
207
- def render(self, *args, **kwargs):
208
- ...
209
- ...
210
-
211
- class Image(metaflow.plugins.cards.card_modules.components.UserComponent, metaclass=type):
212
- """
213
- An image.
214
-
215
- `Images can be created directly from PNG/JPG/GIF `bytes`, `PIL.Image`s,
216
- or Matplotlib figures. Note that the image data is embedded in the card,
217
- so no external files are required to show the image.
218
-
219
- Example: Create an `Image` from bytes:
220
- ```
221
- current.card.append(
222
- Image(
223
- requests.get("https://www.gif-vif.com/hacker-cat.gif").content,
224
- "Image From Bytes"
225
- )
226
- )
227
- ```
228
-
229
- Example: Create an `Image` from a Matplotlib figure
230
- ```
231
- import pandas as pd
232
- import numpy as np
233
- current.card.append(
234
- Image.from_matplotlib(
235
- pandas.DataFrame(
236
- np.random.randint(0, 100, size=(15, 4)),
237
- columns=list("ABCD"),
238
- ).plot()
239
- )
240
- )
241
- ```
242
-
243
- Example: Create an `Image` from a [PIL](https://pillow.readthedocs.io/) Image
244
- ```
245
- from PIL import Image as PILImage
246
- current.card.append(
247
- Image.from_pil_image(
248
- PILImage.fromarray(np.random.randn(1024, 768), "RGB"),
249
- "From PIL Image"
250
- )
251
- )
252
- ```
253
-
254
- Parameters
255
- ----------
256
- src : bytes
257
- The image data in `bytes`.
258
- label : str
259
- Optional label for the image.
260
- """
261
- @staticmethod
262
- def render_fail_headline(msg):
263
- ...
264
- def __init__(self, src = None, label = None, disable_updates: bool = True):
265
- ...
266
- @classmethod
267
- def from_pil_image(cls, pilimage, label: typing.Optional[str] = None, disable_updates: bool = False):
268
- """
269
- Create an `Image` from a PIL image.
270
-
271
- Parameters
272
- ----------
273
- pilimage : PIL.Image
274
- a PIL image object.
275
- label : str, optional
276
- Optional label for the image.
277
- """
278
- ...
279
- @classmethod
280
- def from_matplotlib(cls, plot, label: typing.Optional[str] = None, disable_updates: bool = False):
281
- """
282
- Create an `Image` from a Matplotlib plot.
283
-
284
- Parameters
285
- ----------
286
- plot : matplotlib.figure.Figure or matplotlib.axes.Axes or matplotlib.axes._subplots.AxesSubplot
287
- a PIL axes (plot) object.
288
- label : str, optional
289
- Optional label for the image.
290
- """
291
- ...
292
- def render(self, *args, **kwargs):
293
- ...
294
- def update(self, image, label = None):
295
- """
296
- Update the image.
297
-
298
- Parameters
299
- ----------
300
- image : PIL.Image or matplotlib.figure.Figure or matplotlib.axes.Axes or matplotlib.axes._subplots.AxesSubplot or bytes or str
301
- The updated image object
302
- label : str, optional
303
- Optional label for the image.
304
- """
305
- ...
306
- ...
307
-
308
- class Error(metaflow.plugins.cards.card_modules.components.UserComponent, metaclass=type):
309
- """
310
- This class helps visualize Error's on the `MetaflowCard`. It can help catch and print stack traces to errors that happen in `@step` code.
311
-
312
- ### Parameters
313
- - `exception` (Exception) : The `Exception` to visualize. This value will be `repr`'d before passed down to `MetaflowCard`
314
- - `title` (str) : The title that will appear over the visualized `Exception`.
315
-
316
- ### Usage
317
- ```python
318
- @card
319
- @step
320
- def my_step(self):
321
- from metaflow.cards import Error
322
- from metaflow import current
323
- try:
324
- ...
325
- ...
326
- except Exception as e:
327
- current.card.append(
328
- Error(e,"Something misbehaved")
329
- )
330
- ...
331
- ```
332
- """
333
- def __init__(self, exception, title = None):
334
- ...
335
- def render(self, *args, **kwargs):
336
- ...
337
- ...
338
-
339
- class Markdown(metaflow.plugins.cards.card_modules.components.UserComponent, metaclass=type):
340
- """
341
- A block of text formatted in Markdown.
342
-
343
- Example:
344
- ```
345
- current.card.append(
346
- Markdown("# This is a header appended from `@step` code")
347
- )
348
- ```
349
-
350
- Parameters
351
- ----------
352
- text : str
353
- Text formatted in Markdown.
354
- """
355
- def update(self, text = None):
356
- ...
357
- def __init__(self, text = None):
358
- ...
359
- def render(self, *args, **kwargs):
360
- ...
361
- ...
362
-
363
- class VegaChart(metaflow.plugins.cards.card_modules.components.UserComponent, metaclass=type):
364
- def __init__(self, spec: dict, show_controls: bool = False):
365
- ...
366
- def update(self, spec = None):
367
- """
368
- Update the chart.
369
-
370
- Parameters
371
- ----------
372
- spec : dict or altair.Chart
373
- The updated chart spec or an altair Chart Object.
374
- """
375
- ...
376
- @classmethod
377
- def from_altair_chart(cls, altair_chart):
378
- ...
379
- def render(self, *args, **kwargs):
380
- ...
381
- ...
382
-
383
- class ProgressBar(metaflow.plugins.cards.card_modules.components.UserComponent, metaclass=type):
384
- """
385
- A Progress bar for tracking progress of any task.
386
-
387
- Example:
388
- ```
389
- progress_bar = ProgressBar(
390
- max=100,
391
- label="Progress Bar",
392
- value=0,
393
- unit="%",
394
- metadata="0.1 items/s"
395
- )
396
- current.card.append(
397
- progress_bar
398
- )
399
- for i in range(100):
400
- progress_bar.update(i, metadata="%s items/s" % i)
401
-
402
- ```
403
-
404
- Parameters
405
- ----------
406
- max : int
407
- The maximum value of the progress bar.
408
- label : str, optional
409
- Optional label for the progress bar.
410
- value : int, optional
411
- Optional initial value of the progress bar.
412
- unit : str, optional
413
- Optional unit for the progress bar.
414
- metadata : str, optional
415
- Optional additional information to show on the progress bar.
416
- """
417
- def __init__(self, max: int = 100, label: str = None, value: int = 0, unit: str = None, metadata: str = None):
418
- ...
419
- def update(self, new_value: int, metadata: str = None):
420
- ...
421
- def render(self, *args, **kwargs):
422
- ...
423
- ...
424
-
425
- class DefaultCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
426
- def __init__(self, options = {"only_repr": True}, components = [], graph = None):
427
- ...
428
- def render(self, task, runtime = False):
429
- ...
430
- def render_runtime(self, task, data):
431
- ...
432
- def refresh(self, task, data):
433
- ...
434
- def reload_content_token(self, task, data):
435
- """
436
- The reload token will change when the component array has changed in the Metaflow card.
437
- The change in the component array is signified by the change in the component_update_ts.
438
- """
439
- ...
440
- ...
441
-
442
- class PageComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
443
- def __init__(self, title = None, subtitle = None, contents = []):
444
- ...
445
- def render(self):
446
- ...
447
- ...
448
-
449
- class ErrorCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
450
- def __init__(self, options = {}, components = [], graph = None):
451
- ...
452
- def reload_content_token(self, task, data):
453
- """
454
- The reload token will change when the component array has changed in the Metaflow card.
455
- The change in the component array is signified by the change in the component_update_ts.
456
- """
457
- ...
458
- def render(self, task, stack_trace = None):
459
- ...
460
- ...
461
-
462
- class BlankCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
463
- def __init__(self, options = {"title": ""}, components = [], graph = None):
464
- ...
465
- def render(self, task, components = [], runtime = False):
466
- ...
467
- def render_runtime(self, task, data):
468
- ...
469
- def refresh(self, task, data):
470
- ...
471
- def reload_content_token(self, task, data):
472
- """
473
- The reload token will change when the component array has changed in the Metaflow card.
474
- The change in the component array is signified by the change in the component_update_ts.
475
- """
476
- ...
477
- ...
10
+ from .plugins.cards.card_client import get_cards as get_cards
11
+ from .plugins.cards.card_modules.card import MetaflowCardComponent as MetaflowCardComponent
12
+ from .plugins.cards.card_modules.card import MetaflowCard as MetaflowCard
13
+ from .plugins.cards.card_modules.components import Artifact as Artifact
14
+ from .plugins.cards.card_modules.components import Table as Table
15
+ from .plugins.cards.card_modules.components import Image as Image
16
+ from .plugins.cards.card_modules.components import Error as Error
17
+ from .plugins.cards.card_modules.components import Markdown as Markdown
18
+ from .plugins.cards.card_modules.components import VegaChart as VegaChart
19
+ from .plugins.cards.card_modules.components import ProgressBar as ProgressBar
20
+ from .plugins.cards.card_modules.basic import DefaultCard as DefaultCard
21
+ from .plugins.cards.card_modules.basic import PageComponent as PageComponent
22
+ from .plugins.cards.card_modules.basic import ErrorCard as ErrorCard
23
+ from .plugins.cards.card_modules.basic import BlankCard as BlankCard
478
24
 
metaflow-stubs/cli.pyi CHANGED
@@ -1,65 +1,23 @@
1
- ##################################################################################
2
- # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.27 #
4
- # Generated on 2024-10-24T19:27:17.911466 #
5
- ##################################################################################
1
+ ######################################################################################################
2
+ # Auto-generated Metaflow stub file #
3
+ # MF version: 2.12.29 #
4
+ # Generated on 2024-11-07T22:19:34.578087 #
5
+ ######################################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
- import typing
10
- if typing.TYPE_CHECKING:
11
- import metaflow.exception
12
- import metaflow.metaflow_current
13
-
14
- def get_metadata() -> str:
15
- """
16
- Returns the current Metadata provider.
17
-
18
- If this is not set explicitly using `metadata`, the default value is
19
- determined through the Metaflow configuration. You can use this call to
20
- check that your configuration is set up properly.
21
-
22
- If multiple configuration profiles are present, this call returns the one
23
- selected through the `METAFLOW_PROFILE` environment variable.
24
-
25
- Returns
26
- -------
27
- str
28
- Information about the Metadata provider currently selected. This information typically
29
- returns provider specific information (like URL for remote providers or local paths for
30
- local providers).
31
- """
32
- ...
33
-
34
- def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
35
- """
36
- Switch namespace to the one provided.
37
-
38
- This call has a global effect. No objects outside this namespace
39
- will be accessible. To access all objects regardless of namespaces,
40
- pass None to this call.
41
-
42
- Parameters
43
- ----------
44
- ns : str, optional
45
- Namespace to switch to or None to ignore namespaces.
46
-
47
- Returns
48
- -------
49
- str, optional
50
- Namespace set (result of get_namespace()).
51
- """
52
- ...
53
-
54
- class CommandException(metaflow.exception.MetaflowException, metaclass=type):
55
- ...
56
9
 
57
- class MetaflowException(Exception, metaclass=type):
58
- def __init__(self, msg = "", lineno = None):
59
- ...
60
- def __str__(self):
61
- ...
62
- ...
10
+ from ._vendor import click as click
11
+ from .client.core import get_metadata as get_metadata
12
+ from .client.core import namespace as namespace
13
+ from . import parameters as parameters
14
+ from . import plugins as plugins
15
+ from .exception import CommandException as CommandException
16
+ from .exception import MetaflowException as MetaflowException
17
+ from .metaflow_current import current as current
18
+ from .mflog import mflog as mflog
19
+ from .pylint_wrapper import PyLint as PyLint
20
+ from .tagging_util import validate_tags as validate_tags
63
21
 
64
22
  DECOSPECS: str
65
23
 
@@ -75,8 +33,6 @@ DEFAULT_MONITOR: str
75
33
 
76
34
  DEFAULT_PACKAGE_SUFFIXES: str
77
35
 
78
- current: metaflow.metaflow_current.Current
79
-
80
36
  LOG_SOURCES: list
81
37
 
82
38
  DATASTORES: list
@@ -89,26 +45,6 @@ METADATA_PROVIDERS: list
89
45
 
90
46
  MONITOR_SIDECARS: dict
91
47
 
92
- class PyLint(object, metaclass=type):
93
- def __init__(self, fname):
94
- ...
95
- def has_pylint(self):
96
- ...
97
- def run(self, logger = None, warnings = False, pylint_config = []):
98
- ...
99
- ...
100
-
101
- def validate_tags(tags, existing_tags = None):
102
- """
103
- Raises MetaflowTaggingError if invalid based on these rules:
104
-
105
- Tag set size is too large. But it's OK if tag set is not larger
106
- than an existing tag set (if provided).
107
-
108
- Then, we validate each tag. See validate_tag()
109
- """
110
- ...
111
-
112
48
  UBF_CONTROL: str
113
49
 
114
50
  UBF_TASK: str
@@ -131,7 +67,7 @@ def echo_dev_null(*args, **kwargs):
131
67
  def echo_always(line, **kwargs):
132
68
  ...
133
69
 
134
- def logger(body = "", system_msg = False, head = "", bad = False, timestamp = True, nl = True):
70
+ def logger(body = '', system_msg = False, head = '', bad = False, timestamp = True, nl = True):
135
71
  ...
136
72
 
137
73
  def config_merge_cb(ctx, param, value):