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,178 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.946200 #
|
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_client
|
13
|
+
import metaflow.exception
|
14
|
+
|
15
|
+
TYPE_CHECKING: bool
|
16
|
+
|
17
|
+
CARD_SUFFIX: str
|
18
|
+
|
19
|
+
def resolve_paths_from_task(flow_datastore, pathspec = None, type = None, hash = None, card_id = None):
|
20
|
+
...
|
21
|
+
|
22
|
+
def resumed_info(task):
|
23
|
+
...
|
24
|
+
|
25
|
+
class CardDatastore(object, metaclass=type):
|
26
|
+
@classmethod
|
27
|
+
def get_storage_root(cls, storage_type):
|
28
|
+
...
|
29
|
+
def __init__(self, flow_datastore, pathspec = None):
|
30
|
+
...
|
31
|
+
@classmethod
|
32
|
+
def get_card_location(cls, base_path, card_name, uuid, card_id = None, suffix = "html"):
|
33
|
+
...
|
34
|
+
@staticmethod
|
35
|
+
def info_from_path(path, suffix = "html"):
|
36
|
+
"""
|
37
|
+
Args:
|
38
|
+
path (str): The path to the card
|
39
|
+
|
40
|
+
Raises:
|
41
|
+
Exception: When the card_path is invalid
|
42
|
+
|
43
|
+
Returns:
|
44
|
+
CardInfo
|
45
|
+
"""
|
46
|
+
...
|
47
|
+
def save_data(self, uuid, card_type, json_data, card_id = None):
|
48
|
+
...
|
49
|
+
def save_card(self, uuid, card_type, card_html, card_id = None, overwrite = True):
|
50
|
+
...
|
51
|
+
def create_full_path(self, card_path):
|
52
|
+
...
|
53
|
+
def get_card_names(self, card_paths):
|
54
|
+
...
|
55
|
+
def get_card_html(self, path):
|
56
|
+
...
|
57
|
+
def get_card_data(self, path):
|
58
|
+
...
|
59
|
+
def cache_locally(self, path, save_path = None):
|
60
|
+
"""
|
61
|
+
Saves the data present in the `path` the `metaflow_card_cache` directory or to the `save_path`.
|
62
|
+
"""
|
63
|
+
...
|
64
|
+
def extract_data_paths(self, card_type = None, card_hash = None, card_id = None):
|
65
|
+
...
|
66
|
+
def extract_card_paths(self, card_type = None, card_hash = None, card_id = None):
|
67
|
+
...
|
68
|
+
...
|
69
|
+
|
70
|
+
class CardNameSuffix(object, metaclass=type):
|
71
|
+
...
|
72
|
+
|
73
|
+
class UnresolvableDatastoreException(metaflow.exception.MetaflowException, metaclass=type):
|
74
|
+
def __init__(self, task):
|
75
|
+
...
|
76
|
+
...
|
77
|
+
|
78
|
+
class IncorrectArgumentException(metaflow.exception.MetaflowException, metaclass=type):
|
79
|
+
def __init__(self, obj_type):
|
80
|
+
...
|
81
|
+
...
|
82
|
+
|
83
|
+
class IncorrectPathspecException(metaflow.exception.MetaflowException, metaclass=type):
|
84
|
+
def __init__(self, pthspec):
|
85
|
+
...
|
86
|
+
...
|
87
|
+
|
88
|
+
class Card(object, metaclass=type):
|
89
|
+
def __init__(self, card_ds, type, path, hash, id = None, html = None, created_on = None, from_resumed = False, origin_pathspec = None):
|
90
|
+
...
|
91
|
+
def get_data(self) -> typing.Optional[dict]:
|
92
|
+
...
|
93
|
+
def get(self) -> str:
|
94
|
+
"""
|
95
|
+
Retrieves the HTML contents of the card from the
|
96
|
+
Metaflow datastore.
|
97
|
+
|
98
|
+
Returns
|
99
|
+
-------
|
100
|
+
str
|
101
|
+
HTML contents of the card.
|
102
|
+
"""
|
103
|
+
...
|
104
|
+
@property
|
105
|
+
def path(self) -> str:
|
106
|
+
"""
|
107
|
+
The path of the card in the datastore which uniquely
|
108
|
+
identifies the card.
|
109
|
+
|
110
|
+
Returns
|
111
|
+
-------
|
112
|
+
str
|
113
|
+
Path to the card
|
114
|
+
"""
|
115
|
+
...
|
116
|
+
@property
|
117
|
+
def id(self) -> typing.Optional[str]:
|
118
|
+
"""
|
119
|
+
The ID of the card, if specified with `@card(id=ID)`.
|
120
|
+
|
121
|
+
Returns
|
122
|
+
-------
|
123
|
+
Optional[str]
|
124
|
+
ID of the card
|
125
|
+
"""
|
126
|
+
...
|
127
|
+
def __str__(self):
|
128
|
+
...
|
129
|
+
def view(self):
|
130
|
+
"""
|
131
|
+
Opens the card in a local web browser.
|
132
|
+
|
133
|
+
This call uses Python's built-in [`webbrowser`](https://docs.python.org/3/library/webbrowser.html)
|
134
|
+
module to open the card.
|
135
|
+
"""
|
136
|
+
...
|
137
|
+
...
|
138
|
+
|
139
|
+
class CardContainer(object, metaclass=type):
|
140
|
+
def __init__(self, card_paths, card_ds, origin_pathspec = None):
|
141
|
+
...
|
142
|
+
def __len__(self):
|
143
|
+
...
|
144
|
+
def __iter__(self):
|
145
|
+
...
|
146
|
+
def __getitem__(self, index):
|
147
|
+
...
|
148
|
+
...
|
149
|
+
|
150
|
+
def get_cards(task: typing.Union[str, "metaflow.Task"], id: typing.Optional[str] = None, type: typing.Optional[str] = None, follow_resumed: bool = True) -> CardContainer:
|
151
|
+
"""
|
152
|
+
Get cards related to a `Task`.
|
153
|
+
|
154
|
+
Note that `get_cards` resolves the cards contained by the task, but it doesn't actually
|
155
|
+
retrieve them from the datastore. Actual card contents are retrieved lazily either when
|
156
|
+
the card is rendered in a notebook to when you call `Card.get`. This means that
|
157
|
+
`get_cards` is a fast call even when individual cards contain a lot of data.
|
158
|
+
|
159
|
+
Parameters
|
160
|
+
----------
|
161
|
+
task : Union[str, `Task`]
|
162
|
+
A `Task` object or pathspec `{flow_name}/{run_id}/{step_name}/{task_id}` that
|
163
|
+
uniquely identifies a task.
|
164
|
+
id : str, optional, default None
|
165
|
+
The ID of card to retrieve if multiple cards are present.
|
166
|
+
type : str, optional, default None
|
167
|
+
The type of card to retrieve if multiple cards are present.
|
168
|
+
follow_resumed : bool, default True
|
169
|
+
If the task has been resumed, then setting this flag will resolve the card for
|
170
|
+
the origin task.
|
171
|
+
|
172
|
+
Returns
|
173
|
+
-------
|
174
|
+
CardContainer
|
175
|
+
A list-like object that holds `Card` objects.
|
176
|
+
"""
|
177
|
+
...
|
178
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.975441 #
|
5
|
+
##################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
import typing
|
10
|
+
if typing.TYPE_CHECKING:
|
11
|
+
import metaflow.metaflow_current
|
12
|
+
|
13
|
+
current: metaflow.metaflow_current.Current
|
14
|
+
|
15
|
+
ASYNC_TIMEOUT: int
|
16
|
+
|
17
|
+
class CardProcessManager(object, metaclass=type):
|
18
|
+
...
|
19
|
+
|
20
|
+
class CardCreator(object, metaclass=type):
|
21
|
+
def __init__(self, top_level_options):
|
22
|
+
...
|
23
|
+
def create(self, card_uuid = None, user_set_card_id = None, runtime_card = False, decorator_attributes = None, card_options = None, logger = None, mode = "render", final = False, sync = False):
|
24
|
+
...
|
25
|
+
...
|
26
|
+
|
@@ -0,0 +1,111 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.977592 #
|
5
|
+
##################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
import typing
|
10
|
+
if typing.TYPE_CHECKING:
|
11
|
+
import metaflow.exception
|
12
|
+
|
13
|
+
CARD_S3ROOT: None
|
14
|
+
|
15
|
+
CARD_LOCALROOT: None
|
16
|
+
|
17
|
+
DATASTORE_LOCAL_DIR: str
|
18
|
+
|
19
|
+
CARD_SUFFIX: str
|
20
|
+
|
21
|
+
CARD_AZUREROOT: None
|
22
|
+
|
23
|
+
CARD_GSROOT: None
|
24
|
+
|
25
|
+
SKIP_CARD_DUALWRITE: bool
|
26
|
+
|
27
|
+
class CardNotPresentException(metaflow.exception.MetaflowException, metaclass=type):
|
28
|
+
def __init__(self, pathspec, card_type = None, card_hash = None, card_id = None):
|
29
|
+
...
|
30
|
+
...
|
31
|
+
|
32
|
+
TEMP_DIR_NAME: str
|
33
|
+
|
34
|
+
NUM_SHORT_HASH_CHARS: int
|
35
|
+
|
36
|
+
class CardInfo(tuple, metaclass=type):
|
37
|
+
@staticmethod
|
38
|
+
def __new__(_cls, type, hash, id, filename):
|
39
|
+
"""
|
40
|
+
Create new instance of CardInfo(type, hash, id, filename)
|
41
|
+
"""
|
42
|
+
...
|
43
|
+
def __repr__(self):
|
44
|
+
"""
|
45
|
+
Return a nicely formatted representation string
|
46
|
+
"""
|
47
|
+
...
|
48
|
+
def __getnewargs__(self):
|
49
|
+
"""
|
50
|
+
Return self as a plain tuple. Used by copy and pickle.
|
51
|
+
"""
|
52
|
+
...
|
53
|
+
...
|
54
|
+
|
55
|
+
class CardNameSuffix(object, metaclass=type):
|
56
|
+
...
|
57
|
+
|
58
|
+
class CardPathSuffix(object, metaclass=type):
|
59
|
+
...
|
60
|
+
|
61
|
+
def path_spec_resolver(pathspec):
|
62
|
+
...
|
63
|
+
|
64
|
+
def is_file_present(path):
|
65
|
+
...
|
66
|
+
|
67
|
+
class CardDatastore(object, metaclass=type):
|
68
|
+
@classmethod
|
69
|
+
def get_storage_root(cls, storage_type):
|
70
|
+
...
|
71
|
+
def __init__(self, flow_datastore, pathspec = None):
|
72
|
+
...
|
73
|
+
@classmethod
|
74
|
+
def get_card_location(cls, base_path, card_name, uuid, card_id = None, suffix = "html"):
|
75
|
+
...
|
76
|
+
@staticmethod
|
77
|
+
def info_from_path(path, suffix = "html"):
|
78
|
+
"""
|
79
|
+
Args:
|
80
|
+
path (str): The path to the card
|
81
|
+
|
82
|
+
Raises:
|
83
|
+
Exception: When the card_path is invalid
|
84
|
+
|
85
|
+
Returns:
|
86
|
+
CardInfo
|
87
|
+
"""
|
88
|
+
...
|
89
|
+
def save_data(self, uuid, card_type, json_data, card_id = None):
|
90
|
+
...
|
91
|
+
def save_card(self, uuid, card_type, card_html, card_id = None, overwrite = True):
|
92
|
+
...
|
93
|
+
def create_full_path(self, card_path):
|
94
|
+
...
|
95
|
+
def get_card_names(self, card_paths):
|
96
|
+
...
|
97
|
+
def get_card_html(self, path):
|
98
|
+
...
|
99
|
+
def get_card_data(self, path):
|
100
|
+
...
|
101
|
+
def cache_locally(self, path, save_path = None):
|
102
|
+
"""
|
103
|
+
Saves the data present in the `path` the `metaflow_card_cache` directory or to the `save_path`.
|
104
|
+
"""
|
105
|
+
...
|
106
|
+
def extract_data_paths(self, card_type = None, card_hash = None, card_id = None):
|
107
|
+
...
|
108
|
+
def extract_card_paths(self, card_type = None, card_hash = None, card_id = None):
|
109
|
+
...
|
110
|
+
...
|
111
|
+
|
@@ -0,0 +1,133 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.976477 #
|
5
|
+
##################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
import typing
|
10
|
+
if typing.TYPE_CHECKING:
|
11
|
+
import metaflow.metaflow_current
|
12
|
+
import metaflow.decorators
|
13
|
+
|
14
|
+
current: metaflow.metaflow_current.Current
|
15
|
+
|
16
|
+
class CardComponentCollector(object, metaclass=type):
|
17
|
+
def __init__(self, logger = None, card_creator = None):
|
18
|
+
...
|
19
|
+
@staticmethod
|
20
|
+
def create_uuid():
|
21
|
+
...
|
22
|
+
def get(self, type = None):
|
23
|
+
"""
|
24
|
+
`get`
|
25
|
+
gets all the components arrays for a card `type`.
|
26
|
+
Since one `@step` can have many `@card` decorators, many decorators can have the same type. That is why this function returns a list of lists.
|
27
|
+
|
28
|
+
Args:
|
29
|
+
type ([str], optional): `type` of MetaflowCard. Defaults to None.
|
30
|
+
|
31
|
+
Returns: will return empty `list` if `type` is None or not found
|
32
|
+
List[List[MetaflowCardComponent]]
|
33
|
+
"""
|
34
|
+
...
|
35
|
+
def __getitem__(self, key):
|
36
|
+
"""
|
37
|
+
Choose a specific card for manipulation.
|
38
|
+
|
39
|
+
When multiple @card decorators are present, you can add an
|
40
|
+
`ID` to distinguish between them, `@card(id=ID)`. This allows you
|
41
|
+
to add components to a specific card like this:
|
42
|
+
```
|
43
|
+
current.card[ID].append(component)
|
44
|
+
```
|
45
|
+
|
46
|
+
Parameters
|
47
|
+
----------
|
48
|
+
key : str
|
49
|
+
Card ID.
|
50
|
+
|
51
|
+
Returns
|
52
|
+
-------
|
53
|
+
CardComponentManager
|
54
|
+
An object with `append` and `extend` calls which allow you to
|
55
|
+
add components to the chosen card.
|
56
|
+
"""
|
57
|
+
...
|
58
|
+
def __setitem__(self, key, value):
|
59
|
+
"""
|
60
|
+
Specify components of the chosen card.
|
61
|
+
|
62
|
+
Instead of adding components to a card individually with `current.card[ID].append(component)`,
|
63
|
+
use this method to assign a list of components to a card, replacing the existing components:
|
64
|
+
```
|
65
|
+
current.card[ID] = [FirstComponent, SecondComponent]
|
66
|
+
```
|
67
|
+
|
68
|
+
Parameters
|
69
|
+
----------
|
70
|
+
key: str
|
71
|
+
Card ID.
|
72
|
+
|
73
|
+
value: List[MetaflowCardComponent]
|
74
|
+
List of card components to assign to this card.
|
75
|
+
"""
|
76
|
+
...
|
77
|
+
def append(self, component, id = None):
|
78
|
+
"""
|
79
|
+
Appends a component to the current card.
|
80
|
+
|
81
|
+
Parameters
|
82
|
+
----------
|
83
|
+
component : MetaflowCardComponent
|
84
|
+
Card component to add to this card.
|
85
|
+
"""
|
86
|
+
...
|
87
|
+
def extend(self, components):
|
88
|
+
"""
|
89
|
+
Appends many components to the current card.
|
90
|
+
|
91
|
+
Parameters
|
92
|
+
----------
|
93
|
+
component : Iterator[MetaflowCardComponent]
|
94
|
+
Card components to add to this card.
|
95
|
+
"""
|
96
|
+
...
|
97
|
+
@property
|
98
|
+
def components(self):
|
99
|
+
...
|
100
|
+
def clear(self):
|
101
|
+
...
|
102
|
+
def refresh(self, *args, **kwargs):
|
103
|
+
...
|
104
|
+
...
|
105
|
+
|
106
|
+
def get_card_class(card_type):
|
107
|
+
...
|
108
|
+
|
109
|
+
class CardCreator(object, metaclass=type):
|
110
|
+
def __init__(self, top_level_options):
|
111
|
+
...
|
112
|
+
def create(self, card_uuid = None, user_set_card_id = None, runtime_card = False, decorator_attributes = None, card_options = None, logger = None, mode = "render", final = False, sync = False):
|
113
|
+
...
|
114
|
+
...
|
115
|
+
|
116
|
+
TYPE_CHECK_REGEX: str
|
117
|
+
|
118
|
+
ASYNC_TIMEOUT: int
|
119
|
+
|
120
|
+
def warning_message(message, logger = None, ts = False):
|
121
|
+
...
|
122
|
+
|
123
|
+
class CardDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
124
|
+
def __init__(self, *args, **kwargs):
|
125
|
+
...
|
126
|
+
def step_init(self, flow, graph, step_name, decorators, environment, flow_datastore, logger):
|
127
|
+
...
|
128
|
+
def task_pre_step(self, step_name, task_datastore, metadata, run_id, task_id, flow, graph, retry_count, max_user_code_retries, ubf_context, inputs):
|
129
|
+
...
|
130
|
+
def task_finished(self, step_name, flow, graph, is_task_ok, retry_count, max_user_code_retries):
|
131
|
+
...
|
132
|
+
...
|
133
|
+
|
@@ -0,0 +1,67 @@
|
|
1
|
+
##################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.11.4.1 #
|
4
|
+
# Generated on 2024-02-28T05:30:43.972275 #
|
5
|
+
##################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
import typing
|
10
|
+
if typing.TYPE_CHECKING:
|
11
|
+
import metaflow
|
12
|
+
|
13
|
+
class MetaflowCard(object, metaclass=type):
|
14
|
+
def __init__(self, options = {}, components = [], graph = None):
|
15
|
+
...
|
16
|
+
def render(self, task: "metaflow.Task") -> str:
|
17
|
+
"""
|
18
|
+
Produce custom card contents in HTML.
|
19
|
+
|
20
|
+
Subclasses override this method to customize the card contents.
|
21
|
+
|
22
|
+
Parameters
|
23
|
+
----------
|
24
|
+
task : Task
|
25
|
+
A `Task` object that allows you to access data from the finished task and tasks
|
26
|
+
preceding it.
|
27
|
+
|
28
|
+
Returns
|
29
|
+
-------
|
30
|
+
str
|
31
|
+
Card contents as an HTML string.
|
32
|
+
"""
|
33
|
+
...
|
34
|
+
def render_runtime(self, task, data):
|
35
|
+
...
|
36
|
+
def refresh(self, task, data):
|
37
|
+
...
|
38
|
+
def reload_content_token(self, task, data):
|
39
|
+
...
|
40
|
+
...
|
41
|
+
|
42
|
+
class MetaflowCardComponent(object, metaclass=type):
|
43
|
+
@property
|
44
|
+
def component_id(self):
|
45
|
+
...
|
46
|
+
@component_id.setter
|
47
|
+
def component_id(self, value):
|
48
|
+
...
|
49
|
+
def update(self, *args, **kwargs):
|
50
|
+
"""
|
51
|
+
#FIXME document
|
52
|
+
"""
|
53
|
+
...
|
54
|
+
def render(self):
|
55
|
+
"""
|
56
|
+
`render` returns a string or dictionary. This class can be called on the client side to dynamically add components to the `MetaflowCard`
|
57
|
+
"""
|
58
|
+
...
|
59
|
+
...
|
60
|
+
|
61
|
+
EXT_PKG: str
|
62
|
+
|
63
|
+
def iter_namespace(ns_pkg):
|
64
|
+
...
|
65
|
+
|
66
|
+
MF_EXTERNAL_CARDS: list
|
67
|
+
|