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.
- metaflow-stubs/__init__.pyi +2753 -0
- metaflow-stubs/cards.pyi +266 -0
- metaflow-stubs/cli.pyi +137 -0
- metaflow-stubs/client/__init__.pyi +993 -0
- metaflow-stubs/client/core.pyi +1425 -0
- metaflow-stubs/client/filecache.pyi +87 -0
- metaflow-stubs/events.pyi +107 -0
- metaflow-stubs/exception.pyi +98 -0
- metaflow-stubs/flowspec.pyi +297 -0
- metaflow-stubs/generated_for.txt +1 -0
- metaflow-stubs/includefile.pyi +524 -0
- metaflow-stubs/metadata/metadata.pyi +377 -0
- metaflow-stubs/metadata/util.pyi +18 -0
- metaflow-stubs/metaflow_config.pyi +263 -0
- metaflow-stubs/metaflow_current.pyi +327 -0
- metaflow-stubs/mflog/mflog.pyi +22 -0
- metaflow-stubs/multicore_utils.pyi +62 -0
- metaflow-stubs/parameters.pyi +114 -0
- metaflow-stubs/plugins/__init__.pyi +209 -0
- metaflow-stubs/plugins/airflow/__init__.pyi +9 -0
- metaflow-stubs/plugins/airflow/airflow.pyi +179 -0
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +90 -0
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +50 -0
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +137 -0
- metaflow-stubs/plugins/airflow/exception.pyi +27 -0
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +26 -0
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +60 -0
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +54 -0
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +50 -0
- metaflow-stubs/plugins/argo/__init__.pyi +9 -0
- metaflow-stubs/plugins/argo/argo_client.pyi +77 -0
- metaflow-stubs/plugins/argo/argo_events.pyi +79 -0
- metaflow-stubs/plugins/argo/argo_workflows.pyi +604 -0
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +180 -0
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +169 -0
- metaflow-stubs/plugins/aws/__init__.pyi +9 -0
- metaflow-stubs/plugins/aws/aws_client.pyi +22 -0
- metaflow-stubs/plugins/aws/aws_utils.pyi +93 -0
- metaflow-stubs/plugins/aws/batch/__init__.pyi +9 -0
- metaflow-stubs/plugins/aws/batch/batch.pyi +120 -0
- metaflow-stubs/plugins/aws/batch/batch_cli.pyi +42 -0
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +159 -0
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +145 -0
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +9 -0
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +73 -0
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +9 -0
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +22 -0
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +27 -0
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +18 -0
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +17 -0
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +220 -0
- metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +139 -0
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +36 -0
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +49 -0
- metaflow-stubs/plugins/azure/__init__.pyi +9 -0
- metaflow-stubs/plugins/azure/azure_credential.pyi +28 -0
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +28 -0
- metaflow-stubs/plugins/azure/azure_utils.pyi +76 -0
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +52 -0
- metaflow-stubs/plugins/azure/includefile_support.pyi +63 -0
- metaflow-stubs/plugins/cards/__init__.pyi +9 -0
- metaflow-stubs/plugins/cards/card_cli.pyi +557 -0
- metaflow-stubs/plugins/cards/card_client.pyi +178 -0
- metaflow-stubs/plugins/cards/card_creator.pyi +26 -0
- metaflow-stubs/plugins/cards/card_datastore.pyi +111 -0
- metaflow-stubs/plugins/cards/card_decorator.pyi +133 -0
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +67 -0
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +263 -0
- metaflow-stubs/plugins/cards/card_modules/card.pyi +62 -0
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +78 -0
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +77 -0
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +11 -0
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +114 -0
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +75 -0
- metaflow-stubs/plugins/cards/card_modules/components.pyi +251 -0
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +45 -0
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +24 -0
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +155 -0
- metaflow-stubs/plugins/cards/card_resolver.pyi +60 -0
- metaflow-stubs/plugins/cards/component_serializer.pyi +227 -0
- metaflow-stubs/plugins/cards/exception.pyi +71 -0
- metaflow-stubs/plugins/catch_decorator.pyi +58 -0
- metaflow-stubs/plugins/datatools/__init__.pyi +339 -0
- metaflow-stubs/plugins/datatools/local.pyi +82 -0
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +589 -0
- metaflow-stubs/plugins/datatools/s3/s3.pyi +875 -0
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +34 -0
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +45 -0
- metaflow-stubs/plugins/debug_logger.pyi +25 -0
- metaflow-stubs/plugins/debug_monitor.pyi +25 -0
- metaflow-stubs/plugins/environment_decorator.pyi +17 -0
- metaflow-stubs/plugins/events_decorator.pyi +34 -0
- metaflow-stubs/plugins/frameworks/__init__.pyi +9 -0
- metaflow-stubs/plugins/frameworks/pytorch.pyi +42 -0
- metaflow-stubs/plugins/gcp/__init__.pyi +9 -0
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +22 -0
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +26 -0
- metaflow-stubs/plugins/gcp/gs_utils.pyi +38 -0
- metaflow-stubs/plugins/gcp/includefile_support.pyi +63 -0
- metaflow-stubs/plugins/kubernetes/__init__.pyi +9 -0
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +127 -0
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +73 -0
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +62 -0
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +165 -0
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +100 -0
- metaflow-stubs/plugins/package_cli.pyi +9 -0
- metaflow-stubs/plugins/parallel_decorator.pyi +34 -0
- metaflow-stubs/plugins/project_decorator.pyi +36 -0
- metaflow-stubs/plugins/pypi/__init__.pyi +18 -0
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +59 -0
- metaflow-stubs/plugins/pypi/conda_environment.pyi +86 -0
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +22 -0
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +50 -0
- metaflow-stubs/plugins/pypi/utils.pyi +28 -0
- metaflow-stubs/plugins/resources_decorator.pyi +15 -0
- metaflow-stubs/plugins/retry_decorator.pyi +28 -0
- metaflow-stubs/plugins/secrets/__init__.pyi +21 -0
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +30 -0
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +75 -0
- metaflow-stubs/plugins/storage_executor.pyi +33 -0
- metaflow-stubs/plugins/tag_cli.pyi +370 -0
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +54 -0
- metaflow-stubs/plugins/timeout_decorator.pyi +39 -0
- metaflow-stubs/procpoll.pyi +51 -0
- metaflow-stubs/py.typed +0 -0
- metaflow-stubs/pylint_wrapper.pyi +31 -0
- metaflow-stubs/tagging_util.pyi +52 -0
- ob_metaflow_stubs-2.11.4.1.dist-info/METADATA +22 -0
- ob_metaflow_stubs-2.11.4.1.dist-info/RECORD +131 -0
- ob_metaflow_stubs-2.11.4.1.dist-info/WHEEL +6 -0
- ob_metaflow_stubs-2.11.4.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,251 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.949578 #
|
5
|
+
##################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
import typing
|
10
|
+
if typing.TYPE_CHECKING:
|
11
|
+
import typing
|
12
|
+
import metaflow.plugins.cards.card_modules.basic
|
13
|
+
import metaflow.plugins.cards.card_modules.card
|
14
|
+
import metaflow.plugins.cards.card_modules.components
|
15
|
+
|
16
|
+
class LogComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
|
17
|
+
def __init__(self, data = None):
|
18
|
+
...
|
19
|
+
def render(self):
|
20
|
+
...
|
21
|
+
...
|
22
|
+
|
23
|
+
class ErrorComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
|
24
|
+
def __init__(self, headline, error_message):
|
25
|
+
...
|
26
|
+
def render(self):
|
27
|
+
...
|
28
|
+
...
|
29
|
+
|
30
|
+
class ArtifactsComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
|
31
|
+
def __init__(self, title = None, subtitle = None, data = {}):
|
32
|
+
...
|
33
|
+
def render(self):
|
34
|
+
...
|
35
|
+
...
|
36
|
+
|
37
|
+
class TableComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
|
38
|
+
def __init__(self, title = None, subtitle = None, headers = [], data = [[]], vertical = False):
|
39
|
+
...
|
40
|
+
@classmethod
|
41
|
+
def validate(cls, headers, data):
|
42
|
+
...
|
43
|
+
def render(self):
|
44
|
+
...
|
45
|
+
...
|
46
|
+
|
47
|
+
class ImageComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
|
48
|
+
def __init__(self, src = None, label = None, title = None, subtitle = None):
|
49
|
+
...
|
50
|
+
def render(self):
|
51
|
+
...
|
52
|
+
...
|
53
|
+
|
54
|
+
class SectionComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
|
55
|
+
def __init__(self, title = None, subtitle = None, columns = None, contents = []):
|
56
|
+
...
|
57
|
+
@classmethod
|
58
|
+
def render_subcomponents(cls, component_array, additional_allowed_types = [str, dict], allow_unknowns = False):
|
59
|
+
...
|
60
|
+
def render(self):
|
61
|
+
...
|
62
|
+
...
|
63
|
+
|
64
|
+
class MarkdownComponent(metaflow.plugins.cards.card_modules.basic.DefaultComponent, metaclass=type):
|
65
|
+
def __init__(self, text = None):
|
66
|
+
...
|
67
|
+
def render(self):
|
68
|
+
...
|
69
|
+
...
|
70
|
+
|
71
|
+
class MetaflowCardComponent(object, metaclass=type):
|
72
|
+
@property
|
73
|
+
def component_id(self):
|
74
|
+
...
|
75
|
+
@component_id.setter
|
76
|
+
def component_id(self, value):
|
77
|
+
...
|
78
|
+
def update(self, *args, **kwargs):
|
79
|
+
"""
|
80
|
+
#FIXME document
|
81
|
+
"""
|
82
|
+
...
|
83
|
+
def render(self):
|
84
|
+
"""
|
85
|
+
`render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard`
|
86
|
+
"""
|
87
|
+
...
|
88
|
+
...
|
89
|
+
|
90
|
+
class TaskToDict(object, metaclass=type):
|
91
|
+
def __init__(self, only_repr = False, runtime = False):
|
92
|
+
...
|
93
|
+
def __call__(self, task, graph = None):
|
94
|
+
...
|
95
|
+
def object_type(self, object):
|
96
|
+
...
|
97
|
+
def parse_image(self, data_object):
|
98
|
+
...
|
99
|
+
def infer_object(self, artifact_object):
|
100
|
+
...
|
101
|
+
...
|
102
|
+
|
103
|
+
def render_safely(func):
|
104
|
+
"""
|
105
|
+
This is a decorator that can be added to any `MetaflowCardComponent.render`
|
106
|
+
The goal is to render subcomponents safely and ensure that they are JSON serializable.
|
107
|
+
"""
|
108
|
+
...
|
109
|
+
|
110
|
+
def create_component_id(component):
|
111
|
+
...
|
112
|
+
|
113
|
+
def with_default_component_id(func):
|
114
|
+
...
|
115
|
+
|
116
|
+
class UserComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
|
117
|
+
def update(self, *args, **kwargs):
|
118
|
+
...
|
119
|
+
...
|
120
|
+
|
121
|
+
class StubComponent(UserComponent, metaclass=type):
|
122
|
+
def __init__(self, component_id):
|
123
|
+
...
|
124
|
+
def update(self, *args, **kwargs):
|
125
|
+
...
|
126
|
+
...
|
127
|
+
|
128
|
+
class Artifact(UserComponent, metaclass=type):
|
129
|
+
def update(self, artifact):
|
130
|
+
...
|
131
|
+
def __init__(self, artifact: typing.Any, name: typing.Optional[str] = None, compressed: bool = True):
|
132
|
+
...
|
133
|
+
def render(self, *args, **kwargs):
|
134
|
+
...
|
135
|
+
...
|
136
|
+
|
137
|
+
class Table(UserComponent, metaclass=type):
|
138
|
+
def update(self, *args, **kwargs):
|
139
|
+
...
|
140
|
+
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):
|
141
|
+
...
|
142
|
+
@classmethod
|
143
|
+
def from_dataframe(cls, dataframe = None, truncate: bool = True):
|
144
|
+
"""
|
145
|
+
Create a `Table` based on a Pandas dataframe.
|
146
|
+
|
147
|
+
Parameters
|
148
|
+
----------
|
149
|
+
dataframe : Optional[pandas.DataFrame]
|
150
|
+
Pandas dataframe.
|
151
|
+
truncate : bool, default: True
|
152
|
+
Truncate large dataframe instead of showing all rows (default: True).
|
153
|
+
"""
|
154
|
+
...
|
155
|
+
def render(self, *args, **kwargs):
|
156
|
+
...
|
157
|
+
...
|
158
|
+
|
159
|
+
class Image(UserComponent, metaclass=type):
|
160
|
+
@staticmethod
|
161
|
+
def render_fail_headline(msg):
|
162
|
+
...
|
163
|
+
def __init__(self, src = None, label = None, disable_updates: bool = True):
|
164
|
+
...
|
165
|
+
@classmethod
|
166
|
+
def from_pil_image(cls, pilimage, label: typing.Optional[str] = None, disable_updates: bool = False):
|
167
|
+
"""
|
168
|
+
Create an `Image` from a PIL image.
|
169
|
+
|
170
|
+
Parameters
|
171
|
+
----------
|
172
|
+
pilimage : PIL.Image
|
173
|
+
a PIL image object.
|
174
|
+
label : str, optional
|
175
|
+
Optional label for the image.
|
176
|
+
"""
|
177
|
+
...
|
178
|
+
@classmethod
|
179
|
+
def from_matplotlib(cls, plot, label: typing.Optional[str] = None, disable_updates: bool = False):
|
180
|
+
"""
|
181
|
+
Create an `Image` from a Matplotlib plot.
|
182
|
+
|
183
|
+
Parameters
|
184
|
+
----------
|
185
|
+
plot : matplotlib.figure.Figure or matplotlib.axes.Axes or matplotlib.axes._subplots.AxesSubplot
|
186
|
+
a PIL axes (plot) object.
|
187
|
+
label : str, optional
|
188
|
+
Optional label for the image.
|
189
|
+
"""
|
190
|
+
...
|
191
|
+
def render(self, *args, **kwargs):
|
192
|
+
...
|
193
|
+
def update(self, image, label = None):
|
194
|
+
"""
|
195
|
+
Update the image.
|
196
|
+
|
197
|
+
Parameters
|
198
|
+
----------
|
199
|
+
image : PIL.Image or matplotlib.figure.Figure or matplotlib.axes.Axes or matplotlib.axes._subplots.AxesSubplot or bytes or str
|
200
|
+
The updated image object
|
201
|
+
label : str, optional
|
202
|
+
Optional label for the image.
|
203
|
+
"""
|
204
|
+
...
|
205
|
+
...
|
206
|
+
|
207
|
+
class Error(UserComponent, metaclass=type):
|
208
|
+
def __init__(self, exception, title = None):
|
209
|
+
...
|
210
|
+
def render(self, *args, **kwargs):
|
211
|
+
...
|
212
|
+
...
|
213
|
+
|
214
|
+
class Markdown(UserComponent, metaclass=type):
|
215
|
+
def update(self, text = None):
|
216
|
+
...
|
217
|
+
def __init__(self, text = None):
|
218
|
+
...
|
219
|
+
def render(self, *args, **kwargs):
|
220
|
+
...
|
221
|
+
...
|
222
|
+
|
223
|
+
class ProgressBar(UserComponent, metaclass=type):
|
224
|
+
def __init__(self, max: int = 100, label: str = None, value: int = 0, unit: str = None, metadata: str = None):
|
225
|
+
...
|
226
|
+
def update(self, new_value: int, metadata: str = None):
|
227
|
+
...
|
228
|
+
def render(self, *args, **kwargs):
|
229
|
+
...
|
230
|
+
...
|
231
|
+
|
232
|
+
class VegaChart(UserComponent, metaclass=type):
|
233
|
+
def __init__(self, spec: dict, show_controls: bool = False):
|
234
|
+
...
|
235
|
+
def update(self, spec = None):
|
236
|
+
"""
|
237
|
+
Update the chart.
|
238
|
+
|
239
|
+
Parameters
|
240
|
+
----------
|
241
|
+
spec : dict or altair.Chart
|
242
|
+
The updated chart spec or an altair Chart Object.
|
243
|
+
"""
|
244
|
+
...
|
245
|
+
@classmethod
|
246
|
+
def from_altair_chart(cls, altair_chart):
|
247
|
+
...
|
248
|
+
def render(self, *args, **kwargs):
|
249
|
+
...
|
250
|
+
...
|
251
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.996202 #
|
5
|
+
##################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
|
10
|
+
class TypeResolvedObject(tuple, metaclass=type):
|
11
|
+
@staticmethod
|
12
|
+
def __new__(_cls, data, is_image, is_table):
|
13
|
+
"""
|
14
|
+
Create new instance of TypeResolvedObject(data, is_image, is_table)
|
15
|
+
"""
|
16
|
+
...
|
17
|
+
def __repr__(self):
|
18
|
+
"""
|
19
|
+
Return a nicely formatted representation string
|
20
|
+
"""
|
21
|
+
...
|
22
|
+
def __getnewargs__(self):
|
23
|
+
"""
|
24
|
+
Return self as a plain tuple. Used by copy and pickle.
|
25
|
+
"""
|
26
|
+
...
|
27
|
+
...
|
28
|
+
|
29
|
+
TIME_FORMAT: str
|
30
|
+
|
31
|
+
MAX_ARTIFACT_SIZE: int
|
32
|
+
|
33
|
+
class TaskToDict(object, metaclass=type):
|
34
|
+
def __init__(self, only_repr = False, runtime = False):
|
35
|
+
...
|
36
|
+
def __call__(self, task, graph = None):
|
37
|
+
...
|
38
|
+
def object_type(self, object):
|
39
|
+
...
|
40
|
+
def parse_image(self, data_object):
|
41
|
+
...
|
42
|
+
def infer_object(self, artifact_object):
|
43
|
+
...
|
44
|
+
...
|
45
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.996432 #
|
5
|
+
##################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
import typing
|
10
|
+
if typing.TYPE_CHECKING:
|
11
|
+
import metaflow.plugins.cards.card_modules.basic
|
12
|
+
|
13
|
+
class SerializationErrorComponent(metaflow.plugins.cards.card_modules.basic.ErrorComponent, metaclass=type):
|
14
|
+
def __init__(self, component_name, error_message):
|
15
|
+
...
|
16
|
+
...
|
17
|
+
|
18
|
+
def render_safely(func):
|
19
|
+
"""
|
20
|
+
This is a decorator that can be added to any `MetaflowCardComponent.render`
|
21
|
+
The goal is to render subcomponents safely and ensure that they are JSON serializable.
|
22
|
+
"""
|
23
|
+
...
|
24
|
+
|
@@ -0,0 +1,155 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.939715 #
|
5
|
+
##################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
import typing
|
10
|
+
if typing.TYPE_CHECKING:
|
11
|
+
import metaflow
|
12
|
+
import metaflow.plugins.cards.card_modules.card
|
13
|
+
|
14
|
+
class MetaflowCard(object, metaclass=type):
|
15
|
+
def __init__(self, options = {}, components = [], graph = None):
|
16
|
+
...
|
17
|
+
def render(self, task: "metaflow.Task") -> str:
|
18
|
+
"""
|
19
|
+
Produce custom card contents in HTML.
|
20
|
+
|
21
|
+
Subclasses override this method to customize the card contents.
|
22
|
+
|
23
|
+
Parameters
|
24
|
+
----------
|
25
|
+
task : Task
|
26
|
+
A `Task` object that allows you to access data from the finished task and tasks
|
27
|
+
preceding it.
|
28
|
+
|
29
|
+
Returns
|
30
|
+
-------
|
31
|
+
str
|
32
|
+
Card contents as an HTML string.
|
33
|
+
"""
|
34
|
+
...
|
35
|
+
def render_runtime(self, task, data):
|
36
|
+
...
|
37
|
+
def refresh(self, task, data):
|
38
|
+
...
|
39
|
+
def reload_content_token(self, task, data):
|
40
|
+
...
|
41
|
+
...
|
42
|
+
|
43
|
+
class MetaflowCardComponent(object, metaclass=type):
|
44
|
+
@property
|
45
|
+
def component_id(self):
|
46
|
+
...
|
47
|
+
@component_id.setter
|
48
|
+
def component_id(self, value):
|
49
|
+
...
|
50
|
+
def update(self, *args, **kwargs):
|
51
|
+
"""
|
52
|
+
#FIXME document
|
53
|
+
"""
|
54
|
+
...
|
55
|
+
def render(self):
|
56
|
+
"""
|
57
|
+
`render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard`
|
58
|
+
"""
|
59
|
+
...
|
60
|
+
...
|
61
|
+
|
62
|
+
def render_safely(func):
|
63
|
+
"""
|
64
|
+
This is a decorator that can be added to any `MetaflowCardComponent.render`
|
65
|
+
The goal is to render subcomponents safely and ensure that they are JSON serializable.
|
66
|
+
"""
|
67
|
+
...
|
68
|
+
|
69
|
+
class TestStringComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
|
70
|
+
def __init__(self, text):
|
71
|
+
...
|
72
|
+
def render(self):
|
73
|
+
...
|
74
|
+
def update(self, text):
|
75
|
+
...
|
76
|
+
...
|
77
|
+
|
78
|
+
class TestPathSpecCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
|
79
|
+
def render(self, task):
|
80
|
+
...
|
81
|
+
...
|
82
|
+
|
83
|
+
class TestEditableCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
|
84
|
+
def __init__(self, options = {}, components = [], graph = None):
|
85
|
+
...
|
86
|
+
def render(self, task):
|
87
|
+
...
|
88
|
+
...
|
89
|
+
|
90
|
+
class TestEditableCard2(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
|
91
|
+
def __init__(self, options = {}, components = [], graph = None):
|
92
|
+
...
|
93
|
+
def render(self, task):
|
94
|
+
...
|
95
|
+
...
|
96
|
+
|
97
|
+
class TestNonEditableCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
|
98
|
+
def __init__(self, options = {}, components = [], graph = None):
|
99
|
+
...
|
100
|
+
def render(self, task):
|
101
|
+
...
|
102
|
+
...
|
103
|
+
|
104
|
+
class TestMockCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
|
105
|
+
def __init__(self, options = {"key": "dummy_key"}, **kwargs):
|
106
|
+
...
|
107
|
+
def render(self, task):
|
108
|
+
...
|
109
|
+
...
|
110
|
+
|
111
|
+
class TestErrorCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
|
112
|
+
def render(self, task):
|
113
|
+
...
|
114
|
+
...
|
115
|
+
|
116
|
+
class TestTimeoutCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
|
117
|
+
def __init__(self, options = {"timeout": 50}, **kwargs):
|
118
|
+
...
|
119
|
+
def render(self, task):
|
120
|
+
...
|
121
|
+
...
|
122
|
+
|
123
|
+
REFRESHABLE_HTML_TEMPLATE: str
|
124
|
+
|
125
|
+
class TestJSONComponent(metaflow.plugins.cards.card_modules.card.MetaflowCardComponent, metaclass=type):
|
126
|
+
def __init__(self, data):
|
127
|
+
...
|
128
|
+
def render(self, *args, **kwargs):
|
129
|
+
...
|
130
|
+
def update(self, data):
|
131
|
+
...
|
132
|
+
...
|
133
|
+
|
134
|
+
class TestRefreshCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
|
135
|
+
def render(self, task) -> str:
|
136
|
+
...
|
137
|
+
def render_runtime(self, task, data):
|
138
|
+
...
|
139
|
+
def refresh(self, task, data):
|
140
|
+
...
|
141
|
+
...
|
142
|
+
|
143
|
+
class TestRefreshComponentCard(metaflow.plugins.cards.card_modules.card.MetaflowCard, metaclass=type):
|
144
|
+
def __init__(self, options = {}, components = [], graph = None):
|
145
|
+
...
|
146
|
+
def render(self, task) -> str:
|
147
|
+
...
|
148
|
+
def render_runtime(self, task, data):
|
149
|
+
...
|
150
|
+
def refresh(self, task, data):
|
151
|
+
...
|
152
|
+
def reload_content_token(self, task, data):
|
153
|
+
...
|
154
|
+
...
|
155
|
+
|
@@ -0,0 +1,60 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.978312 #
|
5
|
+
##################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
|
10
|
+
class CardDatastore(object, metaclass=type):
|
11
|
+
@classmethod
|
12
|
+
def get_storage_root(cls, storage_type):
|
13
|
+
...
|
14
|
+
def __init__(self, flow_datastore, pathspec = None):
|
15
|
+
...
|
16
|
+
@classmethod
|
17
|
+
def get_card_location(cls, base_path, card_name, uuid, card_id = None, suffix = "html"):
|
18
|
+
...
|
19
|
+
@staticmethod
|
20
|
+
def info_from_path(path, suffix = "html"):
|
21
|
+
"""
|
22
|
+
Args:
|
23
|
+
path (str): The path to the card
|
24
|
+
|
25
|
+
Raises:
|
26
|
+
Exception: When the card_path is invalid
|
27
|
+
|
28
|
+
Returns:
|
29
|
+
CardInfo
|
30
|
+
"""
|
31
|
+
...
|
32
|
+
def save_data(self, uuid, card_type, json_data, card_id = None):
|
33
|
+
...
|
34
|
+
def save_card(self, uuid, card_type, card_html, card_id = None, overwrite = True):
|
35
|
+
...
|
36
|
+
def create_full_path(self, card_path):
|
37
|
+
...
|
38
|
+
def get_card_names(self, card_paths):
|
39
|
+
...
|
40
|
+
def get_card_html(self, path):
|
41
|
+
...
|
42
|
+
def get_card_data(self, path):
|
43
|
+
...
|
44
|
+
def cache_locally(self, path, save_path = None):
|
45
|
+
"""
|
46
|
+
Saves the data present in the `path` the `metaflow_card_cache` directory or to the `save_path`.
|
47
|
+
"""
|
48
|
+
...
|
49
|
+
def extract_data_paths(self, card_type = None, card_hash = None, card_id = None):
|
50
|
+
...
|
51
|
+
def extract_card_paths(self, card_type = None, card_hash = None, card_id = None):
|
52
|
+
...
|
53
|
+
...
|
54
|
+
|
55
|
+
def resumed_info(task):
|
56
|
+
...
|
57
|
+
|
58
|
+
def resolve_paths_from_task(flow_datastore, pathspec = None, type = None, hash = None, card_id = None):
|
59
|
+
...
|
60
|
+
|