databricks-sdk 0.56.0__py3-none-any.whl → 0.58.0__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.
Potentially problematic release.
This version of databricks-sdk might be problematic. Click here for more details.
- databricks/sdk/__init__.py +38 -11
- databricks/sdk/service/aibuilder.py +122 -17
- databricks/sdk/service/apps.py +15 -45
- databricks/sdk/service/billing.py +70 -74
- databricks/sdk/service/catalog.py +1898 -557
- databricks/sdk/service/cleanrooms.py +14 -55
- databricks/sdk/service/compute.py +305 -508
- databricks/sdk/service/dashboards.py +148 -223
- databricks/sdk/service/database.py +657 -127
- databricks/sdk/service/files.py +18 -54
- databricks/sdk/service/iam.py +55 -165
- databricks/sdk/service/jobs.py +238 -214
- databricks/sdk/service/marketplace.py +47 -146
- databricks/sdk/service/ml.py +1137 -447
- databricks/sdk/service/oauth2.py +17 -46
- databricks/sdk/service/pipelines.py +93 -69
- databricks/sdk/service/provisioning.py +34 -212
- databricks/sdk/service/qualitymonitorv2.py +5 -33
- databricks/sdk/service/serving.py +69 -55
- databricks/sdk/service/settings.py +106 -434
- databricks/sdk/service/sharing.py +33 -95
- databricks/sdk/service/sql.py +164 -254
- databricks/sdk/service/vectorsearch.py +13 -62
- databricks/sdk/service/workspace.py +36 -110
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/RECORD +31 -31
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.56.0.dist-info → databricks_sdk-0.58.0.dist-info}/top_level.txt +0 -0
databricks/sdk/service/ml.py
CHANGED
|
@@ -21,30 +21,18 @@ _LOG = logging.getLogger("databricks.sdk")
|
|
|
21
21
|
|
|
22
22
|
@dataclass
|
|
23
23
|
class Activity:
|
|
24
|
-
"""
|
|
24
|
+
"""For activities, this contains the activity recorded for the action. For comments, this contains
|
|
25
|
+
the comment details. For transition requests, this contains the transition request details."""
|
|
25
26
|
|
|
26
27
|
activity_type: Optional[ActivityType] = None
|
|
27
|
-
"""Type of activity. Valid values are: * `APPLIED_TRANSITION`: User applied the corresponding stage
|
|
28
|
-
transition.
|
|
29
|
-
|
|
30
|
-
* `REQUESTED_TRANSITION`: User requested the corresponding stage transition.
|
|
31
|
-
|
|
32
|
-
* `CANCELLED_REQUEST`: User cancelled an existing transition request.
|
|
33
|
-
|
|
34
|
-
* `APPROVED_REQUEST`: User approved the corresponding stage transition.
|
|
35
|
-
|
|
36
|
-
* `REJECTED_REQUEST`: User rejected the coressponding stage transition.
|
|
37
|
-
|
|
38
|
-
* `SYSTEM_TRANSITION`: For events performed as a side effect, such as archiving existing model
|
|
39
|
-
versions in a stage."""
|
|
40
28
|
|
|
41
29
|
comment: Optional[str] = None
|
|
42
|
-
"""User-provided comment associated with the activity."""
|
|
30
|
+
"""User-provided comment associated with the activity, comment, or transition request."""
|
|
43
31
|
|
|
44
32
|
creation_timestamp: Optional[int] = None
|
|
45
33
|
"""Creation time of the object, as a Unix timestamp in milliseconds."""
|
|
46
34
|
|
|
47
|
-
from_stage: Optional[
|
|
35
|
+
from_stage: Optional[str] = None
|
|
48
36
|
"""Source stage of the transition (if the activity is stage transition related). Valid values are:
|
|
49
37
|
|
|
50
38
|
* `None`: The initial stage of a model version.
|
|
@@ -66,7 +54,7 @@ class Activity:
|
|
|
66
54
|
usually describes a side effect, such as a version being archived as part of another version's
|
|
67
55
|
stage transition, and may not be returned for some activity types."""
|
|
68
56
|
|
|
69
|
-
to_stage: Optional[
|
|
57
|
+
to_stage: Optional[str] = None
|
|
70
58
|
"""Target stage of the transition (if the activity is stage transition related). Valid values are:
|
|
71
59
|
|
|
72
60
|
* `None`: The initial stage of a model version.
|
|
@@ -90,7 +78,7 @@ class Activity:
|
|
|
90
78
|
if self.creation_timestamp is not None:
|
|
91
79
|
body["creation_timestamp"] = self.creation_timestamp
|
|
92
80
|
if self.from_stage is not None:
|
|
93
|
-
body["from_stage"] = self.from_stage
|
|
81
|
+
body["from_stage"] = self.from_stage
|
|
94
82
|
if self.id is not None:
|
|
95
83
|
body["id"] = self.id
|
|
96
84
|
if self.last_updated_timestamp is not None:
|
|
@@ -98,7 +86,7 @@ class Activity:
|
|
|
98
86
|
if self.system_comment is not None:
|
|
99
87
|
body["system_comment"] = self.system_comment
|
|
100
88
|
if self.to_stage is not None:
|
|
101
|
-
body["to_stage"] = self.to_stage
|
|
89
|
+
body["to_stage"] = self.to_stage
|
|
102
90
|
if self.user_id is not None:
|
|
103
91
|
body["user_id"] = self.user_id
|
|
104
92
|
return body
|
|
@@ -133,25 +121,32 @@ class Activity:
|
|
|
133
121
|
activity_type=_enum(d, "activity_type", ActivityType),
|
|
134
122
|
comment=d.get("comment", None),
|
|
135
123
|
creation_timestamp=d.get("creation_timestamp", None),
|
|
136
|
-
from_stage=
|
|
124
|
+
from_stage=d.get("from_stage", None),
|
|
137
125
|
id=d.get("id", None),
|
|
138
126
|
last_updated_timestamp=d.get("last_updated_timestamp", None),
|
|
139
127
|
system_comment=d.get("system_comment", None),
|
|
140
|
-
to_stage=
|
|
128
|
+
to_stage=d.get("to_stage", None),
|
|
141
129
|
user_id=d.get("user_id", None),
|
|
142
130
|
)
|
|
143
131
|
|
|
144
132
|
|
|
145
133
|
class ActivityAction(Enum):
|
|
146
|
-
"""An action that a user (with sufficient permissions) could take on an activity
|
|
147
|
-
|
|
134
|
+
"""An action that a user (with sufficient permissions) could take on an activity or comment.
|
|
135
|
+
|
|
136
|
+
For activities, valid values are: * `APPROVE_TRANSITION_REQUEST`: Approve a transition request
|
|
148
137
|
|
|
149
138
|
* `REJECT_TRANSITION_REQUEST`: Reject a transition request
|
|
150
139
|
|
|
151
|
-
* `CANCEL_TRANSITION_REQUEST`: Cancel (delete) a transition request
|
|
140
|
+
* `CANCEL_TRANSITION_REQUEST`: Cancel (delete) a transition request
|
|
141
|
+
|
|
142
|
+
For comments, valid values are: * `EDIT_COMMENT`: Edit the comment
|
|
143
|
+
|
|
144
|
+
* `DELETE_COMMENT`: Delete the comment"""
|
|
152
145
|
|
|
153
146
|
APPROVE_TRANSITION_REQUEST = "APPROVE_TRANSITION_REQUEST"
|
|
154
147
|
CANCEL_TRANSITION_REQUEST = "CANCEL_TRANSITION_REQUEST"
|
|
148
|
+
DELETE_COMMENT = "DELETE_COMMENT"
|
|
149
|
+
EDIT_COMMENT = "EDIT_COMMENT"
|
|
155
150
|
REJECT_TRANSITION_REQUEST = "REJECT_TRANSITION_REQUEST"
|
|
156
151
|
|
|
157
152
|
|
|
@@ -181,13 +176,15 @@ class ActivityType(Enum):
|
|
|
181
176
|
|
|
182
177
|
@dataclass
|
|
183
178
|
class ApproveTransitionRequest:
|
|
179
|
+
"""Details required to identify and approve a model version stage transition request."""
|
|
180
|
+
|
|
184
181
|
name: str
|
|
185
182
|
"""Name of the model."""
|
|
186
183
|
|
|
187
184
|
version: str
|
|
188
185
|
"""Version of the model."""
|
|
189
186
|
|
|
190
|
-
stage:
|
|
187
|
+
stage: str
|
|
191
188
|
"""Target stage of the transition. Valid values are:
|
|
192
189
|
|
|
193
190
|
* `None`: The initial stage of a model version.
|
|
@@ -214,7 +211,7 @@ class ApproveTransitionRequest:
|
|
|
214
211
|
if self.name is not None:
|
|
215
212
|
body["name"] = self.name
|
|
216
213
|
if self.stage is not None:
|
|
217
|
-
body["stage"] = self.stage
|
|
214
|
+
body["stage"] = self.stage
|
|
218
215
|
if self.version is not None:
|
|
219
216
|
body["version"] = self.version
|
|
220
217
|
return body
|
|
@@ -241,7 +238,7 @@ class ApproveTransitionRequest:
|
|
|
241
238
|
archive_existing_versions=d.get("archive_existing_versions", None),
|
|
242
239
|
comment=d.get("comment", None),
|
|
243
240
|
name=d.get("name", None),
|
|
244
|
-
stage=
|
|
241
|
+
stage=d.get("stage", None),
|
|
245
242
|
version=d.get("version", None),
|
|
246
243
|
)
|
|
247
244
|
|
|
@@ -249,7 +246,7 @@ class ApproveTransitionRequest:
|
|
|
249
246
|
@dataclass
|
|
250
247
|
class ApproveTransitionRequestResponse:
|
|
251
248
|
activity: Optional[Activity] = None
|
|
252
|
-
"""
|
|
249
|
+
"""New activity generated as a result of this operation."""
|
|
253
250
|
|
|
254
251
|
def as_dict(self) -> dict:
|
|
255
252
|
"""Serializes the ApproveTransitionRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -272,30 +269,41 @@ class ApproveTransitionRequestResponse:
|
|
|
272
269
|
|
|
273
270
|
|
|
274
271
|
class CommentActivityAction(Enum):
|
|
275
|
-
"""An action that a user (with sufficient permissions) could take on
|
|
276
|
-
|
|
272
|
+
"""An action that a user (with sufficient permissions) could take on an activity or comment.
|
|
273
|
+
|
|
274
|
+
For activities, valid values are: * `APPROVE_TRANSITION_REQUEST`: Approve a transition request
|
|
275
|
+
|
|
276
|
+
* `REJECT_TRANSITION_REQUEST`: Reject a transition request
|
|
277
|
+
|
|
278
|
+
* `CANCEL_TRANSITION_REQUEST`: Cancel (delete) a transition request
|
|
279
|
+
|
|
280
|
+
For comments, valid values are: * `EDIT_COMMENT`: Edit the comment
|
|
277
281
|
|
|
278
282
|
* `DELETE_COMMENT`: Delete the comment"""
|
|
279
283
|
|
|
284
|
+
APPROVE_TRANSITION_REQUEST = "APPROVE_TRANSITION_REQUEST"
|
|
285
|
+
CANCEL_TRANSITION_REQUEST = "CANCEL_TRANSITION_REQUEST"
|
|
280
286
|
DELETE_COMMENT = "DELETE_COMMENT"
|
|
281
287
|
EDIT_COMMENT = "EDIT_COMMENT"
|
|
288
|
+
REJECT_TRANSITION_REQUEST = "REJECT_TRANSITION_REQUEST"
|
|
282
289
|
|
|
283
290
|
|
|
284
291
|
@dataclass
|
|
285
292
|
class CommentObject:
|
|
286
|
-
"""
|
|
293
|
+
"""For activities, this contains the activity recorded for the action. For comments, this contains
|
|
294
|
+
the comment details. For transition requests, this contains the transition request details."""
|
|
287
295
|
|
|
288
296
|
available_actions: Optional[List[CommentActivityAction]] = None
|
|
289
297
|
"""Array of actions on the activity allowed for the current viewer."""
|
|
290
298
|
|
|
291
299
|
comment: Optional[str] = None
|
|
292
|
-
"""User-provided comment
|
|
300
|
+
"""User-provided comment associated with the activity, comment, or transition request."""
|
|
293
301
|
|
|
294
302
|
creation_timestamp: Optional[int] = None
|
|
295
303
|
"""Creation time of the object, as a Unix timestamp in milliseconds."""
|
|
296
304
|
|
|
297
305
|
id: Optional[str] = None
|
|
298
|
-
"""
|
|
306
|
+
"""Unique identifier for the object."""
|
|
299
307
|
|
|
300
308
|
last_updated_timestamp: Optional[int] = None
|
|
301
309
|
"""Time of the object at last update, as a Unix timestamp in milliseconds."""
|
|
@@ -352,6 +360,8 @@ class CommentObject:
|
|
|
352
360
|
|
|
353
361
|
@dataclass
|
|
354
362
|
class CreateComment:
|
|
363
|
+
"""Details required to create a comment on a model version."""
|
|
364
|
+
|
|
355
365
|
name: str
|
|
356
366
|
"""Name of the model."""
|
|
357
367
|
|
|
@@ -392,7 +402,7 @@ class CreateComment:
|
|
|
392
402
|
@dataclass
|
|
393
403
|
class CreateCommentResponse:
|
|
394
404
|
comment: Optional[CommentObject] = None
|
|
395
|
-
"""
|
|
405
|
+
"""New comment object"""
|
|
396
406
|
|
|
397
407
|
def as_dict(self) -> dict:
|
|
398
408
|
"""Serializes the CreateCommentResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -935,6 +945,8 @@ class CreateModelVersionResponse:
|
|
|
935
945
|
|
|
936
946
|
@dataclass
|
|
937
947
|
class CreateRegistryWebhook:
|
|
948
|
+
"""Details required to create a registry webhook."""
|
|
949
|
+
|
|
938
950
|
events: List[RegistryWebhookEvent]
|
|
939
951
|
"""Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A new model version was
|
|
940
952
|
created for the associated model.
|
|
@@ -969,8 +981,10 @@ class CreateRegistryWebhook:
|
|
|
969
981
|
"""User-specified description for the webhook."""
|
|
970
982
|
|
|
971
983
|
http_url_spec: Optional[HttpUrlSpec] = None
|
|
984
|
+
"""External HTTPS URL called on event trigger (by using a POST request)."""
|
|
972
985
|
|
|
973
986
|
job_spec: Optional[JobSpec] = None
|
|
987
|
+
"""ID of the job that the webhook runs."""
|
|
974
988
|
|
|
975
989
|
model_name: Optional[str] = None
|
|
976
990
|
"""If model name is not specified, a registry-wide webhook is created that listens for the
|
|
@@ -1119,13 +1133,15 @@ class CreateRunResponse:
|
|
|
1119
1133
|
|
|
1120
1134
|
@dataclass
|
|
1121
1135
|
class CreateTransitionRequest:
|
|
1136
|
+
"""Details required to create a model version stage transition request."""
|
|
1137
|
+
|
|
1122
1138
|
name: str
|
|
1123
1139
|
"""Name of the model."""
|
|
1124
1140
|
|
|
1125
1141
|
version: str
|
|
1126
1142
|
"""Version of the model."""
|
|
1127
1143
|
|
|
1128
|
-
stage:
|
|
1144
|
+
stage: str
|
|
1129
1145
|
"""Target stage of the transition. Valid values are:
|
|
1130
1146
|
|
|
1131
1147
|
* `None`: The initial stage of a model version.
|
|
@@ -1147,7 +1163,7 @@ class CreateTransitionRequest:
|
|
|
1147
1163
|
if self.name is not None:
|
|
1148
1164
|
body["name"] = self.name
|
|
1149
1165
|
if self.stage is not None:
|
|
1150
|
-
body["stage"] = self.stage
|
|
1166
|
+
body["stage"] = self.stage
|
|
1151
1167
|
if self.version is not None:
|
|
1152
1168
|
body["version"] = self.version
|
|
1153
1169
|
return body
|
|
@@ -1171,7 +1187,7 @@ class CreateTransitionRequest:
|
|
|
1171
1187
|
return cls(
|
|
1172
1188
|
comment=d.get("comment", None),
|
|
1173
1189
|
name=d.get("name", None),
|
|
1174
|
-
stage=
|
|
1190
|
+
stage=d.get("stage", None),
|
|
1175
1191
|
version=d.get("version", None),
|
|
1176
1192
|
)
|
|
1177
1193
|
|
|
@@ -1179,7 +1195,7 @@ class CreateTransitionRequest:
|
|
|
1179
1195
|
@dataclass
|
|
1180
1196
|
class CreateTransitionRequestResponse:
|
|
1181
1197
|
request: Optional[TransitionRequest] = None
|
|
1182
|
-
"""
|
|
1198
|
+
"""New activity generated for stage transition request."""
|
|
1183
1199
|
|
|
1184
1200
|
def as_dict(self) -> dict:
|
|
1185
1201
|
"""Serializes the CreateTransitionRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -1667,28 +1683,27 @@ class DeleteTagResponse:
|
|
|
1667
1683
|
|
|
1668
1684
|
@dataclass
|
|
1669
1685
|
class DeleteTransitionRequestResponse:
|
|
1686
|
+
activity: Optional[Activity] = None
|
|
1687
|
+
"""New activity generated as a result of this operation."""
|
|
1688
|
+
|
|
1670
1689
|
def as_dict(self) -> dict:
|
|
1671
1690
|
"""Serializes the DeleteTransitionRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
1672
1691
|
body = {}
|
|
1692
|
+
if self.activity:
|
|
1693
|
+
body["activity"] = self.activity.as_dict()
|
|
1673
1694
|
return body
|
|
1674
1695
|
|
|
1675
1696
|
def as_shallow_dict(self) -> dict:
|
|
1676
1697
|
"""Serializes the DeleteTransitionRequestResponse into a shallow dictionary of its immediate attributes."""
|
|
1677
1698
|
body = {}
|
|
1699
|
+
if self.activity:
|
|
1700
|
+
body["activity"] = self.activity
|
|
1678
1701
|
return body
|
|
1679
1702
|
|
|
1680
1703
|
@classmethod
|
|
1681
1704
|
def from_dict(cls, d: Dict[str, Any]) -> DeleteTransitionRequestResponse:
|
|
1682
1705
|
"""Deserializes the DeleteTransitionRequestResponse from a dictionary."""
|
|
1683
|
-
return cls()
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
class DeleteTransitionRequestStage(Enum):
|
|
1687
|
-
|
|
1688
|
-
ARCHIVED = "Archived"
|
|
1689
|
-
NONE = "None"
|
|
1690
|
-
PRODUCTION = "Production"
|
|
1691
|
-
STAGING = "Staging"
|
|
1706
|
+
return cls(activity=_from_dict(d, "activity", Activity))
|
|
1692
1707
|
|
|
1693
1708
|
|
|
1694
1709
|
@dataclass
|
|
@@ -1793,7 +1808,6 @@ class ExperimentAccessControlRequest:
|
|
|
1793
1808
|
"""name of the group"""
|
|
1794
1809
|
|
|
1795
1810
|
permission_level: Optional[ExperimentPermissionLevel] = None
|
|
1796
|
-
"""Permission level"""
|
|
1797
1811
|
|
|
1798
1812
|
service_principal_name: Optional[str] = None
|
|
1799
1813
|
"""application ID of a service principal"""
|
|
@@ -1904,7 +1918,6 @@ class ExperimentPermission:
|
|
|
1904
1918
|
inherited_from_object: Optional[List[str]] = None
|
|
1905
1919
|
|
|
1906
1920
|
permission_level: Optional[ExperimentPermissionLevel] = None
|
|
1907
|
-
"""Permission level"""
|
|
1908
1921
|
|
|
1909
1922
|
def as_dict(self) -> dict:
|
|
1910
1923
|
"""Serializes the ExperimentPermission into a dictionary suitable for use as a JSON request body."""
|
|
@@ -1991,7 +2004,6 @@ class ExperimentPermissionsDescription:
|
|
|
1991
2004
|
description: Optional[str] = None
|
|
1992
2005
|
|
|
1993
2006
|
permission_level: Optional[ExperimentPermissionLevel] = None
|
|
1994
|
-
"""Permission level"""
|
|
1995
2007
|
|
|
1996
2008
|
def as_dict(self) -> dict:
|
|
1997
2009
|
"""Serializes the ExperimentPermissionsDescription into a dictionary suitable for use as a JSON request body."""
|
|
@@ -2088,6 +2100,241 @@ class ExperimentTag:
|
|
|
2088
2100
|
return cls(key=d.get("key", None), value=d.get("value", None))
|
|
2089
2101
|
|
|
2090
2102
|
|
|
2103
|
+
@dataclass
|
|
2104
|
+
class Feature:
|
|
2105
|
+
"""Feature for model version."""
|
|
2106
|
+
|
|
2107
|
+
feature_name: Optional[str] = None
|
|
2108
|
+
"""Feature name"""
|
|
2109
|
+
|
|
2110
|
+
feature_table_id: Optional[str] = None
|
|
2111
|
+
"""Feature table id"""
|
|
2112
|
+
|
|
2113
|
+
feature_table_name: Optional[str] = None
|
|
2114
|
+
"""Feature table name"""
|
|
2115
|
+
|
|
2116
|
+
def as_dict(self) -> dict:
|
|
2117
|
+
"""Serializes the Feature into a dictionary suitable for use as a JSON request body."""
|
|
2118
|
+
body = {}
|
|
2119
|
+
if self.feature_name is not None:
|
|
2120
|
+
body["feature_name"] = self.feature_name
|
|
2121
|
+
if self.feature_table_id is not None:
|
|
2122
|
+
body["feature_table_id"] = self.feature_table_id
|
|
2123
|
+
if self.feature_table_name is not None:
|
|
2124
|
+
body["feature_table_name"] = self.feature_table_name
|
|
2125
|
+
return body
|
|
2126
|
+
|
|
2127
|
+
def as_shallow_dict(self) -> dict:
|
|
2128
|
+
"""Serializes the Feature into a shallow dictionary of its immediate attributes."""
|
|
2129
|
+
body = {}
|
|
2130
|
+
if self.feature_name is not None:
|
|
2131
|
+
body["feature_name"] = self.feature_name
|
|
2132
|
+
if self.feature_table_id is not None:
|
|
2133
|
+
body["feature_table_id"] = self.feature_table_id
|
|
2134
|
+
if self.feature_table_name is not None:
|
|
2135
|
+
body["feature_table_name"] = self.feature_table_name
|
|
2136
|
+
return body
|
|
2137
|
+
|
|
2138
|
+
@classmethod
|
|
2139
|
+
def from_dict(cls, d: Dict[str, Any]) -> Feature:
|
|
2140
|
+
"""Deserializes the Feature from a dictionary."""
|
|
2141
|
+
return cls(
|
|
2142
|
+
feature_name=d.get("feature_name", None),
|
|
2143
|
+
feature_table_id=d.get("feature_table_id", None),
|
|
2144
|
+
feature_table_name=d.get("feature_table_name", None),
|
|
2145
|
+
)
|
|
2146
|
+
|
|
2147
|
+
|
|
2148
|
+
@dataclass
|
|
2149
|
+
class FeatureLineage:
|
|
2150
|
+
feature_specs: Optional[List[FeatureLineageFeatureSpec]] = None
|
|
2151
|
+
"""List of feature specs that contain this feature."""
|
|
2152
|
+
|
|
2153
|
+
models: Optional[List[FeatureLineageModel]] = None
|
|
2154
|
+
"""List of Unity Catalog models that were trained on this feature."""
|
|
2155
|
+
|
|
2156
|
+
online_features: Optional[List[FeatureLineageOnlineFeature]] = None
|
|
2157
|
+
"""List of online features that use this feature as source."""
|
|
2158
|
+
|
|
2159
|
+
def as_dict(self) -> dict:
|
|
2160
|
+
"""Serializes the FeatureLineage into a dictionary suitable for use as a JSON request body."""
|
|
2161
|
+
body = {}
|
|
2162
|
+
if self.feature_specs:
|
|
2163
|
+
body["feature_specs"] = [v.as_dict() for v in self.feature_specs]
|
|
2164
|
+
if self.models:
|
|
2165
|
+
body["models"] = [v.as_dict() for v in self.models]
|
|
2166
|
+
if self.online_features:
|
|
2167
|
+
body["online_features"] = [v.as_dict() for v in self.online_features]
|
|
2168
|
+
return body
|
|
2169
|
+
|
|
2170
|
+
def as_shallow_dict(self) -> dict:
|
|
2171
|
+
"""Serializes the FeatureLineage into a shallow dictionary of its immediate attributes."""
|
|
2172
|
+
body = {}
|
|
2173
|
+
if self.feature_specs:
|
|
2174
|
+
body["feature_specs"] = self.feature_specs
|
|
2175
|
+
if self.models:
|
|
2176
|
+
body["models"] = self.models
|
|
2177
|
+
if self.online_features:
|
|
2178
|
+
body["online_features"] = self.online_features
|
|
2179
|
+
return body
|
|
2180
|
+
|
|
2181
|
+
@classmethod
|
|
2182
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureLineage:
|
|
2183
|
+
"""Deserializes the FeatureLineage from a dictionary."""
|
|
2184
|
+
return cls(
|
|
2185
|
+
feature_specs=_repeated_dict(d, "feature_specs", FeatureLineageFeatureSpec),
|
|
2186
|
+
models=_repeated_dict(d, "models", FeatureLineageModel),
|
|
2187
|
+
online_features=_repeated_dict(d, "online_features", FeatureLineageOnlineFeature),
|
|
2188
|
+
)
|
|
2189
|
+
|
|
2190
|
+
|
|
2191
|
+
@dataclass
|
|
2192
|
+
class FeatureLineageFeatureSpec:
|
|
2193
|
+
name: Optional[str] = None
|
|
2194
|
+
"""The full name of the feature spec in Unity Catalog."""
|
|
2195
|
+
|
|
2196
|
+
def as_dict(self) -> dict:
|
|
2197
|
+
"""Serializes the FeatureLineageFeatureSpec into a dictionary suitable for use as a JSON request body."""
|
|
2198
|
+
body = {}
|
|
2199
|
+
if self.name is not None:
|
|
2200
|
+
body["name"] = self.name
|
|
2201
|
+
return body
|
|
2202
|
+
|
|
2203
|
+
def as_shallow_dict(self) -> dict:
|
|
2204
|
+
"""Serializes the FeatureLineageFeatureSpec into a shallow dictionary of its immediate attributes."""
|
|
2205
|
+
body = {}
|
|
2206
|
+
if self.name is not None:
|
|
2207
|
+
body["name"] = self.name
|
|
2208
|
+
return body
|
|
2209
|
+
|
|
2210
|
+
@classmethod
|
|
2211
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureLineageFeatureSpec:
|
|
2212
|
+
"""Deserializes the FeatureLineageFeatureSpec from a dictionary."""
|
|
2213
|
+
return cls(name=d.get("name", None))
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
@dataclass
|
|
2217
|
+
class FeatureLineageModel:
|
|
2218
|
+
name: Optional[str] = None
|
|
2219
|
+
"""The full name of the model in Unity Catalog."""
|
|
2220
|
+
|
|
2221
|
+
version: Optional[int] = None
|
|
2222
|
+
"""The version of the model."""
|
|
2223
|
+
|
|
2224
|
+
def as_dict(self) -> dict:
|
|
2225
|
+
"""Serializes the FeatureLineageModel into a dictionary suitable for use as a JSON request body."""
|
|
2226
|
+
body = {}
|
|
2227
|
+
if self.name is not None:
|
|
2228
|
+
body["name"] = self.name
|
|
2229
|
+
if self.version is not None:
|
|
2230
|
+
body["version"] = self.version
|
|
2231
|
+
return body
|
|
2232
|
+
|
|
2233
|
+
def as_shallow_dict(self) -> dict:
|
|
2234
|
+
"""Serializes the FeatureLineageModel into a shallow dictionary of its immediate attributes."""
|
|
2235
|
+
body = {}
|
|
2236
|
+
if self.name is not None:
|
|
2237
|
+
body["name"] = self.name
|
|
2238
|
+
if self.version is not None:
|
|
2239
|
+
body["version"] = self.version
|
|
2240
|
+
return body
|
|
2241
|
+
|
|
2242
|
+
@classmethod
|
|
2243
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureLineageModel:
|
|
2244
|
+
"""Deserializes the FeatureLineageModel from a dictionary."""
|
|
2245
|
+
return cls(name=d.get("name", None), version=d.get("version", None))
|
|
2246
|
+
|
|
2247
|
+
|
|
2248
|
+
@dataclass
|
|
2249
|
+
class FeatureLineageOnlineFeature:
|
|
2250
|
+
feature_name: Optional[str] = None
|
|
2251
|
+
"""The name of the online feature (column name)."""
|
|
2252
|
+
|
|
2253
|
+
table_name: Optional[str] = None
|
|
2254
|
+
"""The full name of the online table in Unity Catalog."""
|
|
2255
|
+
|
|
2256
|
+
def as_dict(self) -> dict:
|
|
2257
|
+
"""Serializes the FeatureLineageOnlineFeature into a dictionary suitable for use as a JSON request body."""
|
|
2258
|
+
body = {}
|
|
2259
|
+
if self.feature_name is not None:
|
|
2260
|
+
body["feature_name"] = self.feature_name
|
|
2261
|
+
if self.table_name is not None:
|
|
2262
|
+
body["table_name"] = self.table_name
|
|
2263
|
+
return body
|
|
2264
|
+
|
|
2265
|
+
def as_shallow_dict(self) -> dict:
|
|
2266
|
+
"""Serializes the FeatureLineageOnlineFeature into a shallow dictionary of its immediate attributes."""
|
|
2267
|
+
body = {}
|
|
2268
|
+
if self.feature_name is not None:
|
|
2269
|
+
body["feature_name"] = self.feature_name
|
|
2270
|
+
if self.table_name is not None:
|
|
2271
|
+
body["table_name"] = self.table_name
|
|
2272
|
+
return body
|
|
2273
|
+
|
|
2274
|
+
@classmethod
|
|
2275
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureLineageOnlineFeature:
|
|
2276
|
+
"""Deserializes the FeatureLineageOnlineFeature from a dictionary."""
|
|
2277
|
+
return cls(feature_name=d.get("feature_name", None), table_name=d.get("table_name", None))
|
|
2278
|
+
|
|
2279
|
+
|
|
2280
|
+
@dataclass
|
|
2281
|
+
class FeatureList:
|
|
2282
|
+
"""Feature list wrap all the features for a model version"""
|
|
2283
|
+
|
|
2284
|
+
features: Optional[List[Feature]] = None
|
|
2285
|
+
|
|
2286
|
+
def as_dict(self) -> dict:
|
|
2287
|
+
"""Serializes the FeatureList into a dictionary suitable for use as a JSON request body."""
|
|
2288
|
+
body = {}
|
|
2289
|
+
if self.features:
|
|
2290
|
+
body["features"] = [v.as_dict() for v in self.features]
|
|
2291
|
+
return body
|
|
2292
|
+
|
|
2293
|
+
def as_shallow_dict(self) -> dict:
|
|
2294
|
+
"""Serializes the FeatureList into a shallow dictionary of its immediate attributes."""
|
|
2295
|
+
body = {}
|
|
2296
|
+
if self.features:
|
|
2297
|
+
body["features"] = self.features
|
|
2298
|
+
return body
|
|
2299
|
+
|
|
2300
|
+
@classmethod
|
|
2301
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureList:
|
|
2302
|
+
"""Deserializes the FeatureList from a dictionary."""
|
|
2303
|
+
return cls(features=_repeated_dict(d, "features", Feature))
|
|
2304
|
+
|
|
2305
|
+
|
|
2306
|
+
@dataclass
|
|
2307
|
+
class FeatureTag:
|
|
2308
|
+
"""Represents a tag on a feature in a feature table."""
|
|
2309
|
+
|
|
2310
|
+
key: str
|
|
2311
|
+
|
|
2312
|
+
value: Optional[str] = None
|
|
2313
|
+
|
|
2314
|
+
def as_dict(self) -> dict:
|
|
2315
|
+
"""Serializes the FeatureTag into a dictionary suitable for use as a JSON request body."""
|
|
2316
|
+
body = {}
|
|
2317
|
+
if self.key is not None:
|
|
2318
|
+
body["key"] = self.key
|
|
2319
|
+
if self.value is not None:
|
|
2320
|
+
body["value"] = self.value
|
|
2321
|
+
return body
|
|
2322
|
+
|
|
2323
|
+
def as_shallow_dict(self) -> dict:
|
|
2324
|
+
"""Serializes the FeatureTag into a shallow dictionary of its immediate attributes."""
|
|
2325
|
+
body = {}
|
|
2326
|
+
if self.key is not None:
|
|
2327
|
+
body["key"] = self.key
|
|
2328
|
+
if self.value is not None:
|
|
2329
|
+
body["value"] = self.value
|
|
2330
|
+
return body
|
|
2331
|
+
|
|
2332
|
+
@classmethod
|
|
2333
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureTag:
|
|
2334
|
+
"""Deserializes the FeatureTag from a dictionary."""
|
|
2335
|
+
return cls(key=d.get("key", None), value=d.get("value", None))
|
|
2336
|
+
|
|
2337
|
+
|
|
2091
2338
|
@dataclass
|
|
2092
2339
|
class FileInfo:
|
|
2093
2340
|
"""Metadata of a single artifact file or directory."""
|
|
@@ -2735,9 +2982,8 @@ class JobSpecWithoutSecret:
|
|
|
2735
2982
|
"""ID of the job that the webhook runs."""
|
|
2736
2983
|
|
|
2737
2984
|
workspace_url: Optional[str] = None
|
|
2738
|
-
"""URL of the workspace containing the job that this webhook runs.
|
|
2739
|
-
|
|
2740
|
-
as the webhook’s."""
|
|
2985
|
+
"""URL of the workspace containing the job that this webhook runs. If not specified, the job’s
|
|
2986
|
+
workspace URL is assumed to be the same as the workspace where the webhook is created."""
|
|
2741
2987
|
|
|
2742
2988
|
def as_dict(self) -> dict:
|
|
2743
2989
|
"""Serializes the JobSpecWithoutSecret into a dictionary suitable for use as a JSON request body."""
|
|
@@ -2841,6 +3087,41 @@ class ListExperimentsResponse:
|
|
|
2841
3087
|
)
|
|
2842
3088
|
|
|
2843
3089
|
|
|
3090
|
+
@dataclass
|
|
3091
|
+
class ListFeatureTagsResponse:
|
|
3092
|
+
"""Response message for ListFeatureTag."""
|
|
3093
|
+
|
|
3094
|
+
feature_tags: Optional[List[FeatureTag]] = None
|
|
3095
|
+
|
|
3096
|
+
next_page_token: Optional[str] = None
|
|
3097
|
+
"""Pagination token to request the next page of results for this query."""
|
|
3098
|
+
|
|
3099
|
+
def as_dict(self) -> dict:
|
|
3100
|
+
"""Serializes the ListFeatureTagsResponse into a dictionary suitable for use as a JSON request body."""
|
|
3101
|
+
body = {}
|
|
3102
|
+
if self.feature_tags:
|
|
3103
|
+
body["feature_tags"] = [v.as_dict() for v in self.feature_tags]
|
|
3104
|
+
if self.next_page_token is not None:
|
|
3105
|
+
body["next_page_token"] = self.next_page_token
|
|
3106
|
+
return body
|
|
3107
|
+
|
|
3108
|
+
def as_shallow_dict(self) -> dict:
|
|
3109
|
+
"""Serializes the ListFeatureTagsResponse into a shallow dictionary of its immediate attributes."""
|
|
3110
|
+
body = {}
|
|
3111
|
+
if self.feature_tags:
|
|
3112
|
+
body["feature_tags"] = self.feature_tags
|
|
3113
|
+
if self.next_page_token is not None:
|
|
3114
|
+
body["next_page_token"] = self.next_page_token
|
|
3115
|
+
return body
|
|
3116
|
+
|
|
3117
|
+
@classmethod
|
|
3118
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListFeatureTagsResponse:
|
|
3119
|
+
"""Deserializes the ListFeatureTagsResponse from a dictionary."""
|
|
3120
|
+
return cls(
|
|
3121
|
+
feature_tags=_repeated_dict(d, "feature_tags", FeatureTag), next_page_token=d.get("next_page_token", None)
|
|
3122
|
+
)
|
|
3123
|
+
|
|
3124
|
+
|
|
2844
3125
|
@dataclass
|
|
2845
3126
|
class ListModelsResponse:
|
|
2846
3127
|
next_page_token: Optional[str] = None
|
|
@@ -2875,6 +3156,41 @@ class ListModelsResponse:
|
|
|
2875
3156
|
)
|
|
2876
3157
|
|
|
2877
3158
|
|
|
3159
|
+
@dataclass
|
|
3160
|
+
class ListOnlineStoresResponse:
|
|
3161
|
+
next_page_token: Optional[str] = None
|
|
3162
|
+
"""Pagination token to request the next page of results for this query."""
|
|
3163
|
+
|
|
3164
|
+
online_stores: Optional[List[OnlineStore]] = None
|
|
3165
|
+
"""List of online stores."""
|
|
3166
|
+
|
|
3167
|
+
def as_dict(self) -> dict:
|
|
3168
|
+
"""Serializes the ListOnlineStoresResponse into a dictionary suitable for use as a JSON request body."""
|
|
3169
|
+
body = {}
|
|
3170
|
+
if self.next_page_token is not None:
|
|
3171
|
+
body["next_page_token"] = self.next_page_token
|
|
3172
|
+
if self.online_stores:
|
|
3173
|
+
body["online_stores"] = [v.as_dict() for v in self.online_stores]
|
|
3174
|
+
return body
|
|
3175
|
+
|
|
3176
|
+
def as_shallow_dict(self) -> dict:
|
|
3177
|
+
"""Serializes the ListOnlineStoresResponse into a shallow dictionary of its immediate attributes."""
|
|
3178
|
+
body = {}
|
|
3179
|
+
if self.next_page_token is not None:
|
|
3180
|
+
body["next_page_token"] = self.next_page_token
|
|
3181
|
+
if self.online_stores:
|
|
3182
|
+
body["online_stores"] = self.online_stores
|
|
3183
|
+
return body
|
|
3184
|
+
|
|
3185
|
+
@classmethod
|
|
3186
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListOnlineStoresResponse:
|
|
3187
|
+
"""Deserializes the ListOnlineStoresResponse from a dictionary."""
|
|
3188
|
+
return cls(
|
|
3189
|
+
next_page_token=d.get("next_page_token", None),
|
|
3190
|
+
online_stores=_repeated_dict(d, "online_stores", OnlineStore),
|
|
3191
|
+
)
|
|
3192
|
+
|
|
3193
|
+
|
|
2878
3194
|
@dataclass
|
|
2879
3195
|
class ListRegistryWebhooks:
|
|
2880
3196
|
next_page_token: Optional[str] = None
|
|
@@ -3839,7 +4155,7 @@ class ModelDatabricks:
|
|
|
3839
4155
|
"""Unique identifier for the object."""
|
|
3840
4156
|
|
|
3841
4157
|
last_updated_timestamp: Optional[int] = None
|
|
3842
|
-
"""
|
|
4158
|
+
"""Last update time of the object, as a Unix timestamp in milliseconds."""
|
|
3843
4159
|
|
|
3844
4160
|
latest_versions: Optional[List[ModelVersion]] = None
|
|
3845
4161
|
"""Array of model versions, each the latest version for its stage."""
|
|
@@ -3848,8 +4164,7 @@ class ModelDatabricks:
|
|
|
3848
4164
|
"""Name of the model."""
|
|
3849
4165
|
|
|
3850
4166
|
permission_level: Optional[PermissionLevel] = None
|
|
3851
|
-
"""Permission level
|
|
3852
|
-
[MLflow Model permissions](..)."""
|
|
4167
|
+
"""Permission level granted for the requesting user on this registered model"""
|
|
3853
4168
|
|
|
3854
4169
|
tags: Optional[List[ModelTag]] = None
|
|
3855
4170
|
"""Array of tags associated with the model."""
|
|
@@ -3982,6 +4297,8 @@ class ModelOutput:
|
|
|
3982
4297
|
|
|
3983
4298
|
@dataclass
|
|
3984
4299
|
class ModelTag:
|
|
4300
|
+
"""Tag for a registered model"""
|
|
4301
|
+
|
|
3985
4302
|
key: Optional[str] = None
|
|
3986
4303
|
"""The tag key."""
|
|
3987
4304
|
|
|
@@ -4141,29 +4458,29 @@ class ModelVersionDatabricks:
|
|
|
4141
4458
|
creation_timestamp: Optional[int] = None
|
|
4142
4459
|
"""Creation time of the object, as a Unix timestamp in milliseconds."""
|
|
4143
4460
|
|
|
4144
|
-
current_stage: Optional[
|
|
4145
|
-
"""Stage of the model version. Valid values are:
|
|
4146
|
-
|
|
4147
|
-
* `None`: The initial stage of a model version.
|
|
4148
|
-
|
|
4149
|
-
* `Staging`: Staging or pre-production stage.
|
|
4150
|
-
|
|
4151
|
-
* `Production`: Production stage.
|
|
4152
|
-
|
|
4153
|
-
* `Archived`: Archived stage."""
|
|
4461
|
+
current_stage: Optional[str] = None
|
|
4154
4462
|
|
|
4155
4463
|
description: Optional[str] = None
|
|
4156
4464
|
"""User-specified description for the object."""
|
|
4157
4465
|
|
|
4466
|
+
email_subscription_status: Optional[RegistryEmailSubscriptionType] = None
|
|
4467
|
+
"""Email Subscription Status: This is the subscription status of the user to the model version
|
|
4468
|
+
Users get subscribed by interacting with the model version."""
|
|
4469
|
+
|
|
4470
|
+
feature_list: Optional[FeatureList] = None
|
|
4471
|
+
"""Feature lineage of `model_version`."""
|
|
4472
|
+
|
|
4158
4473
|
last_updated_timestamp: Optional[int] = None
|
|
4159
4474
|
"""Time of the object at last update, as a Unix timestamp in milliseconds."""
|
|
4160
4475
|
|
|
4161
4476
|
name: Optional[str] = None
|
|
4162
4477
|
"""Name of the model."""
|
|
4163
4478
|
|
|
4479
|
+
open_requests: Optional[List[Activity]] = None
|
|
4480
|
+
"""Open requests for this `model_versions`. Gap in sequence number is intentional and is done in
|
|
4481
|
+
order to match field sequence numbers of `ModelVersion` proto message"""
|
|
4482
|
+
|
|
4164
4483
|
permission_level: Optional[PermissionLevel] = None
|
|
4165
|
-
"""Permission level of the requesting user on the object. For what is allowed at each level, see
|
|
4166
|
-
[MLflow Model permissions](..)."""
|
|
4167
4484
|
|
|
4168
4485
|
run_id: Optional[str] = None
|
|
4169
4486
|
"""Unique identifier for the MLflow tracking run associated with the source model artifacts."""
|
|
@@ -4178,12 +4495,6 @@ class ModelVersionDatabricks:
|
|
|
4178
4495
|
model version."""
|
|
4179
4496
|
|
|
4180
4497
|
status: Optional[Status] = None
|
|
4181
|
-
"""The status of the model version. Valid values are: * `PENDING_REGISTRATION`: Request to register
|
|
4182
|
-
a new model version is pending as server performs background tasks.
|
|
4183
|
-
|
|
4184
|
-
* `FAILED_REGISTRATION`: Request to register a new model version has failed.
|
|
4185
|
-
|
|
4186
|
-
* `READY`: Model version is ready for use."""
|
|
4187
4498
|
|
|
4188
4499
|
status_message: Optional[str] = None
|
|
4189
4500
|
"""Details on the current status, for example why registration failed."""
|
|
@@ -4203,13 +4514,19 @@ class ModelVersionDatabricks:
|
|
|
4203
4514
|
if self.creation_timestamp is not None:
|
|
4204
4515
|
body["creation_timestamp"] = self.creation_timestamp
|
|
4205
4516
|
if self.current_stage is not None:
|
|
4206
|
-
body["current_stage"] = self.current_stage
|
|
4517
|
+
body["current_stage"] = self.current_stage
|
|
4207
4518
|
if self.description is not None:
|
|
4208
4519
|
body["description"] = self.description
|
|
4520
|
+
if self.email_subscription_status is not None:
|
|
4521
|
+
body["email_subscription_status"] = self.email_subscription_status.value
|
|
4522
|
+
if self.feature_list:
|
|
4523
|
+
body["feature_list"] = self.feature_list.as_dict()
|
|
4209
4524
|
if self.last_updated_timestamp is not None:
|
|
4210
4525
|
body["last_updated_timestamp"] = self.last_updated_timestamp
|
|
4211
4526
|
if self.name is not None:
|
|
4212
4527
|
body["name"] = self.name
|
|
4528
|
+
if self.open_requests:
|
|
4529
|
+
body["open_requests"] = [v.as_dict() for v in self.open_requests]
|
|
4213
4530
|
if self.permission_level is not None:
|
|
4214
4531
|
body["permission_level"] = self.permission_level.value
|
|
4215
4532
|
if self.run_id is not None:
|
|
@@ -4239,10 +4556,16 @@ class ModelVersionDatabricks:
|
|
|
4239
4556
|
body["current_stage"] = self.current_stage
|
|
4240
4557
|
if self.description is not None:
|
|
4241
4558
|
body["description"] = self.description
|
|
4559
|
+
if self.email_subscription_status is not None:
|
|
4560
|
+
body["email_subscription_status"] = self.email_subscription_status
|
|
4561
|
+
if self.feature_list:
|
|
4562
|
+
body["feature_list"] = self.feature_list
|
|
4242
4563
|
if self.last_updated_timestamp is not None:
|
|
4243
4564
|
body["last_updated_timestamp"] = self.last_updated_timestamp
|
|
4244
4565
|
if self.name is not None:
|
|
4245
4566
|
body["name"] = self.name
|
|
4567
|
+
if self.open_requests:
|
|
4568
|
+
body["open_requests"] = self.open_requests
|
|
4246
4569
|
if self.permission_level is not None:
|
|
4247
4570
|
body["permission_level"] = self.permission_level
|
|
4248
4571
|
if self.run_id is not None:
|
|
@@ -4268,10 +4591,13 @@ class ModelVersionDatabricks:
|
|
|
4268
4591
|
"""Deserializes the ModelVersionDatabricks from a dictionary."""
|
|
4269
4592
|
return cls(
|
|
4270
4593
|
creation_timestamp=d.get("creation_timestamp", None),
|
|
4271
|
-
current_stage=
|
|
4594
|
+
current_stage=d.get("current_stage", None),
|
|
4272
4595
|
description=d.get("description", None),
|
|
4596
|
+
email_subscription_status=_enum(d, "email_subscription_status", RegistryEmailSubscriptionType),
|
|
4597
|
+
feature_list=_from_dict(d, "feature_list", FeatureList),
|
|
4273
4598
|
last_updated_timestamp=d.get("last_updated_timestamp", None),
|
|
4274
4599
|
name=d.get("name", None),
|
|
4600
|
+
open_requests=_repeated_dict(d, "open_requests", Activity),
|
|
4275
4601
|
permission_level=_enum(d, "permission_level", PermissionLevel),
|
|
4276
4602
|
run_id=d.get("run_id", None),
|
|
4277
4603
|
run_link=d.get("run_link", None),
|
|
@@ -4285,7 +4611,12 @@ class ModelVersionDatabricks:
|
|
|
4285
4611
|
|
|
4286
4612
|
|
|
4287
4613
|
class ModelVersionStatus(Enum):
|
|
4288
|
-
"""
|
|
4614
|
+
"""The status of the model version. Valid values are: * `PENDING_REGISTRATION`: Request to register
|
|
4615
|
+
a new model version is pending as server performs background tasks.
|
|
4616
|
+
|
|
4617
|
+
* `FAILED_REGISTRATION`: Request to register a new model version has failed.
|
|
4618
|
+
|
|
4619
|
+
* `READY`: Model version is ready for use."""
|
|
4289
4620
|
|
|
4290
4621
|
FAILED_REGISTRATION = "FAILED_REGISTRATION"
|
|
4291
4622
|
PENDING_REGISTRATION = "PENDING_REGISTRATION"
|
|
@@ -4324,6 +4655,77 @@ class ModelVersionTag:
|
|
|
4324
4655
|
return cls(key=d.get("key", None), value=d.get("value", None))
|
|
4325
4656
|
|
|
4326
4657
|
|
|
4658
|
+
@dataclass
|
|
4659
|
+
class OnlineStore:
|
|
4660
|
+
"""An OnlineStore is a logical database instance that stores and serves features online."""
|
|
4661
|
+
|
|
4662
|
+
name: str
|
|
4663
|
+
"""The name of the online store. This is the unique identifier for the online store."""
|
|
4664
|
+
|
|
4665
|
+
capacity: str
|
|
4666
|
+
"""The capacity of the online store. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"."""
|
|
4667
|
+
|
|
4668
|
+
creation_time: Optional[str] = None
|
|
4669
|
+
"""The timestamp when the online store was created."""
|
|
4670
|
+
|
|
4671
|
+
creator: Optional[str] = None
|
|
4672
|
+
"""The email of the creator of the online store."""
|
|
4673
|
+
|
|
4674
|
+
state: Optional[OnlineStoreState] = None
|
|
4675
|
+
"""The current state of the online store."""
|
|
4676
|
+
|
|
4677
|
+
def as_dict(self) -> dict:
|
|
4678
|
+
"""Serializes the OnlineStore into a dictionary suitable for use as a JSON request body."""
|
|
4679
|
+
body = {}
|
|
4680
|
+
if self.capacity is not None:
|
|
4681
|
+
body["capacity"] = self.capacity
|
|
4682
|
+
if self.creation_time is not None:
|
|
4683
|
+
body["creation_time"] = self.creation_time
|
|
4684
|
+
if self.creator is not None:
|
|
4685
|
+
body["creator"] = self.creator
|
|
4686
|
+
if self.name is not None:
|
|
4687
|
+
body["name"] = self.name
|
|
4688
|
+
if self.state is not None:
|
|
4689
|
+
body["state"] = self.state.value
|
|
4690
|
+
return body
|
|
4691
|
+
|
|
4692
|
+
def as_shallow_dict(self) -> dict:
|
|
4693
|
+
"""Serializes the OnlineStore into a shallow dictionary of its immediate attributes."""
|
|
4694
|
+
body = {}
|
|
4695
|
+
if self.capacity is not None:
|
|
4696
|
+
body["capacity"] = self.capacity
|
|
4697
|
+
if self.creation_time is not None:
|
|
4698
|
+
body["creation_time"] = self.creation_time
|
|
4699
|
+
if self.creator is not None:
|
|
4700
|
+
body["creator"] = self.creator
|
|
4701
|
+
if self.name is not None:
|
|
4702
|
+
body["name"] = self.name
|
|
4703
|
+
if self.state is not None:
|
|
4704
|
+
body["state"] = self.state
|
|
4705
|
+
return body
|
|
4706
|
+
|
|
4707
|
+
@classmethod
|
|
4708
|
+
def from_dict(cls, d: Dict[str, Any]) -> OnlineStore:
|
|
4709
|
+
"""Deserializes the OnlineStore from a dictionary."""
|
|
4710
|
+
return cls(
|
|
4711
|
+
capacity=d.get("capacity", None),
|
|
4712
|
+
creation_time=d.get("creation_time", None),
|
|
4713
|
+
creator=d.get("creator", None),
|
|
4714
|
+
name=d.get("name", None),
|
|
4715
|
+
state=_enum(d, "state", OnlineStoreState),
|
|
4716
|
+
)
|
|
4717
|
+
|
|
4718
|
+
|
|
4719
|
+
class OnlineStoreState(Enum):
|
|
4720
|
+
|
|
4721
|
+
AVAILABLE = "AVAILABLE"
|
|
4722
|
+
DELETING = "DELETING"
|
|
4723
|
+
FAILING_OVER = "FAILING_OVER"
|
|
4724
|
+
STARTING = "STARTING"
|
|
4725
|
+
STOPPED = "STOPPED"
|
|
4726
|
+
UPDATING = "UPDATING"
|
|
4727
|
+
|
|
4728
|
+
|
|
4327
4729
|
@dataclass
|
|
4328
4730
|
class Param:
|
|
4329
4731
|
"""Param associated with a run."""
|
|
@@ -4362,6 +4764,7 @@ class PermissionLevel(Enum):
|
|
|
4362
4764
|
"""Permission level of the requesting user on the object. For what is allowed at each level, see
|
|
4363
4765
|
[MLflow Model permissions](..)."""
|
|
4364
4766
|
|
|
4767
|
+
CAN_CREATE_REGISTERED_MODEL = "CAN_CREATE_REGISTERED_MODEL"
|
|
4365
4768
|
CAN_EDIT = "CAN_EDIT"
|
|
4366
4769
|
CAN_MANAGE = "CAN_MANAGE"
|
|
4367
4770
|
CAN_MANAGE_PRODUCTION_VERSIONS = "CAN_MANAGE_PRODUCTION_VERSIONS"
|
|
@@ -4369,13 +4772,129 @@ class PermissionLevel(Enum):
|
|
|
4369
4772
|
CAN_READ = "CAN_READ"
|
|
4370
4773
|
|
|
4371
4774
|
|
|
4775
|
+
@dataclass
|
|
4776
|
+
class PublishSpec:
|
|
4777
|
+
online_store: str
|
|
4778
|
+
"""The name of the target online store."""
|
|
4779
|
+
|
|
4780
|
+
online_table_name: str
|
|
4781
|
+
"""The full three-part (catalog, schema, table) name of the online table."""
|
|
4782
|
+
|
|
4783
|
+
publish_mode: Optional[PublishSpecPublishMode] = None
|
|
4784
|
+
"""The publish mode of the pipeline that syncs the online table with the source table. Defaults to
|
|
4785
|
+
TRIGGERED if not specified. All publish modes require the source table to have Change Data Feed
|
|
4786
|
+
(CDF) enabled."""
|
|
4787
|
+
|
|
4788
|
+
def as_dict(self) -> dict:
|
|
4789
|
+
"""Serializes the PublishSpec into a dictionary suitable for use as a JSON request body."""
|
|
4790
|
+
body = {}
|
|
4791
|
+
if self.online_store is not None:
|
|
4792
|
+
body["online_store"] = self.online_store
|
|
4793
|
+
if self.online_table_name is not None:
|
|
4794
|
+
body["online_table_name"] = self.online_table_name
|
|
4795
|
+
if self.publish_mode is not None:
|
|
4796
|
+
body["publish_mode"] = self.publish_mode.value
|
|
4797
|
+
return body
|
|
4798
|
+
|
|
4799
|
+
def as_shallow_dict(self) -> dict:
|
|
4800
|
+
"""Serializes the PublishSpec into a shallow dictionary of its immediate attributes."""
|
|
4801
|
+
body = {}
|
|
4802
|
+
if self.online_store is not None:
|
|
4803
|
+
body["online_store"] = self.online_store
|
|
4804
|
+
if self.online_table_name is not None:
|
|
4805
|
+
body["online_table_name"] = self.online_table_name
|
|
4806
|
+
if self.publish_mode is not None:
|
|
4807
|
+
body["publish_mode"] = self.publish_mode
|
|
4808
|
+
return body
|
|
4809
|
+
|
|
4810
|
+
@classmethod
|
|
4811
|
+
def from_dict(cls, d: Dict[str, Any]) -> PublishSpec:
|
|
4812
|
+
"""Deserializes the PublishSpec from a dictionary."""
|
|
4813
|
+
return cls(
|
|
4814
|
+
online_store=d.get("online_store", None),
|
|
4815
|
+
online_table_name=d.get("online_table_name", None),
|
|
4816
|
+
publish_mode=_enum(d, "publish_mode", PublishSpecPublishMode),
|
|
4817
|
+
)
|
|
4818
|
+
|
|
4819
|
+
|
|
4820
|
+
class PublishSpecPublishMode(Enum):
|
|
4821
|
+
|
|
4822
|
+
CONTINUOUS = "CONTINUOUS"
|
|
4823
|
+
TRIGGERED = "TRIGGERED"
|
|
4824
|
+
|
|
4825
|
+
|
|
4826
|
+
@dataclass
|
|
4827
|
+
class PublishTableRequest:
|
|
4828
|
+
publish_spec: PublishSpec
|
|
4829
|
+
"""The specification for publishing the online table from the source table."""
|
|
4830
|
+
|
|
4831
|
+
source_table_name: Optional[str] = None
|
|
4832
|
+
"""The full three-part (catalog, schema, table) name of the source table."""
|
|
4833
|
+
|
|
4834
|
+
def as_dict(self) -> dict:
|
|
4835
|
+
"""Serializes the PublishTableRequest into a dictionary suitable for use as a JSON request body."""
|
|
4836
|
+
body = {}
|
|
4837
|
+
if self.publish_spec:
|
|
4838
|
+
body["publish_spec"] = self.publish_spec.as_dict()
|
|
4839
|
+
if self.source_table_name is not None:
|
|
4840
|
+
body["source_table_name"] = self.source_table_name
|
|
4841
|
+
return body
|
|
4842
|
+
|
|
4843
|
+
def as_shallow_dict(self) -> dict:
|
|
4844
|
+
"""Serializes the PublishTableRequest into a shallow dictionary of its immediate attributes."""
|
|
4845
|
+
body = {}
|
|
4846
|
+
if self.publish_spec:
|
|
4847
|
+
body["publish_spec"] = self.publish_spec
|
|
4848
|
+
if self.source_table_name is not None:
|
|
4849
|
+
body["source_table_name"] = self.source_table_name
|
|
4850
|
+
return body
|
|
4851
|
+
|
|
4852
|
+
@classmethod
|
|
4853
|
+
def from_dict(cls, d: Dict[str, Any]) -> PublishTableRequest:
|
|
4854
|
+
"""Deserializes the PublishTableRequest from a dictionary."""
|
|
4855
|
+
return cls(
|
|
4856
|
+
publish_spec=_from_dict(d, "publish_spec", PublishSpec), source_table_name=d.get("source_table_name", None)
|
|
4857
|
+
)
|
|
4858
|
+
|
|
4859
|
+
|
|
4860
|
+
@dataclass
|
|
4861
|
+
class PublishTableResponse:
|
|
4862
|
+
online_table_name: Optional[str] = None
|
|
4863
|
+
"""The full three-part (catalog, schema, table) name of the online table."""
|
|
4864
|
+
|
|
4865
|
+
pipeline_id: Optional[str] = None
|
|
4866
|
+
"""The ID of the pipeline that syncs the online table with the source table."""
|
|
4867
|
+
|
|
4868
|
+
def as_dict(self) -> dict:
|
|
4869
|
+
"""Serializes the PublishTableResponse into a dictionary suitable for use as a JSON request body."""
|
|
4870
|
+
body = {}
|
|
4871
|
+
if self.online_table_name is not None:
|
|
4872
|
+
body["online_table_name"] = self.online_table_name
|
|
4873
|
+
if self.pipeline_id is not None:
|
|
4874
|
+
body["pipeline_id"] = self.pipeline_id
|
|
4875
|
+
return body
|
|
4876
|
+
|
|
4877
|
+
def as_shallow_dict(self) -> dict:
|
|
4878
|
+
"""Serializes the PublishTableResponse into a shallow dictionary of its immediate attributes."""
|
|
4879
|
+
body = {}
|
|
4880
|
+
if self.online_table_name is not None:
|
|
4881
|
+
body["online_table_name"] = self.online_table_name
|
|
4882
|
+
if self.pipeline_id is not None:
|
|
4883
|
+
body["pipeline_id"] = self.pipeline_id
|
|
4884
|
+
return body
|
|
4885
|
+
|
|
4886
|
+
@classmethod
|
|
4887
|
+
def from_dict(cls, d: Dict[str, Any]) -> PublishTableResponse:
|
|
4888
|
+
"""Deserializes the PublishTableResponse from a dictionary."""
|
|
4889
|
+
return cls(online_table_name=d.get("online_table_name", None), pipeline_id=d.get("pipeline_id", None))
|
|
4890
|
+
|
|
4891
|
+
|
|
4372
4892
|
@dataclass
|
|
4373
4893
|
class RegisteredModelAccessControlRequest:
|
|
4374
4894
|
group_name: Optional[str] = None
|
|
4375
4895
|
"""name of the group"""
|
|
4376
4896
|
|
|
4377
4897
|
permission_level: Optional[RegisteredModelPermissionLevel] = None
|
|
4378
|
-
"""Permission level"""
|
|
4379
4898
|
|
|
4380
4899
|
service_principal_name: Optional[str] = None
|
|
4381
4900
|
"""application ID of a service principal"""
|
|
@@ -4486,7 +5005,6 @@ class RegisteredModelPermission:
|
|
|
4486
5005
|
inherited_from_object: Optional[List[str]] = None
|
|
4487
5006
|
|
|
4488
5007
|
permission_level: Optional[RegisteredModelPermissionLevel] = None
|
|
4489
|
-
"""Permission level"""
|
|
4490
5008
|
|
|
4491
5009
|
def as_dict(self) -> dict:
|
|
4492
5010
|
"""Serializes the RegisteredModelPermission into a dictionary suitable for use as a JSON request body."""
|
|
@@ -4575,7 +5093,6 @@ class RegisteredModelPermissionsDescription:
|
|
|
4575
5093
|
description: Optional[str] = None
|
|
4576
5094
|
|
|
4577
5095
|
permission_level: Optional[RegisteredModelPermissionLevel] = None
|
|
4578
|
-
"""Permission level"""
|
|
4579
5096
|
|
|
4580
5097
|
def as_dict(self) -> dict:
|
|
4581
5098
|
"""Serializes the RegisteredModelPermissionsDescription into a dictionary suitable for use as a JSON request body."""
|
|
@@ -4638,6 +5155,18 @@ class RegisteredModelPermissionsRequest:
|
|
|
4638
5155
|
)
|
|
4639
5156
|
|
|
4640
5157
|
|
|
5158
|
+
class RegistryEmailSubscriptionType(Enum):
|
|
5159
|
+
""".. note:: Experimental: This entity may change or be removed in a future release without
|
|
5160
|
+
warning. Email subscription types for registry notifications: - `ALL_EVENTS`: Subscribed to all
|
|
5161
|
+
events. - `DEFAULT`: Default subscription type. - `SUBSCRIBED`: Subscribed to notifications. -
|
|
5162
|
+
`UNSUBSCRIBED`: Not subscribed to notifications."""
|
|
5163
|
+
|
|
5164
|
+
ALL_EVENTS = "ALL_EVENTS"
|
|
5165
|
+
DEFAULT = "DEFAULT"
|
|
5166
|
+
SUBSCRIBED = "SUBSCRIBED"
|
|
5167
|
+
UNSUBSCRIBED = "UNSUBSCRIBED"
|
|
5168
|
+
|
|
5169
|
+
|
|
4641
5170
|
@dataclass
|
|
4642
5171
|
class RegistryWebhook:
|
|
4643
5172
|
creation_timestamp: Optional[int] = None
|
|
@@ -4690,13 +5219,6 @@ class RegistryWebhook:
|
|
|
4690
5219
|
"""Name of the model whose events would trigger this webhook."""
|
|
4691
5220
|
|
|
4692
5221
|
status: Optional[RegistryWebhookStatus] = None
|
|
4693
|
-
"""Enable or disable triggering the webhook, or put the webhook into test mode. The default is
|
|
4694
|
-
`ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.
|
|
4695
|
-
|
|
4696
|
-
* `DISABLED`: Webhook is not triggered.
|
|
4697
|
-
|
|
4698
|
-
* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a
|
|
4699
|
-
real event."""
|
|
4700
5222
|
|
|
4701
5223
|
def as_dict(self) -> dict:
|
|
4702
5224
|
"""Serializes the RegistryWebhook into a dictionary suitable for use as a JSON request body."""
|
|
@@ -4792,13 +5314,15 @@ class RegistryWebhookStatus(Enum):
|
|
|
4792
5314
|
|
|
4793
5315
|
@dataclass
|
|
4794
5316
|
class RejectTransitionRequest:
|
|
5317
|
+
"""Details required to identify and reject a model version stage transition request."""
|
|
5318
|
+
|
|
4795
5319
|
name: str
|
|
4796
5320
|
"""Name of the model."""
|
|
4797
5321
|
|
|
4798
5322
|
version: str
|
|
4799
5323
|
"""Version of the model."""
|
|
4800
5324
|
|
|
4801
|
-
stage:
|
|
5325
|
+
stage: str
|
|
4802
5326
|
"""Target stage of the transition. Valid values are:
|
|
4803
5327
|
|
|
4804
5328
|
* `None`: The initial stage of a model version.
|
|
@@ -4820,7 +5344,7 @@ class RejectTransitionRequest:
|
|
|
4820
5344
|
if self.name is not None:
|
|
4821
5345
|
body["name"] = self.name
|
|
4822
5346
|
if self.stage is not None:
|
|
4823
|
-
body["stage"] = self.stage
|
|
5347
|
+
body["stage"] = self.stage
|
|
4824
5348
|
if self.version is not None:
|
|
4825
5349
|
body["version"] = self.version
|
|
4826
5350
|
return body
|
|
@@ -4844,7 +5368,7 @@ class RejectTransitionRequest:
|
|
|
4844
5368
|
return cls(
|
|
4845
5369
|
comment=d.get("comment", None),
|
|
4846
5370
|
name=d.get("name", None),
|
|
4847
|
-
stage=
|
|
5371
|
+
stage=d.get("stage", None),
|
|
4848
5372
|
version=d.get("version", None),
|
|
4849
5373
|
)
|
|
4850
5374
|
|
|
@@ -4852,7 +5376,7 @@ class RejectTransitionRequest:
|
|
|
4852
5376
|
@dataclass
|
|
4853
5377
|
class RejectTransitionRequestResponse:
|
|
4854
5378
|
activity: Optional[Activity] = None
|
|
4855
|
-
"""
|
|
5379
|
+
"""New activity generated as a result of this operation."""
|
|
4856
5380
|
|
|
4857
5381
|
def as_dict(self) -> dict:
|
|
4858
5382
|
"""Serializes the RejectTransitionRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -6140,23 +6664,6 @@ class SetTagResponse:
|
|
|
6140
6664
|
return cls()
|
|
6141
6665
|
|
|
6142
6666
|
|
|
6143
|
-
class Stage(Enum):
|
|
6144
|
-
"""Stage of the model version. Valid values are:
|
|
6145
|
-
|
|
6146
|
-
* `None`: The initial stage of a model version.
|
|
6147
|
-
|
|
6148
|
-
* `Staging`: Staging or pre-production stage.
|
|
6149
|
-
|
|
6150
|
-
* `Production`: Production stage.
|
|
6151
|
-
|
|
6152
|
-
* `Archived`: Archived stage."""
|
|
6153
|
-
|
|
6154
|
-
ARCHIVED = "Archived"
|
|
6155
|
-
NONE = "None"
|
|
6156
|
-
PRODUCTION = "Production"
|
|
6157
|
-
STAGING = "Staging"
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
6667
|
class Status(Enum):
|
|
6161
6668
|
"""The status of the model version. Valid values are: * `PENDING_REGISTRATION`: Request to register
|
|
6162
6669
|
a new model version is pending as server performs background tasks.
|
|
@@ -6170,42 +6677,10 @@ class Status(Enum):
|
|
|
6170
6677
|
READY = "READY"
|
|
6171
6678
|
|
|
6172
6679
|
|
|
6173
|
-
@dataclass
|
|
6174
|
-
class TestRegistryWebhook:
|
|
6175
|
-
"""Test webhook response object."""
|
|
6176
|
-
|
|
6177
|
-
body: Optional[str] = None
|
|
6178
|
-
"""Body of the response from the webhook URL"""
|
|
6179
|
-
|
|
6180
|
-
status_code: Optional[int] = None
|
|
6181
|
-
"""Status code returned by the webhook URL"""
|
|
6182
|
-
|
|
6183
|
-
def as_dict(self) -> dict:
|
|
6184
|
-
"""Serializes the TestRegistryWebhook into a dictionary suitable for use as a JSON request body."""
|
|
6185
|
-
body = {}
|
|
6186
|
-
if self.body is not None:
|
|
6187
|
-
body["body"] = self.body
|
|
6188
|
-
if self.status_code is not None:
|
|
6189
|
-
body["status_code"] = self.status_code
|
|
6190
|
-
return body
|
|
6191
|
-
|
|
6192
|
-
def as_shallow_dict(self) -> dict:
|
|
6193
|
-
"""Serializes the TestRegistryWebhook into a shallow dictionary of its immediate attributes."""
|
|
6194
|
-
body = {}
|
|
6195
|
-
if self.body is not None:
|
|
6196
|
-
body["body"] = self.body
|
|
6197
|
-
if self.status_code is not None:
|
|
6198
|
-
body["status_code"] = self.status_code
|
|
6199
|
-
return body
|
|
6200
|
-
|
|
6201
|
-
@classmethod
|
|
6202
|
-
def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhook:
|
|
6203
|
-
"""Deserializes the TestRegistryWebhook from a dictionary."""
|
|
6204
|
-
return cls(body=d.get("body", None), status_code=d.get("status_code", None))
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
6680
|
@dataclass
|
|
6208
6681
|
class TestRegistryWebhookRequest:
|
|
6682
|
+
"""Details required to test a registry webhook."""
|
|
6683
|
+
|
|
6209
6684
|
id: str
|
|
6210
6685
|
"""Webhook ID"""
|
|
6211
6686
|
|
|
@@ -6239,38 +6714,47 @@ class TestRegistryWebhookRequest:
|
|
|
6239
6714
|
|
|
6240
6715
|
@dataclass
|
|
6241
6716
|
class TestRegistryWebhookResponse:
|
|
6242
|
-
|
|
6243
|
-
"""
|
|
6717
|
+
body: Optional[str] = None
|
|
6718
|
+
"""Body of the response from the webhook URL"""
|
|
6719
|
+
|
|
6720
|
+
status_code: Optional[int] = None
|
|
6721
|
+
"""Status code returned by the webhook URL"""
|
|
6244
6722
|
|
|
6245
6723
|
def as_dict(self) -> dict:
|
|
6246
6724
|
"""Serializes the TestRegistryWebhookResponse into a dictionary suitable for use as a JSON request body."""
|
|
6247
6725
|
body = {}
|
|
6248
|
-
if self.
|
|
6249
|
-
body["
|
|
6726
|
+
if self.body is not None:
|
|
6727
|
+
body["body"] = self.body
|
|
6728
|
+
if self.status_code is not None:
|
|
6729
|
+
body["status_code"] = self.status_code
|
|
6250
6730
|
return body
|
|
6251
6731
|
|
|
6252
6732
|
def as_shallow_dict(self) -> dict:
|
|
6253
6733
|
"""Serializes the TestRegistryWebhookResponse into a shallow dictionary of its immediate attributes."""
|
|
6254
6734
|
body = {}
|
|
6255
|
-
if self.
|
|
6256
|
-
body["
|
|
6735
|
+
if self.body is not None:
|
|
6736
|
+
body["body"] = self.body
|
|
6737
|
+
if self.status_code is not None:
|
|
6738
|
+
body["status_code"] = self.status_code
|
|
6257
6739
|
return body
|
|
6258
6740
|
|
|
6259
6741
|
@classmethod
|
|
6260
6742
|
def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookResponse:
|
|
6261
6743
|
"""Deserializes the TestRegistryWebhookResponse from a dictionary."""
|
|
6262
|
-
return cls(
|
|
6744
|
+
return cls(body=d.get("body", None), status_code=d.get("status_code", None))
|
|
6263
6745
|
|
|
6264
6746
|
|
|
6265
6747
|
@dataclass
|
|
6266
6748
|
class TransitionModelVersionStageDatabricks:
|
|
6749
|
+
"""Details required to transition a model version's stage."""
|
|
6750
|
+
|
|
6267
6751
|
name: str
|
|
6268
6752
|
"""Name of the model."""
|
|
6269
6753
|
|
|
6270
6754
|
version: str
|
|
6271
6755
|
"""Version of the model."""
|
|
6272
6756
|
|
|
6273
|
-
stage:
|
|
6757
|
+
stage: str
|
|
6274
6758
|
"""Target stage of the transition. Valid values are:
|
|
6275
6759
|
|
|
6276
6760
|
* `None`: The initial stage of a model version.
|
|
@@ -6297,7 +6781,7 @@ class TransitionModelVersionStageDatabricks:
|
|
|
6297
6781
|
if self.name is not None:
|
|
6298
6782
|
body["name"] = self.name
|
|
6299
6783
|
if self.stage is not None:
|
|
6300
|
-
body["stage"] = self.stage
|
|
6784
|
+
body["stage"] = self.stage
|
|
6301
6785
|
if self.version is not None:
|
|
6302
6786
|
body["version"] = self.version
|
|
6303
6787
|
return body
|
|
@@ -6324,25 +6808,26 @@ class TransitionModelVersionStageDatabricks:
|
|
|
6324
6808
|
archive_existing_versions=d.get("archive_existing_versions", None),
|
|
6325
6809
|
comment=d.get("comment", None),
|
|
6326
6810
|
name=d.get("name", None),
|
|
6327
|
-
stage=
|
|
6811
|
+
stage=d.get("stage", None),
|
|
6328
6812
|
version=d.get("version", None),
|
|
6329
6813
|
)
|
|
6330
6814
|
|
|
6331
6815
|
|
|
6332
6816
|
@dataclass
|
|
6333
6817
|
class TransitionRequest:
|
|
6334
|
-
"""
|
|
6818
|
+
"""For activities, this contains the activity recorded for the action. For comments, this contains
|
|
6819
|
+
the comment details. For transition requests, this contains the transition request details."""
|
|
6335
6820
|
|
|
6336
6821
|
available_actions: Optional[List[ActivityAction]] = None
|
|
6337
6822
|
"""Array of actions on the activity allowed for the current viewer."""
|
|
6338
6823
|
|
|
6339
6824
|
comment: Optional[str] = None
|
|
6340
|
-
"""User-provided comment associated with the transition request."""
|
|
6825
|
+
"""User-provided comment associated with the activity, comment, or transition request."""
|
|
6341
6826
|
|
|
6342
6827
|
creation_timestamp: Optional[int] = None
|
|
6343
6828
|
"""Creation time of the object, as a Unix timestamp in milliseconds."""
|
|
6344
6829
|
|
|
6345
|
-
to_stage: Optional[
|
|
6830
|
+
to_stage: Optional[str] = None
|
|
6346
6831
|
"""Target stage of the transition (if the activity is stage transition related). Valid values are:
|
|
6347
6832
|
|
|
6348
6833
|
* `None`: The initial stage of a model version.
|
|
@@ -6366,7 +6851,7 @@ class TransitionRequest:
|
|
|
6366
6851
|
if self.creation_timestamp is not None:
|
|
6367
6852
|
body["creation_timestamp"] = self.creation_timestamp
|
|
6368
6853
|
if self.to_stage is not None:
|
|
6369
|
-
body["to_stage"] = self.to_stage
|
|
6854
|
+
body["to_stage"] = self.to_stage
|
|
6370
6855
|
if self.user_id is not None:
|
|
6371
6856
|
body["user_id"] = self.user_id
|
|
6372
6857
|
return body
|
|
@@ -6393,37 +6878,40 @@ class TransitionRequest:
|
|
|
6393
6878
|
available_actions=_repeated_enum(d, "available_actions", ActivityAction),
|
|
6394
6879
|
comment=d.get("comment", None),
|
|
6395
6880
|
creation_timestamp=d.get("creation_timestamp", None),
|
|
6396
|
-
to_stage=
|
|
6881
|
+
to_stage=d.get("to_stage", None),
|
|
6397
6882
|
user_id=d.get("user_id", None),
|
|
6398
6883
|
)
|
|
6399
6884
|
|
|
6400
6885
|
|
|
6401
6886
|
@dataclass
|
|
6402
6887
|
class TransitionStageResponse:
|
|
6403
|
-
|
|
6888
|
+
model_version_databricks: Optional[ModelVersionDatabricks] = None
|
|
6889
|
+
"""Updated model version"""
|
|
6404
6890
|
|
|
6405
6891
|
def as_dict(self) -> dict:
|
|
6406
6892
|
"""Serializes the TransitionStageResponse into a dictionary suitable for use as a JSON request body."""
|
|
6407
6893
|
body = {}
|
|
6408
|
-
if self.
|
|
6409
|
-
body["
|
|
6894
|
+
if self.model_version_databricks:
|
|
6895
|
+
body["model_version_databricks"] = self.model_version_databricks.as_dict()
|
|
6410
6896
|
return body
|
|
6411
6897
|
|
|
6412
6898
|
def as_shallow_dict(self) -> dict:
|
|
6413
6899
|
"""Serializes the TransitionStageResponse into a shallow dictionary of its immediate attributes."""
|
|
6414
6900
|
body = {}
|
|
6415
|
-
if self.
|
|
6416
|
-
body["
|
|
6901
|
+
if self.model_version_databricks:
|
|
6902
|
+
body["model_version_databricks"] = self.model_version_databricks
|
|
6417
6903
|
return body
|
|
6418
6904
|
|
|
6419
6905
|
@classmethod
|
|
6420
6906
|
def from_dict(cls, d: Dict[str, Any]) -> TransitionStageResponse:
|
|
6421
6907
|
"""Deserializes the TransitionStageResponse from a dictionary."""
|
|
6422
|
-
return cls(
|
|
6908
|
+
return cls(model_version_databricks=_from_dict(d, "model_version_databricks", ModelVersionDatabricks))
|
|
6423
6909
|
|
|
6424
6910
|
|
|
6425
6911
|
@dataclass
|
|
6426
6912
|
class UpdateComment:
|
|
6913
|
+
"""Details required to edit a comment on a model version."""
|
|
6914
|
+
|
|
6427
6915
|
id: str
|
|
6428
6916
|
"""Unique identifier of an activity"""
|
|
6429
6917
|
|
|
@@ -6457,7 +6945,7 @@ class UpdateComment:
|
|
|
6457
6945
|
@dataclass
|
|
6458
6946
|
class UpdateCommentResponse:
|
|
6459
6947
|
comment: Optional[CommentObject] = None
|
|
6460
|
-
"""
|
|
6948
|
+
"""Updated comment object"""
|
|
6461
6949
|
|
|
6462
6950
|
def as_dict(self) -> dict:
|
|
6463
6951
|
"""Serializes the UpdateCommentResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -6563,20 +7051,26 @@ class UpdateModelRequest:
|
|
|
6563
7051
|
|
|
6564
7052
|
@dataclass
|
|
6565
7053
|
class UpdateModelResponse:
|
|
7054
|
+
registered_model: Optional[Model] = None
|
|
7055
|
+
|
|
6566
7056
|
def as_dict(self) -> dict:
|
|
6567
7057
|
"""Serializes the UpdateModelResponse into a dictionary suitable for use as a JSON request body."""
|
|
6568
7058
|
body = {}
|
|
7059
|
+
if self.registered_model:
|
|
7060
|
+
body["registered_model"] = self.registered_model.as_dict()
|
|
6569
7061
|
return body
|
|
6570
7062
|
|
|
6571
7063
|
def as_shallow_dict(self) -> dict:
|
|
6572
7064
|
"""Serializes the UpdateModelResponse into a shallow dictionary of its immediate attributes."""
|
|
6573
7065
|
body = {}
|
|
7066
|
+
if self.registered_model:
|
|
7067
|
+
body["registered_model"] = self.registered_model
|
|
6574
7068
|
return body
|
|
6575
7069
|
|
|
6576
7070
|
@classmethod
|
|
6577
7071
|
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelResponse:
|
|
6578
7072
|
"""Deserializes the UpdateModelResponse from a dictionary."""
|
|
6579
|
-
return cls()
|
|
7073
|
+
return cls(registered_model=_from_dict(d, "registered_model", Model))
|
|
6580
7074
|
|
|
6581
7075
|
|
|
6582
7076
|
@dataclass
|
|
@@ -6620,24 +7114,34 @@ class UpdateModelVersionRequest:
|
|
|
6620
7114
|
|
|
6621
7115
|
@dataclass
|
|
6622
7116
|
class UpdateModelVersionResponse:
|
|
7117
|
+
model_version: Optional[ModelVersion] = None
|
|
7118
|
+
"""Return new version number generated for this model in registry."""
|
|
7119
|
+
|
|
6623
7120
|
def as_dict(self) -> dict:
|
|
6624
7121
|
"""Serializes the UpdateModelVersionResponse into a dictionary suitable for use as a JSON request body."""
|
|
6625
7122
|
body = {}
|
|
7123
|
+
if self.model_version:
|
|
7124
|
+
body["model_version"] = self.model_version.as_dict()
|
|
6626
7125
|
return body
|
|
6627
7126
|
|
|
6628
7127
|
def as_shallow_dict(self) -> dict:
|
|
6629
7128
|
"""Serializes the UpdateModelVersionResponse into a shallow dictionary of its immediate attributes."""
|
|
6630
7129
|
body = {}
|
|
7130
|
+
if self.model_version:
|
|
7131
|
+
body["model_version"] = self.model_version
|
|
6631
7132
|
return body
|
|
6632
7133
|
|
|
6633
7134
|
@classmethod
|
|
6634
7135
|
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelVersionResponse:
|
|
6635
7136
|
"""Deserializes the UpdateModelVersionResponse from a dictionary."""
|
|
6636
|
-
return cls()
|
|
7137
|
+
return cls(model_version=_from_dict(d, "model_version", ModelVersion))
|
|
6637
7138
|
|
|
6638
7139
|
|
|
6639
7140
|
@dataclass
|
|
6640
7141
|
class UpdateRegistryWebhook:
|
|
7142
|
+
"""Details required to update a registry webhook. Only the fields that need to be updated should be
|
|
7143
|
+
specified, and both `http_url_spec` and `job_spec` should not be specified in the same request."""
|
|
7144
|
+
|
|
6641
7145
|
id: str
|
|
6642
7146
|
"""Webhook ID"""
|
|
6643
7147
|
|
|
@@ -6679,13 +7183,6 @@ class UpdateRegistryWebhook:
|
|
|
6679
7183
|
job_spec: Optional[JobSpec] = None
|
|
6680
7184
|
|
|
6681
7185
|
status: Optional[RegistryWebhookStatus] = None
|
|
6682
|
-
"""Enable or disable triggering the webhook, or put the webhook into test mode. The default is
|
|
6683
|
-
`ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.
|
|
6684
|
-
|
|
6685
|
-
* `DISABLED`: Webhook is not triggered.
|
|
6686
|
-
|
|
6687
|
-
* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a
|
|
6688
|
-
real event."""
|
|
6689
7186
|
|
|
6690
7187
|
def as_dict(self) -> dict:
|
|
6691
7188
|
"""Serializes the UpdateRegistryWebhook into a dictionary suitable for use as a JSON request body."""
|
|
@@ -6831,20 +7328,26 @@ class UpdateRunStatus(Enum):
|
|
|
6831
7328
|
|
|
6832
7329
|
@dataclass
|
|
6833
7330
|
class UpdateWebhookResponse:
|
|
7331
|
+
webhook: Optional[RegistryWebhook] = None
|
|
7332
|
+
|
|
6834
7333
|
def as_dict(self) -> dict:
|
|
6835
7334
|
"""Serializes the UpdateWebhookResponse into a dictionary suitable for use as a JSON request body."""
|
|
6836
7335
|
body = {}
|
|
7336
|
+
if self.webhook:
|
|
7337
|
+
body["webhook"] = self.webhook.as_dict()
|
|
6837
7338
|
return body
|
|
6838
7339
|
|
|
6839
7340
|
def as_shallow_dict(self) -> dict:
|
|
6840
7341
|
"""Serializes the UpdateWebhookResponse into a shallow dictionary of its immediate attributes."""
|
|
6841
7342
|
body = {}
|
|
7343
|
+
if self.webhook:
|
|
7344
|
+
body["webhook"] = self.webhook
|
|
6842
7345
|
return body
|
|
6843
7346
|
|
|
6844
7347
|
@classmethod
|
|
6845
7348
|
def from_dict(cls, d: Dict[str, Any]) -> UpdateWebhookResponse:
|
|
6846
7349
|
"""Deserializes the UpdateWebhookResponse from a dictionary."""
|
|
6847
|
-
return cls()
|
|
7350
|
+
return cls(webhook=_from_dict(d, "webhook", RegistryWebhook))
|
|
6848
7351
|
|
|
6849
7352
|
|
|
6850
7353
|
class ViewType(Enum):
|
|
@@ -6869,9 +7372,7 @@ class ExperimentsAPI:
|
|
|
6869
7372
|
def create_experiment(
|
|
6870
7373
|
self, name: str, *, artifact_location: Optional[str] = None, tags: Optional[List[ExperimentTag]] = None
|
|
6871
7374
|
) -> CreateExperimentResponse:
|
|
6872
|
-
"""
|
|
6873
|
-
|
|
6874
|
-
Creates an experiment with a name. Returns the ID of the newly created experiment. Validates that
|
|
7375
|
+
"""Creates an experiment with a name. Returns the ID of the newly created experiment. Validates that
|
|
6875
7376
|
another experiment with the same name does not already exist and fails if another experiment with the
|
|
6876
7377
|
same name already exists.
|
|
6877
7378
|
|
|
@@ -6962,9 +7463,7 @@ class ExperimentsAPI:
|
|
|
6962
7463
|
tags: Optional[List[RunTag]] = None,
|
|
6963
7464
|
user_id: Optional[str] = None,
|
|
6964
7465
|
) -> CreateRunResponse:
|
|
6965
|
-
"""
|
|
6966
|
-
|
|
6967
|
-
Creates a new run within an experiment. A run is usually a single execution of a machine learning or
|
|
7466
|
+
"""Creates a new run within an experiment. A run is usually a single execution of a machine learning or
|
|
6968
7467
|
data ETL pipeline. MLflow uses runs to track the `mlflowParam`, `mlflowMetric`, and `mlflowRunTag`
|
|
6969
7468
|
associated with a single execution.
|
|
6970
7469
|
|
|
@@ -7002,9 +7501,7 @@ class ExperimentsAPI:
|
|
|
7002
7501
|
return CreateRunResponse.from_dict(res)
|
|
7003
7502
|
|
|
7004
7503
|
def delete_experiment(self, experiment_id: str):
|
|
7005
|
-
"""
|
|
7006
|
-
|
|
7007
|
-
Marks an experiment and associated metadata, runs, metrics, params, and tags for deletion. If the
|
|
7504
|
+
"""Marks an experiment and associated metadata, runs, metrics, params, and tags for deletion. If the
|
|
7008
7505
|
experiment uses FileStore, artifacts associated with the experiment are also deleted.
|
|
7009
7506
|
|
|
7010
7507
|
:param experiment_id: str
|
|
@@ -7055,9 +7552,7 @@ class ExperimentsAPI:
|
|
|
7055
7552
|
self._api.do("DELETE", f"/api/2.0/mlflow/logged-models/{model_id}/tags/{tag_key}", headers=headers)
|
|
7056
7553
|
|
|
7057
7554
|
def delete_run(self, run_id: str):
|
|
7058
|
-
"""
|
|
7059
|
-
|
|
7060
|
-
Marks a run for deletion.
|
|
7555
|
+
"""Marks a run for deletion.
|
|
7061
7556
|
|
|
7062
7557
|
:param run_id: str
|
|
7063
7558
|
ID of the run to delete.
|
|
@@ -7077,9 +7572,7 @@ class ExperimentsAPI:
|
|
|
7077
7572
|
def delete_runs(
|
|
7078
7573
|
self, experiment_id: str, max_timestamp_millis: int, *, max_runs: Optional[int] = None
|
|
7079
7574
|
) -> DeleteRunsResponse:
|
|
7080
|
-
"""
|
|
7081
|
-
|
|
7082
|
-
Bulk delete runs in an experiment that were created prior to or at the specified timestamp. Deletes at
|
|
7575
|
+
"""Bulk delete runs in an experiment that were created prior to or at the specified timestamp. Deletes at
|
|
7083
7576
|
most max_runs per request. To call this API from a Databricks Notebook in Python, you can use the
|
|
7084
7577
|
client code snippet on
|
|
7085
7578
|
|
|
@@ -7110,9 +7603,7 @@ class ExperimentsAPI:
|
|
|
7110
7603
|
return DeleteRunsResponse.from_dict(res)
|
|
7111
7604
|
|
|
7112
7605
|
def delete_tag(self, run_id: str, key: str):
|
|
7113
|
-
"""
|
|
7114
|
-
|
|
7115
|
-
Deletes a tag on a run. Tags are run metadata that can be updated during a run and after a run
|
|
7606
|
+
"""Deletes a tag on a run. Tags are run metadata that can be updated during a run and after a run
|
|
7116
7607
|
completes.
|
|
7117
7608
|
|
|
7118
7609
|
:param run_id: str
|
|
@@ -7157,9 +7648,7 @@ class ExperimentsAPI:
|
|
|
7157
7648
|
return FinalizeLoggedModelResponse.from_dict(res)
|
|
7158
7649
|
|
|
7159
7650
|
def get_by_name(self, experiment_name: str) -> GetExperimentByNameResponse:
|
|
7160
|
-
"""
|
|
7161
|
-
|
|
7162
|
-
Gets metadata for an experiment.
|
|
7651
|
+
"""Gets metadata for an experiment.
|
|
7163
7652
|
|
|
7164
7653
|
This endpoint will return deleted experiments, but prefers the active experiment if an active and
|
|
7165
7654
|
deleted experiment share the same name. If multiple deleted experiments share the same name, the API
|
|
@@ -7184,9 +7673,7 @@ class ExperimentsAPI:
|
|
|
7184
7673
|
return GetExperimentByNameResponse.from_dict(res)
|
|
7185
7674
|
|
|
7186
7675
|
def get_experiment(self, experiment_id: str) -> GetExperimentResponse:
|
|
7187
|
-
"""
|
|
7188
|
-
|
|
7189
|
-
Gets metadata for an experiment. This method works on deleted experiments.
|
|
7676
|
+
"""Gets metadata for an experiment. This method works on deleted experiments.
|
|
7190
7677
|
|
|
7191
7678
|
:param experiment_id: str
|
|
7192
7679
|
ID of the associated experiment.
|
|
@@ -7213,9 +7700,7 @@ class ExperimentsAPI:
|
|
|
7213
7700
|
run_id: Optional[str] = None,
|
|
7214
7701
|
run_uuid: Optional[str] = None,
|
|
7215
7702
|
) -> Iterator[Metric]:
|
|
7216
|
-
"""
|
|
7217
|
-
|
|
7218
|
-
Gets a list of all values for the specified metric for a given run.
|
|
7703
|
+
"""Gets a list of all values for the specified metric for a given run.
|
|
7219
7704
|
|
|
7220
7705
|
:param metric_key: str
|
|
7221
7706
|
Name of the metric.
|
|
@@ -7274,9 +7759,7 @@ class ExperimentsAPI:
|
|
|
7274
7759
|
return GetLoggedModelResponse.from_dict(res)
|
|
7275
7760
|
|
|
7276
7761
|
def get_permission_levels(self, experiment_id: str) -> GetExperimentPermissionLevelsResponse:
|
|
7277
|
-
"""
|
|
7278
|
-
|
|
7279
|
-
Gets the permission levels that a user can have on an object.
|
|
7762
|
+
"""Gets the permission levels that a user can have on an object.
|
|
7280
7763
|
|
|
7281
7764
|
:param experiment_id: str
|
|
7282
7765
|
The experiment for which to get or manage permissions.
|
|
@@ -7292,9 +7775,7 @@ class ExperimentsAPI:
|
|
|
7292
7775
|
return GetExperimentPermissionLevelsResponse.from_dict(res)
|
|
7293
7776
|
|
|
7294
7777
|
def get_permissions(self, experiment_id: str) -> ExperimentPermissions:
|
|
7295
|
-
"""
|
|
7296
|
-
|
|
7297
|
-
Gets the permissions of an experiment. Experiments can inherit permissions from their root object.
|
|
7778
|
+
"""Gets the permissions of an experiment. Experiments can inherit permissions from their root object.
|
|
7298
7779
|
|
|
7299
7780
|
:param experiment_id: str
|
|
7300
7781
|
The experiment for which to get or manage permissions.
|
|
@@ -7310,9 +7791,7 @@ class ExperimentsAPI:
|
|
|
7310
7791
|
return ExperimentPermissions.from_dict(res)
|
|
7311
7792
|
|
|
7312
7793
|
def get_run(self, run_id: str, *, run_uuid: Optional[str] = None) -> GetRunResponse:
|
|
7313
|
-
"""
|
|
7314
|
-
|
|
7315
|
-
Gets the metadata, metrics, params, and tags for a run. In the case where multiple metrics with the
|
|
7794
|
+
"""Gets the metadata, metrics, params, and tags for a run. In the case where multiple metrics with the
|
|
7316
7795
|
same key are logged for a run, return only the value with the latest timestamp.
|
|
7317
7796
|
|
|
7318
7797
|
If there are multiple values with the latest timestamp, return the maximum of these values.
|
|
@@ -7346,9 +7825,7 @@ class ExperimentsAPI:
|
|
|
7346
7825
|
run_id: Optional[str] = None,
|
|
7347
7826
|
run_uuid: Optional[str] = None,
|
|
7348
7827
|
) -> Iterator[FileInfo]:
|
|
7349
|
-
"""List artifacts.
|
|
7350
|
-
|
|
7351
|
-
List artifacts for a run. Takes an optional `artifact_path` prefix which if specified, the response
|
|
7828
|
+
"""List artifacts for a run. Takes an optional `artifact_path` prefix which if specified, the response
|
|
7352
7829
|
contains only artifacts with the specified prefix. A maximum of 1000 artifacts will be retrieved for
|
|
7353
7830
|
UC Volumes. Please call `/api/2.0/fs/directories{directory_path}` for listing artifacts in UC Volumes,
|
|
7354
7831
|
which supports pagination. See [List directory contents | Files
|
|
@@ -7400,9 +7877,7 @@ class ExperimentsAPI:
|
|
|
7400
7877
|
page_token: Optional[str] = None,
|
|
7401
7878
|
view_type: Optional[ViewType] = None,
|
|
7402
7879
|
) -> Iterator[Experiment]:
|
|
7403
|
-
"""
|
|
7404
|
-
|
|
7405
|
-
Gets a list of all experiments.
|
|
7880
|
+
"""Gets a list of all experiments.
|
|
7406
7881
|
|
|
7407
7882
|
:param max_results: int (optional)
|
|
7408
7883
|
Maximum number of experiments desired. If `max_results` is unspecified, return all experiments. If
|
|
@@ -7444,9 +7919,7 @@ class ExperimentsAPI:
|
|
|
7444
7919
|
run_id: Optional[str] = None,
|
|
7445
7920
|
tags: Optional[List[RunTag]] = None,
|
|
7446
7921
|
):
|
|
7447
|
-
"""
|
|
7448
|
-
|
|
7449
|
-
Logs a batch of metrics, params, and tags for a run. If any data failed to be persisted, the server
|
|
7922
|
+
"""Logs a batch of metrics, params, and tags for a run. If any data failed to be persisted, the server
|
|
7450
7923
|
will respond with an error (non-200 status code).
|
|
7451
7924
|
|
|
7452
7925
|
In case of error (due to internal server error or an invalid request), partial data may be written.
|
|
@@ -7520,11 +7993,7 @@ class ExperimentsAPI:
|
|
|
7520
7993
|
def log_inputs(
|
|
7521
7994
|
self, run_id: str, *, datasets: Optional[List[DatasetInput]] = None, models: Optional[List[ModelInput]] = None
|
|
7522
7995
|
):
|
|
7523
|
-
"""
|
|
7524
|
-
|
|
7525
|
-
**NOTE:** Experimental: This API may change or be removed in a future release without warning.
|
|
7526
|
-
|
|
7527
|
-
Logs inputs, such as datasets and models, to an MLflow Run.
|
|
7996
|
+
"""Logs inputs, such as datasets and models, to an MLflow Run.
|
|
7528
7997
|
|
|
7529
7998
|
:param run_id: str
|
|
7530
7999
|
ID of the run to log under
|
|
@@ -7550,9 +8019,7 @@ class ExperimentsAPI:
|
|
|
7550
8019
|
self._api.do("POST", "/api/2.0/mlflow/runs/log-inputs", body=body, headers=headers)
|
|
7551
8020
|
|
|
7552
8021
|
def log_logged_model_params(self, model_id: str, *, params: Optional[List[LoggedModelParameter]] = None):
|
|
7553
|
-
"""
|
|
7554
|
-
|
|
7555
|
-
Logs params for a logged model. A param is a key-value pair (string key, string value). Examples
|
|
8022
|
+
"""Logs params for a logged model. A param is a key-value pair (string key, string value). Examples
|
|
7556
8023
|
include hyperparameters used for ML model training. A param can be logged only once for a logged
|
|
7557
8024
|
model, and attempting to overwrite an existing param with a different value will result in an error
|
|
7558
8025
|
|
|
@@ -7586,9 +8053,7 @@ class ExperimentsAPI:
|
|
|
7586
8053
|
run_uuid: Optional[str] = None,
|
|
7587
8054
|
step: Optional[int] = None,
|
|
7588
8055
|
):
|
|
7589
|
-
"""Log a metric for a run.
|
|
7590
|
-
|
|
7591
|
-
Log a metric for a run. A metric is a key-value pair (string key, float value) with an associated
|
|
8056
|
+
"""Log a metric for a run. A metric is a key-value pair (string key, float value) with an associated
|
|
7592
8057
|
timestamp. Examples include the various metrics that represent ML model accuracy. A metric can be
|
|
7593
8058
|
logged multiple times.
|
|
7594
8059
|
|
|
@@ -7643,9 +8108,10 @@ class ExperimentsAPI:
|
|
|
7643
8108
|
self._api.do("POST", "/api/2.0/mlflow/runs/log-metric", body=body, headers=headers)
|
|
7644
8109
|
|
|
7645
8110
|
def log_model(self, *, model_json: Optional[str] = None, run_id: Optional[str] = None):
|
|
7646
|
-
"""
|
|
8111
|
+
"""**Note:** the [Create a logged model](/api/workspace/experiments/createloggedmodel) API replaces this
|
|
8112
|
+
endpoint.
|
|
7647
8113
|
|
|
7648
|
-
|
|
8114
|
+
Log a model to an MLflow Run.
|
|
7649
8115
|
|
|
7650
8116
|
:param model_json: str (optional)
|
|
7651
8117
|
MLmodel file in json format.
|
|
@@ -7667,11 +8133,7 @@ class ExperimentsAPI:
|
|
|
7667
8133
|
self._api.do("POST", "/api/2.0/mlflow/runs/log-model", body=body, headers=headers)
|
|
7668
8134
|
|
|
7669
8135
|
def log_outputs(self, run_id: str, *, models: Optional[List[ModelOutput]] = None):
|
|
7670
|
-
"""
|
|
7671
|
-
|
|
7672
|
-
**NOTE**: Experimental: This API may change or be removed in a future release without warning.
|
|
7673
|
-
|
|
7674
|
-
Logs outputs, such as models, from an MLflow Run.
|
|
8136
|
+
"""Logs outputs, such as models, from an MLflow Run.
|
|
7675
8137
|
|
|
7676
8138
|
:param run_id: str
|
|
7677
8139
|
The ID of the Run from which to log outputs.
|
|
@@ -7693,9 +8155,7 @@ class ExperimentsAPI:
|
|
|
7693
8155
|
self._api.do("POST", "/api/2.0/mlflow/runs/outputs", body=body, headers=headers)
|
|
7694
8156
|
|
|
7695
8157
|
def log_param(self, key: str, value: str, *, run_id: Optional[str] = None, run_uuid: Optional[str] = None):
|
|
7696
|
-
"""
|
|
7697
|
-
|
|
7698
|
-
Logs a param used for a run. A param is a key-value pair (string key, string value). Examples include
|
|
8158
|
+
"""Logs a param used for a run. A param is a key-value pair (string key, string value). Examples include
|
|
7699
8159
|
hyperparameters used for ML model training and constant dates and values used in an ETL pipeline. A
|
|
7700
8160
|
param can be logged only once for a run.
|
|
7701
8161
|
|
|
@@ -7728,9 +8188,7 @@ class ExperimentsAPI:
|
|
|
7728
8188
|
self._api.do("POST", "/api/2.0/mlflow/runs/log-parameter", body=body, headers=headers)
|
|
7729
8189
|
|
|
7730
8190
|
def restore_experiment(self, experiment_id: str):
|
|
7731
|
-
"""Restore an experiment.
|
|
7732
|
-
|
|
7733
|
-
Restore an experiment marked for deletion. This also restores associated metadata, runs, metrics,
|
|
8191
|
+
"""Restore an experiment marked for deletion. This also restores associated metadata, runs, metrics,
|
|
7734
8192
|
params, and tags. If experiment uses FileStore, underlying artifacts associated with experiment are
|
|
7735
8193
|
also restored.
|
|
7736
8194
|
|
|
@@ -7752,9 +8210,7 @@ class ExperimentsAPI:
|
|
|
7752
8210
|
self._api.do("POST", "/api/2.0/mlflow/experiments/restore", body=body, headers=headers)
|
|
7753
8211
|
|
|
7754
8212
|
def restore_run(self, run_id: str):
|
|
7755
|
-
"""
|
|
7756
|
-
|
|
7757
|
-
Restores a deleted run. This also restores associated metadata, runs, metrics, params, and tags.
|
|
8213
|
+
"""Restores a deleted run. This also restores associated metadata, runs, metrics, params, and tags.
|
|
7758
8214
|
|
|
7759
8215
|
Throws `RESOURCE_DOES_NOT_EXIST` if the run was never created or was permanently deleted.
|
|
7760
8216
|
|
|
@@ -7776,9 +8232,7 @@ class ExperimentsAPI:
|
|
|
7776
8232
|
def restore_runs(
|
|
7777
8233
|
self, experiment_id: str, min_timestamp_millis: int, *, max_runs: Optional[int] = None
|
|
7778
8234
|
) -> RestoreRunsResponse:
|
|
7779
|
-
"""
|
|
7780
|
-
|
|
7781
|
-
Bulk restore runs in an experiment that were deleted no earlier than the specified timestamp. Restores
|
|
8235
|
+
"""Bulk restore runs in an experiment that were deleted no earlier than the specified timestamp. Restores
|
|
7782
8236
|
at most max_runs per request. To call this API from a Databricks Notebook in Python, you can use the
|
|
7783
8237
|
client code snippet on
|
|
7784
8238
|
|
|
@@ -7817,9 +8271,7 @@ class ExperimentsAPI:
|
|
|
7817
8271
|
page_token: Optional[str] = None,
|
|
7818
8272
|
view_type: Optional[ViewType] = None,
|
|
7819
8273
|
) -> Iterator[Experiment]:
|
|
7820
|
-
"""
|
|
7821
|
-
|
|
7822
|
-
Searches for experiments that satisfy specified search criteria.
|
|
8274
|
+
"""Searches for experiments that satisfy specified search criteria.
|
|
7823
8275
|
|
|
7824
8276
|
:param filter: str (optional)
|
|
7825
8277
|
String representing a SQL filter condition (e.g. "name ILIKE 'my-experiment%'")
|
|
@@ -7871,9 +8323,7 @@ class ExperimentsAPI:
|
|
|
7871
8323
|
order_by: Optional[List[SearchLoggedModelsOrderBy]] = None,
|
|
7872
8324
|
page_token: Optional[str] = None,
|
|
7873
8325
|
) -> SearchLoggedModelsResponse:
|
|
7874
|
-
"""Search
|
|
7875
|
-
|
|
7876
|
-
Search for Logged Models that satisfy specified search criteria.
|
|
8326
|
+
"""Search for Logged Models that satisfy specified search criteria.
|
|
7877
8327
|
|
|
7878
8328
|
:param datasets: List[:class:`SearchLoggedModelsDataset`] (optional)
|
|
7879
8329
|
List of datasets on which to apply the metrics filter clauses. For example, a filter with
|
|
@@ -7928,9 +8378,7 @@ class ExperimentsAPI:
|
|
|
7928
8378
|
page_token: Optional[str] = None,
|
|
7929
8379
|
run_view_type: Optional[ViewType] = None,
|
|
7930
8380
|
) -> Iterator[Run]:
|
|
7931
|
-
"""
|
|
7932
|
-
|
|
7933
|
-
Searches for runs that satisfy expressions.
|
|
8381
|
+
"""Searches for runs that satisfy expressions.
|
|
7934
8382
|
|
|
7935
8383
|
Search expressions can use `mlflowMetric` and `mlflowParam` keys.
|
|
7936
8384
|
|
|
@@ -7990,9 +8438,7 @@ class ExperimentsAPI:
|
|
|
7990
8438
|
body["page_token"] = json["next_page_token"]
|
|
7991
8439
|
|
|
7992
8440
|
def set_experiment_tag(self, experiment_id: str, key: str, value: str):
|
|
7993
|
-
"""
|
|
7994
|
-
|
|
7995
|
-
Sets a tag on an experiment. Experiment tags are metadata that can be updated.
|
|
8441
|
+
"""Sets a tag on an experiment. Experiment tags are metadata that can be updated.
|
|
7996
8442
|
|
|
7997
8443
|
:param experiment_id: str
|
|
7998
8444
|
ID of the experiment under which to log the tag. Must be provided.
|
|
@@ -8018,7 +8464,7 @@ class ExperimentsAPI:
|
|
|
8018
8464
|
self._api.do("POST", "/api/2.0/mlflow/experiments/set-experiment-tag", body=body, headers=headers)
|
|
8019
8465
|
|
|
8020
8466
|
def set_logged_model_tags(self, model_id: str, *, tags: Optional[List[LoggedModelTag]] = None):
|
|
8021
|
-
"""Set
|
|
8467
|
+
"""Set tags for a logged model.
|
|
8022
8468
|
|
|
8023
8469
|
:param model_id: str
|
|
8024
8470
|
The ID of the logged model to set the tags on.
|
|
@@ -8040,9 +8486,7 @@ class ExperimentsAPI:
|
|
|
8040
8486
|
def set_permissions(
|
|
8041
8487
|
self, experiment_id: str, *, access_control_list: Optional[List[ExperimentAccessControlRequest]] = None
|
|
8042
8488
|
) -> ExperimentPermissions:
|
|
8043
|
-
"""
|
|
8044
|
-
|
|
8045
|
-
Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
8489
|
+
"""Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
8046
8490
|
permissions if none are specified. Objects can inherit permissions from their root object.
|
|
8047
8491
|
|
|
8048
8492
|
:param experiment_id: str
|
|
@@ -8063,9 +8507,7 @@ class ExperimentsAPI:
|
|
|
8063
8507
|
return ExperimentPermissions.from_dict(res)
|
|
8064
8508
|
|
|
8065
8509
|
def set_tag(self, key: str, value: str, *, run_id: Optional[str] = None, run_uuid: Optional[str] = None):
|
|
8066
|
-
"""
|
|
8067
|
-
|
|
8068
|
-
Sets a tag on a run. Tags are run metadata that can be updated during a run and after a run completes.
|
|
8510
|
+
"""Sets a tag on a run. Tags are run metadata that can be updated during a run and after a run completes.
|
|
8069
8511
|
|
|
8070
8512
|
:param key: str
|
|
8071
8513
|
Name of the tag. Keys up to 250 bytes in size are supported.
|
|
@@ -8096,9 +8538,7 @@ class ExperimentsAPI:
|
|
|
8096
8538
|
self._api.do("POST", "/api/2.0/mlflow/runs/set-tag", body=body, headers=headers)
|
|
8097
8539
|
|
|
8098
8540
|
def update_experiment(self, experiment_id: str, *, new_name: Optional[str] = None):
|
|
8099
|
-
"""
|
|
8100
|
-
|
|
8101
|
-
Updates experiment metadata.
|
|
8541
|
+
"""Updates experiment metadata.
|
|
8102
8542
|
|
|
8103
8543
|
:param experiment_id: str
|
|
8104
8544
|
ID of the associated experiment.
|
|
@@ -8122,9 +8562,7 @@ class ExperimentsAPI:
|
|
|
8122
8562
|
def update_permissions(
|
|
8123
8563
|
self, experiment_id: str, *, access_control_list: Optional[List[ExperimentAccessControlRequest]] = None
|
|
8124
8564
|
) -> ExperimentPermissions:
|
|
8125
|
-
"""
|
|
8126
|
-
|
|
8127
|
-
Updates the permissions on an experiment. Experiments can inherit permissions from their root object.
|
|
8565
|
+
"""Updates the permissions on an experiment. Experiments can inherit permissions from their root object.
|
|
8128
8566
|
|
|
8129
8567
|
:param experiment_id: str
|
|
8130
8568
|
The experiment for which to get or manage permissions.
|
|
@@ -8152,9 +8590,7 @@ class ExperimentsAPI:
|
|
|
8152
8590
|
run_uuid: Optional[str] = None,
|
|
8153
8591
|
status: Optional[UpdateRunStatus] = None,
|
|
8154
8592
|
) -> UpdateRunResponse:
|
|
8155
|
-
"""
|
|
8156
|
-
|
|
8157
|
-
Updates run metadata.
|
|
8593
|
+
"""Updates run metadata.
|
|
8158
8594
|
|
|
8159
8595
|
:param end_time: int (optional)
|
|
8160
8596
|
Unix timestamp in milliseconds of when the run ended.
|
|
@@ -8190,6 +8626,146 @@ class ExperimentsAPI:
|
|
|
8190
8626
|
return UpdateRunResponse.from_dict(res)
|
|
8191
8627
|
|
|
8192
8628
|
|
|
8629
|
+
class FeatureStoreAPI:
|
|
8630
|
+
"""A feature store is a centralized repository that enables data scientists to find and share features. Using
|
|
8631
|
+
a feature store also ensures that the code used to compute feature values is the same during model
|
|
8632
|
+
training and when the model is used for inference.
|
|
8633
|
+
|
|
8634
|
+
An online store is a low-latency database used for feature lookup during real-time model inference or
|
|
8635
|
+
serve feature for real-time applications."""
|
|
8636
|
+
|
|
8637
|
+
def __init__(self, api_client):
|
|
8638
|
+
self._api = api_client
|
|
8639
|
+
|
|
8640
|
+
def create_online_store(self, online_store: OnlineStore) -> OnlineStore:
|
|
8641
|
+
"""Create an Online Feature Store.
|
|
8642
|
+
|
|
8643
|
+
:param online_store: :class:`OnlineStore`
|
|
8644
|
+
Online store to create.
|
|
8645
|
+
|
|
8646
|
+
:returns: :class:`OnlineStore`
|
|
8647
|
+
"""
|
|
8648
|
+
body = online_store.as_dict()
|
|
8649
|
+
headers = {
|
|
8650
|
+
"Accept": "application/json",
|
|
8651
|
+
"Content-Type": "application/json",
|
|
8652
|
+
}
|
|
8653
|
+
|
|
8654
|
+
res = self._api.do("POST", "/api/2.0/feature-store/online-stores", body=body, headers=headers)
|
|
8655
|
+
return OnlineStore.from_dict(res)
|
|
8656
|
+
|
|
8657
|
+
def delete_online_store(self, name: str):
|
|
8658
|
+
"""Delete an Online Feature Store.
|
|
8659
|
+
|
|
8660
|
+
:param name: str
|
|
8661
|
+
Name of the online store to delete.
|
|
8662
|
+
|
|
8663
|
+
|
|
8664
|
+
"""
|
|
8665
|
+
|
|
8666
|
+
headers = {
|
|
8667
|
+
"Accept": "application/json",
|
|
8668
|
+
}
|
|
8669
|
+
|
|
8670
|
+
self._api.do("DELETE", f"/api/2.0/feature-store/online-stores/{name}", headers=headers)
|
|
8671
|
+
|
|
8672
|
+
def get_online_store(self, name: str) -> OnlineStore:
|
|
8673
|
+
"""Get an Online Feature Store.
|
|
8674
|
+
|
|
8675
|
+
:param name: str
|
|
8676
|
+
Name of the online store to get.
|
|
8677
|
+
|
|
8678
|
+
:returns: :class:`OnlineStore`
|
|
8679
|
+
"""
|
|
8680
|
+
|
|
8681
|
+
headers = {
|
|
8682
|
+
"Accept": "application/json",
|
|
8683
|
+
}
|
|
8684
|
+
|
|
8685
|
+
res = self._api.do("GET", f"/api/2.0/feature-store/online-stores/{name}", headers=headers)
|
|
8686
|
+
return OnlineStore.from_dict(res)
|
|
8687
|
+
|
|
8688
|
+
def list_online_stores(
|
|
8689
|
+
self, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
8690
|
+
) -> Iterator[OnlineStore]:
|
|
8691
|
+
"""List Online Feature Stores.
|
|
8692
|
+
|
|
8693
|
+
:param page_size: int (optional)
|
|
8694
|
+
The maximum number of results to return. Defaults to 100 if not specified.
|
|
8695
|
+
:param page_token: str (optional)
|
|
8696
|
+
Pagination token to go to the next page based on a previous query.
|
|
8697
|
+
|
|
8698
|
+
:returns: Iterator over :class:`OnlineStore`
|
|
8699
|
+
"""
|
|
8700
|
+
|
|
8701
|
+
query = {}
|
|
8702
|
+
if page_size is not None:
|
|
8703
|
+
query["page_size"] = page_size
|
|
8704
|
+
if page_token is not None:
|
|
8705
|
+
query["page_token"] = page_token
|
|
8706
|
+
headers = {
|
|
8707
|
+
"Accept": "application/json",
|
|
8708
|
+
}
|
|
8709
|
+
|
|
8710
|
+
while True:
|
|
8711
|
+
json = self._api.do("GET", "/api/2.0/feature-store/online-stores", query=query, headers=headers)
|
|
8712
|
+
if "online_stores" in json:
|
|
8713
|
+
for v in json["online_stores"]:
|
|
8714
|
+
yield OnlineStore.from_dict(v)
|
|
8715
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
8716
|
+
return
|
|
8717
|
+
query["page_token"] = json["next_page_token"]
|
|
8718
|
+
|
|
8719
|
+
def publish_table(self, source_table_name: str, publish_spec: PublishSpec) -> PublishTableResponse:
|
|
8720
|
+
"""Publish features.
|
|
8721
|
+
|
|
8722
|
+
:param source_table_name: str
|
|
8723
|
+
The full three-part (catalog, schema, table) name of the source table.
|
|
8724
|
+
:param publish_spec: :class:`PublishSpec`
|
|
8725
|
+
The specification for publishing the online table from the source table.
|
|
8726
|
+
|
|
8727
|
+
:returns: :class:`PublishTableResponse`
|
|
8728
|
+
"""
|
|
8729
|
+
body = {}
|
|
8730
|
+
if publish_spec is not None:
|
|
8731
|
+
body["publish_spec"] = publish_spec.as_dict()
|
|
8732
|
+
headers = {
|
|
8733
|
+
"Accept": "application/json",
|
|
8734
|
+
"Content-Type": "application/json",
|
|
8735
|
+
}
|
|
8736
|
+
|
|
8737
|
+
res = self._api.do(
|
|
8738
|
+
"POST", f"/api/2.0/feature-store/tables/{source_table_name}/publish", body=body, headers=headers
|
|
8739
|
+
)
|
|
8740
|
+
return PublishTableResponse.from_dict(res)
|
|
8741
|
+
|
|
8742
|
+
def update_online_store(self, name: str, online_store: OnlineStore, update_mask: str) -> OnlineStore:
|
|
8743
|
+
"""Update an Online Feature Store.
|
|
8744
|
+
|
|
8745
|
+
:param name: str
|
|
8746
|
+
The name of the online store. This is the unique identifier for the online store.
|
|
8747
|
+
:param online_store: :class:`OnlineStore`
|
|
8748
|
+
Online store to update.
|
|
8749
|
+
:param update_mask: str
|
|
8750
|
+
The list of fields to update.
|
|
8751
|
+
|
|
8752
|
+
:returns: :class:`OnlineStore`
|
|
8753
|
+
"""
|
|
8754
|
+
body = online_store.as_dict()
|
|
8755
|
+
query = {}
|
|
8756
|
+
if update_mask is not None:
|
|
8757
|
+
query["update_mask"] = update_mask
|
|
8758
|
+
headers = {
|
|
8759
|
+
"Accept": "application/json",
|
|
8760
|
+
"Content-Type": "application/json",
|
|
8761
|
+
}
|
|
8762
|
+
|
|
8763
|
+
res = self._api.do(
|
|
8764
|
+
"PATCH", f"/api/2.0/feature-store/online-stores/{name}", query=query, body=body, headers=headers
|
|
8765
|
+
)
|
|
8766
|
+
return OnlineStore.from_dict(res)
|
|
8767
|
+
|
|
8768
|
+
|
|
8193
8769
|
class ForecastingAPI:
|
|
8194
8770
|
"""The Forecasting API allows you to create and get serverless forecasting experiments"""
|
|
8195
8771
|
|
|
@@ -8252,9 +8828,7 @@ class ForecastingAPI:
|
|
|
8252
8828
|
timeseries_identifier_columns: Optional[List[str]] = None,
|
|
8253
8829
|
training_frameworks: Optional[List[str]] = None,
|
|
8254
8830
|
) -> Wait[ForecastingExperiment]:
|
|
8255
|
-
"""
|
|
8256
|
-
|
|
8257
|
-
Creates a serverless forecasting experiment. Returns the experiment ID.
|
|
8831
|
+
"""Creates a serverless forecasting experiment. Returns the experiment ID.
|
|
8258
8832
|
|
|
8259
8833
|
:param train_data_path: str
|
|
8260
8834
|
The fully qualified path of a Unity Catalog table, formatted as catalog_name.schema_name.table_name,
|
|
@@ -8399,9 +8973,7 @@ class ForecastingAPI:
|
|
|
8399
8973
|
).result(timeout=timeout)
|
|
8400
8974
|
|
|
8401
8975
|
def get_experiment(self, experiment_id: str) -> ForecastingExperiment:
|
|
8402
|
-
"""
|
|
8403
|
-
|
|
8404
|
-
Public RPC to get forecasting experiment
|
|
8976
|
+
"""Public RPC to get forecasting experiment
|
|
8405
8977
|
|
|
8406
8978
|
:param experiment_id: str
|
|
8407
8979
|
The unique ID of a forecasting experiment
|
|
@@ -8417,6 +8989,179 @@ class ForecastingAPI:
|
|
|
8417
8989
|
return ForecastingExperiment.from_dict(res)
|
|
8418
8990
|
|
|
8419
8991
|
|
|
8992
|
+
class MaterializedFeaturesAPI:
|
|
8993
|
+
"""Materialized Features are columns in tables and views that can be directly used as features to train and
|
|
8994
|
+
serve ML models."""
|
|
8995
|
+
|
|
8996
|
+
def __init__(self, api_client):
|
|
8997
|
+
self._api = api_client
|
|
8998
|
+
|
|
8999
|
+
def create_feature_tag(self, table_name: str, feature_name: str, feature_tag: FeatureTag) -> FeatureTag:
|
|
9000
|
+
"""Creates a FeatureTag.
|
|
9001
|
+
|
|
9002
|
+
:param table_name: str
|
|
9003
|
+
:param feature_name: str
|
|
9004
|
+
:param feature_tag: :class:`FeatureTag`
|
|
9005
|
+
|
|
9006
|
+
:returns: :class:`FeatureTag`
|
|
9007
|
+
"""
|
|
9008
|
+
body = feature_tag.as_dict()
|
|
9009
|
+
headers = {
|
|
9010
|
+
"Accept": "application/json",
|
|
9011
|
+
"Content-Type": "application/json",
|
|
9012
|
+
}
|
|
9013
|
+
|
|
9014
|
+
res = self._api.do(
|
|
9015
|
+
"POST",
|
|
9016
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags",
|
|
9017
|
+
body=body,
|
|
9018
|
+
headers=headers,
|
|
9019
|
+
)
|
|
9020
|
+
return FeatureTag.from_dict(res)
|
|
9021
|
+
|
|
9022
|
+
def delete_feature_tag(self, table_name: str, feature_name: str, key: str):
|
|
9023
|
+
"""Deletes a FeatureTag.
|
|
9024
|
+
|
|
9025
|
+
:param table_name: str
|
|
9026
|
+
The name of the feature table.
|
|
9027
|
+
:param feature_name: str
|
|
9028
|
+
The name of the feature within the feature table.
|
|
9029
|
+
:param key: str
|
|
9030
|
+
The key of the tag to delete.
|
|
9031
|
+
|
|
9032
|
+
|
|
9033
|
+
"""
|
|
9034
|
+
|
|
9035
|
+
headers = {
|
|
9036
|
+
"Accept": "application/json",
|
|
9037
|
+
}
|
|
9038
|
+
|
|
9039
|
+
self._api.do(
|
|
9040
|
+
"DELETE",
|
|
9041
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags/{key}",
|
|
9042
|
+
headers=headers,
|
|
9043
|
+
)
|
|
9044
|
+
|
|
9045
|
+
def get_feature_lineage(self, table_name: str, feature_name: str) -> FeatureLineage:
|
|
9046
|
+
"""Get Feature Lineage.
|
|
9047
|
+
|
|
9048
|
+
:param table_name: str
|
|
9049
|
+
The full name of the feature table in Unity Catalog.
|
|
9050
|
+
:param feature_name: str
|
|
9051
|
+
The name of the feature.
|
|
9052
|
+
|
|
9053
|
+
:returns: :class:`FeatureLineage`
|
|
9054
|
+
"""
|
|
9055
|
+
|
|
9056
|
+
headers = {
|
|
9057
|
+
"Accept": "application/json",
|
|
9058
|
+
}
|
|
9059
|
+
|
|
9060
|
+
res = self._api.do(
|
|
9061
|
+
"GET",
|
|
9062
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/lineage",
|
|
9063
|
+
headers=headers,
|
|
9064
|
+
)
|
|
9065
|
+
return FeatureLineage.from_dict(res)
|
|
9066
|
+
|
|
9067
|
+
def get_feature_tag(self, table_name: str, feature_name: str, key: str) -> FeatureTag:
|
|
9068
|
+
"""Gets a FeatureTag.
|
|
9069
|
+
|
|
9070
|
+
:param table_name: str
|
|
9071
|
+
:param feature_name: str
|
|
9072
|
+
:param key: str
|
|
9073
|
+
|
|
9074
|
+
:returns: :class:`FeatureTag`
|
|
9075
|
+
"""
|
|
9076
|
+
|
|
9077
|
+
headers = {
|
|
9078
|
+
"Accept": "application/json",
|
|
9079
|
+
}
|
|
9080
|
+
|
|
9081
|
+
res = self._api.do(
|
|
9082
|
+
"GET",
|
|
9083
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags/{key}",
|
|
9084
|
+
headers=headers,
|
|
9085
|
+
)
|
|
9086
|
+
return FeatureTag.from_dict(res)
|
|
9087
|
+
|
|
9088
|
+
def list_feature_tags(
|
|
9089
|
+
self, table_name: str, feature_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
9090
|
+
) -> Iterator[FeatureTag]:
|
|
9091
|
+
"""Lists FeatureTags.
|
|
9092
|
+
|
|
9093
|
+
:param table_name: str
|
|
9094
|
+
:param feature_name: str
|
|
9095
|
+
:param page_size: int (optional)
|
|
9096
|
+
The maximum number of results to return.
|
|
9097
|
+
:param page_token: str (optional)
|
|
9098
|
+
Pagination token to go to the next page based on a previous query.
|
|
9099
|
+
|
|
9100
|
+
:returns: Iterator over :class:`FeatureTag`
|
|
9101
|
+
"""
|
|
9102
|
+
|
|
9103
|
+
query = {}
|
|
9104
|
+
if page_size is not None:
|
|
9105
|
+
query["page_size"] = page_size
|
|
9106
|
+
if page_token is not None:
|
|
9107
|
+
query["page_token"] = page_token
|
|
9108
|
+
headers = {
|
|
9109
|
+
"Accept": "application/json",
|
|
9110
|
+
}
|
|
9111
|
+
|
|
9112
|
+
while True:
|
|
9113
|
+
json = self._api.do(
|
|
9114
|
+
"GET",
|
|
9115
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags",
|
|
9116
|
+
query=query,
|
|
9117
|
+
headers=headers,
|
|
9118
|
+
)
|
|
9119
|
+
if "feature_tags" in json:
|
|
9120
|
+
for v in json["feature_tags"]:
|
|
9121
|
+
yield FeatureTag.from_dict(v)
|
|
9122
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
9123
|
+
return
|
|
9124
|
+
query["page_token"] = json["next_page_token"]
|
|
9125
|
+
|
|
9126
|
+
def update_feature_tag(
|
|
9127
|
+
self,
|
|
9128
|
+
table_name: str,
|
|
9129
|
+
feature_name: str,
|
|
9130
|
+
key: str,
|
|
9131
|
+
feature_tag: FeatureTag,
|
|
9132
|
+
*,
|
|
9133
|
+
update_mask: Optional[str] = None,
|
|
9134
|
+
) -> FeatureTag:
|
|
9135
|
+
"""Updates a FeatureTag.
|
|
9136
|
+
|
|
9137
|
+
:param table_name: str
|
|
9138
|
+
:param feature_name: str
|
|
9139
|
+
:param key: str
|
|
9140
|
+
:param feature_tag: :class:`FeatureTag`
|
|
9141
|
+
:param update_mask: str (optional)
|
|
9142
|
+
The list of fields to update.
|
|
9143
|
+
|
|
9144
|
+
:returns: :class:`FeatureTag`
|
|
9145
|
+
"""
|
|
9146
|
+
body = feature_tag.as_dict()
|
|
9147
|
+
query = {}
|
|
9148
|
+
if update_mask is not None:
|
|
9149
|
+
query["update_mask"] = update_mask
|
|
9150
|
+
headers = {
|
|
9151
|
+
"Accept": "application/json",
|
|
9152
|
+
"Content-Type": "application/json",
|
|
9153
|
+
}
|
|
9154
|
+
|
|
9155
|
+
res = self._api.do(
|
|
9156
|
+
"PATCH",
|
|
9157
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags/{key}",
|
|
9158
|
+
query=query,
|
|
9159
|
+
body=body,
|
|
9160
|
+
headers=headers,
|
|
9161
|
+
)
|
|
9162
|
+
return FeatureTag.from_dict(res)
|
|
9163
|
+
|
|
9164
|
+
|
|
8420
9165
|
class ModelRegistryAPI:
|
|
8421
9166
|
"""Note: This API reference documents APIs for the Workspace Model Registry. Databricks recommends using
|
|
8422
9167
|
[Models in Unity Catalog](/api/workspace/registeredmodels) instead. Models in Unity Catalog provides
|
|
@@ -8430,17 +9175,15 @@ class ModelRegistryAPI:
|
|
|
8430
9175
|
self._api = api_client
|
|
8431
9176
|
|
|
8432
9177
|
def approve_transition_request(
|
|
8433
|
-
self, name: str, version: str, stage:
|
|
9178
|
+
self, name: str, version: str, stage: str, archive_existing_versions: bool, *, comment: Optional[str] = None
|
|
8434
9179
|
) -> ApproveTransitionRequestResponse:
|
|
8435
|
-
"""
|
|
8436
|
-
|
|
8437
|
-
Approves a model version stage transition request.
|
|
9180
|
+
"""Approves a model version stage transition request.
|
|
8438
9181
|
|
|
8439
9182
|
:param name: str
|
|
8440
9183
|
Name of the model.
|
|
8441
9184
|
:param version: str
|
|
8442
9185
|
Version of the model.
|
|
8443
|
-
:param stage:
|
|
9186
|
+
:param stage: str
|
|
8444
9187
|
Target stage of the transition. Valid values are:
|
|
8445
9188
|
|
|
8446
9189
|
* `None`: The initial stage of a model version.
|
|
@@ -8465,7 +9208,7 @@ class ModelRegistryAPI:
|
|
|
8465
9208
|
if name is not None:
|
|
8466
9209
|
body["name"] = name
|
|
8467
9210
|
if stage is not None:
|
|
8468
|
-
body["stage"] = stage
|
|
9211
|
+
body["stage"] = stage
|
|
8469
9212
|
if version is not None:
|
|
8470
9213
|
body["version"] = version
|
|
8471
9214
|
headers = {
|
|
@@ -8477,9 +9220,7 @@ class ModelRegistryAPI:
|
|
|
8477
9220
|
return ApproveTransitionRequestResponse.from_dict(res)
|
|
8478
9221
|
|
|
8479
9222
|
def create_comment(self, name: str, version: str, comment: str) -> CreateCommentResponse:
|
|
8480
|
-
"""
|
|
8481
|
-
|
|
8482
|
-
Posts a comment on a model version. A comment can be submitted either by a user or programmatically to
|
|
9223
|
+
"""Posts a comment on a model version. A comment can be submitted either by a user or programmatically to
|
|
8483
9224
|
display relevant information about the model. For example, test results or deployment errors.
|
|
8484
9225
|
|
|
8485
9226
|
:param name: str
|
|
@@ -8509,11 +9250,8 @@ class ModelRegistryAPI:
|
|
|
8509
9250
|
def create_model(
|
|
8510
9251
|
self, name: str, *, description: Optional[str] = None, tags: Optional[List[ModelTag]] = None
|
|
8511
9252
|
) -> CreateModelResponse:
|
|
8512
|
-
"""
|
|
8513
|
-
|
|
8514
|
-
Creates a new registered model with the name specified in the request body.
|
|
8515
|
-
|
|
8516
|
-
Throws `RESOURCE_ALREADY_EXISTS` if a registered model with the given name exists.
|
|
9253
|
+
"""Creates a new registered model with the name specified in the request body. Throws
|
|
9254
|
+
`RESOURCE_ALREADY_EXISTS` if a registered model with the given name exists.
|
|
8517
9255
|
|
|
8518
9256
|
:param name: str
|
|
8519
9257
|
Register models under this name
|
|
@@ -8549,9 +9287,7 @@ class ModelRegistryAPI:
|
|
|
8549
9287
|
run_link: Optional[str] = None,
|
|
8550
9288
|
tags: Optional[List[ModelVersionTag]] = None,
|
|
8551
9289
|
) -> CreateModelVersionResponse:
|
|
8552
|
-
"""
|
|
8553
|
-
|
|
8554
|
-
Creates a model version.
|
|
9290
|
+
"""Creates a model version.
|
|
8555
9291
|
|
|
8556
9292
|
:param name: str
|
|
8557
9293
|
Register model under this name
|
|
@@ -8592,17 +9328,15 @@ class ModelRegistryAPI:
|
|
|
8592
9328
|
return CreateModelVersionResponse.from_dict(res)
|
|
8593
9329
|
|
|
8594
9330
|
def create_transition_request(
|
|
8595
|
-
self, name: str, version: str, stage:
|
|
9331
|
+
self, name: str, version: str, stage: str, *, comment: Optional[str] = None
|
|
8596
9332
|
) -> CreateTransitionRequestResponse:
|
|
8597
|
-
"""
|
|
8598
|
-
|
|
8599
|
-
Creates a model version stage transition request.
|
|
9333
|
+
"""Creates a model version stage transition request.
|
|
8600
9334
|
|
|
8601
9335
|
:param name: str
|
|
8602
9336
|
Name of the model.
|
|
8603
9337
|
:param version: str
|
|
8604
9338
|
Version of the model.
|
|
8605
|
-
:param stage:
|
|
9339
|
+
:param stage: str
|
|
8606
9340
|
Target stage of the transition. Valid values are:
|
|
8607
9341
|
|
|
8608
9342
|
* `None`: The initial stage of a model version.
|
|
@@ -8623,7 +9357,7 @@ class ModelRegistryAPI:
|
|
|
8623
9357
|
if name is not None:
|
|
8624
9358
|
body["name"] = name
|
|
8625
9359
|
if stage is not None:
|
|
8626
|
-
body["stage"] = stage
|
|
9360
|
+
body["stage"] = stage
|
|
8627
9361
|
if version is not None:
|
|
8628
9362
|
body["version"] = version
|
|
8629
9363
|
headers = {
|
|
@@ -8644,11 +9378,7 @@ class ModelRegistryAPI:
|
|
|
8644
9378
|
model_name: Optional[str] = None,
|
|
8645
9379
|
status: Optional[RegistryWebhookStatus] = None,
|
|
8646
9380
|
) -> CreateWebhookResponse:
|
|
8647
|
-
"""
|
|
8648
|
-
|
|
8649
|
-
**NOTE**: This endpoint is in Public Preview.
|
|
8650
|
-
|
|
8651
|
-
Creates a registry webhook.
|
|
9381
|
+
"""**NOTE:** This endpoint is in Public Preview. Creates a registry webhook.
|
|
8652
9382
|
|
|
8653
9383
|
:param events: List[:class:`RegistryWebhookEvent`]
|
|
8654
9384
|
Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A new model version was
|
|
@@ -8682,7 +9412,9 @@ class ModelRegistryAPI:
|
|
|
8682
9412
|
:param description: str (optional)
|
|
8683
9413
|
User-specified description for the webhook.
|
|
8684
9414
|
:param http_url_spec: :class:`HttpUrlSpec` (optional)
|
|
9415
|
+
External HTTPS URL called on event trigger (by using a POST request).
|
|
8685
9416
|
:param job_spec: :class:`JobSpec` (optional)
|
|
9417
|
+
ID of the job that the webhook runs.
|
|
8686
9418
|
:param model_name: str (optional)
|
|
8687
9419
|
If model name is not specified, a registry-wide webhook is created that listens for the specified
|
|
8688
9420
|
events across all versions of all registered models.
|
|
@@ -8719,9 +9451,7 @@ class ModelRegistryAPI:
|
|
|
8719
9451
|
return CreateWebhookResponse.from_dict(res)
|
|
8720
9452
|
|
|
8721
9453
|
def delete_comment(self, id: str):
|
|
8722
|
-
"""
|
|
8723
|
-
|
|
8724
|
-
Deletes a comment on a model version.
|
|
9454
|
+
"""Deletes a comment on a model version.
|
|
8725
9455
|
|
|
8726
9456
|
:param id: str
|
|
8727
9457
|
Unique identifier of an activity
|
|
@@ -8739,9 +9469,7 @@ class ModelRegistryAPI:
|
|
|
8739
9469
|
self._api.do("DELETE", "/api/2.0/mlflow/comments/delete", query=query, headers=headers)
|
|
8740
9470
|
|
|
8741
9471
|
def delete_model(self, name: str):
|
|
8742
|
-
"""
|
|
8743
|
-
|
|
8744
|
-
Deletes a registered model.
|
|
9472
|
+
"""Deletes a registered model.
|
|
8745
9473
|
|
|
8746
9474
|
:param name: str
|
|
8747
9475
|
Registered model unique name identifier.
|
|
@@ -8759,9 +9487,7 @@ class ModelRegistryAPI:
|
|
|
8759
9487
|
self._api.do("DELETE", "/api/2.0/mlflow/registered-models/delete", query=query, headers=headers)
|
|
8760
9488
|
|
|
8761
9489
|
def delete_model_tag(self, name: str, key: str):
|
|
8762
|
-
"""
|
|
8763
|
-
|
|
8764
|
-
Deletes the tag for a registered model.
|
|
9490
|
+
"""Deletes the tag for a registered model.
|
|
8765
9491
|
|
|
8766
9492
|
:param name: str
|
|
8767
9493
|
Name of the registered model that the tag was logged under.
|
|
@@ -8784,9 +9510,7 @@ class ModelRegistryAPI:
|
|
|
8784
9510
|
self._api.do("DELETE", "/api/2.0/mlflow/registered-models/delete-tag", query=query, headers=headers)
|
|
8785
9511
|
|
|
8786
9512
|
def delete_model_version(self, name: str, version: str):
|
|
8787
|
-
"""
|
|
8788
|
-
|
|
8789
|
-
Deletes a model version.
|
|
9513
|
+
"""Deletes a model version.
|
|
8790
9514
|
|
|
8791
9515
|
:param name: str
|
|
8792
9516
|
Name of the registered model
|
|
@@ -8808,9 +9532,7 @@ class ModelRegistryAPI:
|
|
|
8808
9532
|
self._api.do("DELETE", "/api/2.0/mlflow/model-versions/delete", query=query, headers=headers)
|
|
8809
9533
|
|
|
8810
9534
|
def delete_model_version_tag(self, name: str, version: str, key: str):
|
|
8811
|
-
"""
|
|
8812
|
-
|
|
8813
|
-
Deletes a model version tag.
|
|
9535
|
+
"""Deletes a model version tag.
|
|
8814
9536
|
|
|
8815
9537
|
:param name: str
|
|
8816
9538
|
Name of the registered model that the tag was logged under.
|
|
@@ -8837,23 +9559,15 @@ class ModelRegistryAPI:
|
|
|
8837
9559
|
self._api.do("DELETE", "/api/2.0/mlflow/model-versions/delete-tag", query=query, headers=headers)
|
|
8838
9560
|
|
|
8839
9561
|
def delete_transition_request(
|
|
8840
|
-
self,
|
|
8841
|
-
|
|
8842
|
-
version
|
|
8843
|
-
stage: DeleteTransitionRequestStage,
|
|
8844
|
-
creator: str,
|
|
8845
|
-
*,
|
|
8846
|
-
comment: Optional[str] = None,
|
|
8847
|
-
):
|
|
8848
|
-
"""Delete a transition request.
|
|
8849
|
-
|
|
8850
|
-
Cancels a model version stage transition request.
|
|
9562
|
+
self, name: str, version: str, stage: str, creator: str, *, comment: Optional[str] = None
|
|
9563
|
+
) -> DeleteTransitionRequestResponse:
|
|
9564
|
+
"""Cancels a model version stage transition request.
|
|
8851
9565
|
|
|
8852
9566
|
:param name: str
|
|
8853
9567
|
Name of the model.
|
|
8854
9568
|
:param version: str
|
|
8855
9569
|
Version of the model.
|
|
8856
|
-
:param stage:
|
|
9570
|
+
:param stage: str
|
|
8857
9571
|
Target stage of the transition request. Valid values are:
|
|
8858
9572
|
|
|
8859
9573
|
* `None`: The initial stage of a model version.
|
|
@@ -8869,7 +9583,7 @@ class ModelRegistryAPI:
|
|
|
8869
9583
|
:param comment: str (optional)
|
|
8870
9584
|
User-provided comment on the action.
|
|
8871
9585
|
|
|
8872
|
-
|
|
9586
|
+
:returns: :class:`DeleteTransitionRequestResponse`
|
|
8873
9587
|
"""
|
|
8874
9588
|
|
|
8875
9589
|
query = {}
|
|
@@ -8880,23 +9594,20 @@ class ModelRegistryAPI:
|
|
|
8880
9594
|
if name is not None:
|
|
8881
9595
|
query["name"] = name
|
|
8882
9596
|
if stage is not None:
|
|
8883
|
-
query["stage"] = stage
|
|
9597
|
+
query["stage"] = stage
|
|
8884
9598
|
if version is not None:
|
|
8885
9599
|
query["version"] = version
|
|
8886
9600
|
headers = {
|
|
8887
9601
|
"Accept": "application/json",
|
|
8888
9602
|
}
|
|
8889
9603
|
|
|
8890
|
-
self._api.do("DELETE", "/api/2.0/mlflow/transition-requests/delete", query=query, headers=headers)
|
|
8891
|
-
|
|
8892
|
-
def delete_webhook(self, *, id: Optional[str] = None):
|
|
8893
|
-
"""Delete a webhook.
|
|
9604
|
+
res = self._api.do("DELETE", "/api/2.0/mlflow/transition-requests/delete", query=query, headers=headers)
|
|
9605
|
+
return DeleteTransitionRequestResponse.from_dict(res)
|
|
8894
9606
|
|
|
8895
|
-
|
|
9607
|
+
def delete_webhook(self, id: str):
|
|
9608
|
+
"""**NOTE:** This endpoint is in Public Preview. Deletes a registry webhook.
|
|
8896
9609
|
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
:param id: str (optional)
|
|
9610
|
+
:param id: str
|
|
8900
9611
|
Webhook ID required to delete a registry webhook.
|
|
8901
9612
|
|
|
8902
9613
|
|
|
@@ -8912,9 +9623,7 @@ class ModelRegistryAPI:
|
|
|
8912
9623
|
self._api.do("DELETE", "/api/2.0/mlflow/registry-webhooks/delete", query=query, headers=headers)
|
|
8913
9624
|
|
|
8914
9625
|
def get_latest_versions(self, name: str, *, stages: Optional[List[str]] = None) -> Iterator[ModelVersion]:
|
|
8915
|
-
"""
|
|
8916
|
-
|
|
8917
|
-
Gets the latest version of a registered model.
|
|
9626
|
+
"""Gets the latest version of a registered model.
|
|
8918
9627
|
|
|
8919
9628
|
:param name: str
|
|
8920
9629
|
Registered model unique name identifier.
|
|
@@ -8938,9 +9647,7 @@ class ModelRegistryAPI:
|
|
|
8938
9647
|
return parsed if parsed is not None else []
|
|
8939
9648
|
|
|
8940
9649
|
def get_model(self, name: str) -> GetModelResponse:
|
|
8941
|
-
"""Get model.
|
|
8942
|
-
|
|
8943
|
-
Get the details of a model. This is a Databricks workspace version of the [MLflow endpoint] that also
|
|
9650
|
+
"""Get the details of a model. This is a Databricks workspace version of the [MLflow endpoint] that also
|
|
8944
9651
|
returns the model's Databricks workspace ID and the permission level of the requesting user on the
|
|
8945
9652
|
model.
|
|
8946
9653
|
|
|
@@ -8965,8 +9672,6 @@ class ModelRegistryAPI:
|
|
|
8965
9672
|
def get_model_version(self, name: str, version: str) -> GetModelVersionResponse:
|
|
8966
9673
|
"""Get a model version.
|
|
8967
9674
|
|
|
8968
|
-
Get a model version.
|
|
8969
|
-
|
|
8970
9675
|
:param name: str
|
|
8971
9676
|
Name of the registered model
|
|
8972
9677
|
:param version: str
|
|
@@ -8988,9 +9693,7 @@ class ModelRegistryAPI:
|
|
|
8988
9693
|
return GetModelVersionResponse.from_dict(res)
|
|
8989
9694
|
|
|
8990
9695
|
def get_model_version_download_uri(self, name: str, version: str) -> GetModelVersionDownloadUriResponse:
|
|
8991
|
-
"""
|
|
8992
|
-
|
|
8993
|
-
Gets a URI to download the model version.
|
|
9696
|
+
"""Gets a URI to download the model version.
|
|
8994
9697
|
|
|
8995
9698
|
:param name: str
|
|
8996
9699
|
Name of the registered model
|
|
@@ -9013,9 +9716,7 @@ class ModelRegistryAPI:
|
|
|
9013
9716
|
return GetModelVersionDownloadUriResponse.from_dict(res)
|
|
9014
9717
|
|
|
9015
9718
|
def get_permission_levels(self, registered_model_id: str) -> GetRegisteredModelPermissionLevelsResponse:
|
|
9016
|
-
"""
|
|
9017
|
-
|
|
9018
|
-
Gets the permission levels that a user can have on an object.
|
|
9719
|
+
"""Gets the permission levels that a user can have on an object.
|
|
9019
9720
|
|
|
9020
9721
|
:param registered_model_id: str
|
|
9021
9722
|
The registered model for which to get or manage permissions.
|
|
@@ -9033,9 +9734,7 @@ class ModelRegistryAPI:
|
|
|
9033
9734
|
return GetRegisteredModelPermissionLevelsResponse.from_dict(res)
|
|
9034
9735
|
|
|
9035
9736
|
def get_permissions(self, registered_model_id: str) -> RegisteredModelPermissions:
|
|
9036
|
-
"""
|
|
9037
|
-
|
|
9038
|
-
Gets the permissions of a registered model. Registered models can inherit permissions from their root
|
|
9737
|
+
"""Gets the permissions of a registered model. Registered models can inherit permissions from their root
|
|
9039
9738
|
object.
|
|
9040
9739
|
|
|
9041
9740
|
:param registered_model_id: str
|
|
@@ -9052,9 +9751,7 @@ class ModelRegistryAPI:
|
|
|
9052
9751
|
return RegisteredModelPermissions.from_dict(res)
|
|
9053
9752
|
|
|
9054
9753
|
def list_models(self, *, max_results: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[Model]:
|
|
9055
|
-
"""
|
|
9056
|
-
|
|
9057
|
-
Lists all available registered models, up to the limit specified in __max_results__.
|
|
9754
|
+
"""Lists all available registered models, up to the limit specified in __max_results__.
|
|
9058
9755
|
|
|
9059
9756
|
:param max_results: int (optional)
|
|
9060
9757
|
Maximum number of registered models desired. Max threshold is 1000.
|
|
@@ -9083,12 +9780,10 @@ class ModelRegistryAPI:
|
|
|
9083
9780
|
query["page_token"] = json["next_page_token"]
|
|
9084
9781
|
|
|
9085
9782
|
def list_transition_requests(self, name: str, version: str) -> Iterator[Activity]:
|
|
9086
|
-
"""
|
|
9087
|
-
|
|
9088
|
-
Gets a list of all open stage transition requests for the model version.
|
|
9783
|
+
"""Gets a list of all open stage transition requests for the model version.
|
|
9089
9784
|
|
|
9090
9785
|
:param name: str
|
|
9091
|
-
Name of the model.
|
|
9786
|
+
Name of the registered model.
|
|
9092
9787
|
:param version: str
|
|
9093
9788
|
Version of the model.
|
|
9094
9789
|
|
|
@@ -9112,21 +9807,48 @@ class ModelRegistryAPI:
|
|
|
9112
9807
|
self,
|
|
9113
9808
|
*,
|
|
9114
9809
|
events: Optional[List[RegistryWebhookEvent]] = None,
|
|
9810
|
+
max_results: Optional[int] = None,
|
|
9115
9811
|
model_name: Optional[str] = None,
|
|
9116
9812
|
page_token: Optional[str] = None,
|
|
9117
9813
|
) -> Iterator[RegistryWebhook]:
|
|
9118
|
-
"""
|
|
9814
|
+
"""**NOTE:** This endpoint is in Public Preview. Lists all registry webhooks.
|
|
9119
9815
|
|
|
9120
|
-
|
|
9816
|
+
:param events: List[:class:`RegistryWebhookEvent`] (optional)
|
|
9817
|
+
Events that trigger the webhook. * `MODEL_VERSION_CREATED`: A new model version was created for the
|
|
9818
|
+
associated model.
|
|
9121
9819
|
|
|
9122
|
-
|
|
9820
|
+
* `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was changed.
|
|
9821
|
+
|
|
9822
|
+
* `TRANSITION_REQUEST_CREATED`: A user requested a model version’s stage be transitioned.
|
|
9823
|
+
|
|
9824
|
+
* `COMMENT_CREATED`: A user wrote a comment on a registered model.
|
|
9825
|
+
|
|
9826
|
+
* `REGISTERED_MODEL_CREATED`: A new registered model was created. This event type can only be
|
|
9827
|
+
specified for a registry-wide webhook, which can be created by not specifying a model name in the
|
|
9828
|
+
create request.
|
|
9829
|
+
|
|
9830
|
+
* `MODEL_VERSION_TAG_SET`: A user set a tag on the model version.
|
|
9831
|
+
|
|
9832
|
+
* `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was transitioned to staging.
|
|
9833
|
+
|
|
9834
|
+
* `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was transitioned to production.
|
|
9835
|
+
|
|
9836
|
+
* `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived.
|
|
9837
|
+
|
|
9838
|
+
* `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model version be transitioned to
|
|
9839
|
+
staging.
|
|
9840
|
+
|
|
9841
|
+
* `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model version be transitioned to
|
|
9842
|
+
production.
|
|
9843
|
+
|
|
9844
|
+
* `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model version be archived.
|
|
9123
9845
|
|
|
9124
|
-
:param events: List[:class:`RegistryWebhookEvent`] (optional)
|
|
9125
9846
|
If `events` is specified, any webhook with one or more of the specified trigger events is included
|
|
9126
9847
|
in the output. If `events` is not specified, webhooks of all event types are included in the output.
|
|
9848
|
+
:param max_results: int (optional)
|
|
9127
9849
|
:param model_name: str (optional)
|
|
9128
|
-
If not specified, all webhooks associated with the specified events are
|
|
9129
|
-
associated model.
|
|
9850
|
+
Registered model name If not specified, all webhooks associated with the specified events are
|
|
9851
|
+
listed, regardless of their associated model.
|
|
9130
9852
|
:param page_token: str (optional)
|
|
9131
9853
|
Token indicating the page of artifact results to fetch
|
|
9132
9854
|
|
|
@@ -9136,6 +9858,8 @@ class ModelRegistryAPI:
|
|
|
9136
9858
|
query = {}
|
|
9137
9859
|
if events is not None:
|
|
9138
9860
|
query["events"] = [v.value for v in events]
|
|
9861
|
+
if max_results is not None:
|
|
9862
|
+
query["max_results"] = max_results
|
|
9139
9863
|
if model_name is not None:
|
|
9140
9864
|
query["model_name"] = model_name
|
|
9141
9865
|
if page_token is not None:
|
|
@@ -9154,17 +9878,15 @@ class ModelRegistryAPI:
|
|
|
9154
9878
|
query["page_token"] = json["next_page_token"]
|
|
9155
9879
|
|
|
9156
9880
|
def reject_transition_request(
|
|
9157
|
-
self, name: str, version: str, stage:
|
|
9881
|
+
self, name: str, version: str, stage: str, *, comment: Optional[str] = None
|
|
9158
9882
|
) -> RejectTransitionRequestResponse:
|
|
9159
|
-
"""
|
|
9160
|
-
|
|
9161
|
-
Rejects a model version stage transition request.
|
|
9883
|
+
"""Rejects a model version stage transition request.
|
|
9162
9884
|
|
|
9163
9885
|
:param name: str
|
|
9164
9886
|
Name of the model.
|
|
9165
9887
|
:param version: str
|
|
9166
9888
|
Version of the model.
|
|
9167
|
-
:param stage:
|
|
9889
|
+
:param stage: str
|
|
9168
9890
|
Target stage of the transition. Valid values are:
|
|
9169
9891
|
|
|
9170
9892
|
* `None`: The initial stage of a model version.
|
|
@@ -9185,7 +9907,7 @@ class ModelRegistryAPI:
|
|
|
9185
9907
|
if name is not None:
|
|
9186
9908
|
body["name"] = name
|
|
9187
9909
|
if stage is not None:
|
|
9188
|
-
body["stage"] = stage
|
|
9910
|
+
body["stage"] = stage
|
|
9189
9911
|
if version is not None:
|
|
9190
9912
|
body["version"] = version
|
|
9191
9913
|
headers = {
|
|
@@ -9197,9 +9919,7 @@ class ModelRegistryAPI:
|
|
|
9197
9919
|
return RejectTransitionRequestResponse.from_dict(res)
|
|
9198
9920
|
|
|
9199
9921
|
def rename_model(self, name: str, *, new_name: Optional[str] = None) -> RenameModelResponse:
|
|
9200
|
-
"""
|
|
9201
|
-
|
|
9202
|
-
Renames a registered model.
|
|
9922
|
+
"""Renames a registered model.
|
|
9203
9923
|
|
|
9204
9924
|
:param name: str
|
|
9205
9925
|
Registered model unique name identifier.
|
|
@@ -9229,9 +9949,7 @@ class ModelRegistryAPI:
|
|
|
9229
9949
|
order_by: Optional[List[str]] = None,
|
|
9230
9950
|
page_token: Optional[str] = None,
|
|
9231
9951
|
) -> Iterator[ModelVersion]:
|
|
9232
|
-
"""Searches model versions.
|
|
9233
|
-
|
|
9234
|
-
Searches for specific model versions based on the supplied __filter__.
|
|
9952
|
+
"""Searches for specific model versions based on the supplied __filter__.
|
|
9235
9953
|
|
|
9236
9954
|
:param filter: str (optional)
|
|
9237
9955
|
String filter condition, like "name='my-model-name'". Must be a single boolean condition, with
|
|
@@ -9278,9 +9996,7 @@ class ModelRegistryAPI:
|
|
|
9278
9996
|
order_by: Optional[List[str]] = None,
|
|
9279
9997
|
page_token: Optional[str] = None,
|
|
9280
9998
|
) -> Iterator[Model]:
|
|
9281
|
-
"""Search models.
|
|
9282
|
-
|
|
9283
|
-
Search for registered models based on the specified __filter__.
|
|
9999
|
+
"""Search for registered models based on the specified __filter__.
|
|
9284
10000
|
|
|
9285
10001
|
:param filter: str (optional)
|
|
9286
10002
|
String filter condition, like "name LIKE 'my-model-name'". Interpreted in the backend automatically
|
|
@@ -9321,9 +10037,7 @@ class ModelRegistryAPI:
|
|
|
9321
10037
|
query["page_token"] = json["next_page_token"]
|
|
9322
10038
|
|
|
9323
10039
|
def set_model_tag(self, name: str, key: str, value: str):
|
|
9324
|
-
"""
|
|
9325
|
-
|
|
9326
|
-
Sets a tag on a registered model.
|
|
10040
|
+
"""Sets a tag on a registered model.
|
|
9327
10041
|
|
|
9328
10042
|
:param name: str
|
|
9329
10043
|
Unique name of the model.
|
|
@@ -9352,9 +10066,7 @@ class ModelRegistryAPI:
|
|
|
9352
10066
|
self._api.do("POST", "/api/2.0/mlflow/registered-models/set-tag", body=body, headers=headers)
|
|
9353
10067
|
|
|
9354
10068
|
def set_model_version_tag(self, name: str, version: str, key: str, value: str):
|
|
9355
|
-
"""
|
|
9356
|
-
|
|
9357
|
-
Sets a model version tag.
|
|
10069
|
+
"""Sets a model version tag.
|
|
9358
10070
|
|
|
9359
10071
|
:param name: str
|
|
9360
10072
|
Unique name of the model.
|
|
@@ -9392,9 +10104,7 @@ class ModelRegistryAPI:
|
|
|
9392
10104
|
*,
|
|
9393
10105
|
access_control_list: Optional[List[RegisteredModelAccessControlRequest]] = None,
|
|
9394
10106
|
) -> RegisteredModelPermissions:
|
|
9395
|
-
"""
|
|
9396
|
-
|
|
9397
|
-
Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
10107
|
+
"""Sets permissions on an object, replacing existing permissions if they exist. Deletes all direct
|
|
9398
10108
|
permissions if none are specified. Objects can inherit permissions from their root object.
|
|
9399
10109
|
|
|
9400
10110
|
:param registered_model_id: str
|
|
@@ -9419,11 +10129,7 @@ class ModelRegistryAPI:
|
|
|
9419
10129
|
def test_registry_webhook(
|
|
9420
10130
|
self, id: str, *, event: Optional[RegistryWebhookEvent] = None
|
|
9421
10131
|
) -> TestRegistryWebhookResponse:
|
|
9422
|
-
"""
|
|
9423
|
-
|
|
9424
|
-
**NOTE:** This endpoint is in Public Preview.
|
|
9425
|
-
|
|
9426
|
-
Tests a registry webhook.
|
|
10132
|
+
"""**NOTE:** This endpoint is in Public Preview. Tests a registry webhook.
|
|
9427
10133
|
|
|
9428
10134
|
:param id: str
|
|
9429
10135
|
Webhook ID
|
|
@@ -9447,12 +10153,10 @@ class ModelRegistryAPI:
|
|
|
9447
10153
|
return TestRegistryWebhookResponse.from_dict(res)
|
|
9448
10154
|
|
|
9449
10155
|
def transition_stage(
|
|
9450
|
-
self, name: str, version: str, stage:
|
|
10156
|
+
self, name: str, version: str, stage: str, archive_existing_versions: bool, *, comment: Optional[str] = None
|
|
9451
10157
|
) -> TransitionStageResponse:
|
|
9452
|
-
"""Transition a stage.
|
|
9453
|
-
|
|
9454
|
-
Transition a model version's stage. This is a Databricks workspace version of the [MLflow endpoint]
|
|
9455
|
-
that also accepts a comment associated with the transition to be recorded.",
|
|
10158
|
+
"""Transition a model version's stage. This is a Databricks workspace version of the [MLflow endpoint]
|
|
10159
|
+
that also accepts a comment associated with the transition to be recorded.
|
|
9456
10160
|
|
|
9457
10161
|
[MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#transition-modelversion-stage
|
|
9458
10162
|
|
|
@@ -9460,7 +10164,7 @@ class ModelRegistryAPI:
|
|
|
9460
10164
|
Name of the model.
|
|
9461
10165
|
:param version: str
|
|
9462
10166
|
Version of the model.
|
|
9463
|
-
:param stage:
|
|
10167
|
+
:param stage: str
|
|
9464
10168
|
Target stage of the transition. Valid values are:
|
|
9465
10169
|
|
|
9466
10170
|
* `None`: The initial stage of a model version.
|
|
@@ -9485,7 +10189,7 @@ class ModelRegistryAPI:
|
|
|
9485
10189
|
if name is not None:
|
|
9486
10190
|
body["name"] = name
|
|
9487
10191
|
if stage is not None:
|
|
9488
|
-
body["stage"] = stage
|
|
10192
|
+
body["stage"] = stage
|
|
9489
10193
|
if version is not None:
|
|
9490
10194
|
body["version"] = version
|
|
9491
10195
|
headers = {
|
|
@@ -9499,9 +10203,7 @@ class ModelRegistryAPI:
|
|
|
9499
10203
|
return TransitionStageResponse.from_dict(res)
|
|
9500
10204
|
|
|
9501
10205
|
def update_comment(self, id: str, comment: str) -> UpdateCommentResponse:
|
|
9502
|
-
"""
|
|
9503
|
-
|
|
9504
|
-
Post an edit to a comment on a model version.
|
|
10206
|
+
"""Post an edit to a comment on a model version.
|
|
9505
10207
|
|
|
9506
10208
|
:param id: str
|
|
9507
10209
|
Unique identifier of an activity
|
|
@@ -9523,17 +10225,15 @@ class ModelRegistryAPI:
|
|
|
9523
10225
|
res = self._api.do("PATCH", "/api/2.0/mlflow/comments/update", body=body, headers=headers)
|
|
9524
10226
|
return UpdateCommentResponse.from_dict(res)
|
|
9525
10227
|
|
|
9526
|
-
def update_model(self, name: str, *, description: Optional[str] = None):
|
|
9527
|
-
"""
|
|
9528
|
-
|
|
9529
|
-
Updates a registered model.
|
|
10228
|
+
def update_model(self, name: str, *, description: Optional[str] = None) -> UpdateModelResponse:
|
|
10229
|
+
"""Updates a registered model.
|
|
9530
10230
|
|
|
9531
10231
|
:param name: str
|
|
9532
10232
|
Registered model unique name identifier.
|
|
9533
10233
|
:param description: str (optional)
|
|
9534
10234
|
If provided, updates the description for this `registered_model`.
|
|
9535
10235
|
|
|
9536
|
-
|
|
10236
|
+
:returns: :class:`UpdateModelResponse`
|
|
9537
10237
|
"""
|
|
9538
10238
|
body = {}
|
|
9539
10239
|
if description is not None:
|
|
@@ -9545,12 +10245,13 @@ class ModelRegistryAPI:
|
|
|
9545
10245
|
"Content-Type": "application/json",
|
|
9546
10246
|
}
|
|
9547
10247
|
|
|
9548
|
-
self._api.do("PATCH", "/api/2.0/mlflow/registered-models/update", body=body, headers=headers)
|
|
9549
|
-
|
|
9550
|
-
def update_model_version(self, name: str, version: str, *, description: Optional[str] = None):
|
|
9551
|
-
"""Update model version.
|
|
10248
|
+
res = self._api.do("PATCH", "/api/2.0/mlflow/registered-models/update", body=body, headers=headers)
|
|
10249
|
+
return UpdateModelResponse.from_dict(res)
|
|
9552
10250
|
|
|
9553
|
-
|
|
10251
|
+
def update_model_version(
|
|
10252
|
+
self, name: str, version: str, *, description: Optional[str] = None
|
|
10253
|
+
) -> UpdateModelVersionResponse:
|
|
10254
|
+
"""Updates the model version.
|
|
9554
10255
|
|
|
9555
10256
|
:param name: str
|
|
9556
10257
|
Name of the registered model
|
|
@@ -9559,7 +10260,7 @@ class ModelRegistryAPI:
|
|
|
9559
10260
|
:param description: str (optional)
|
|
9560
10261
|
If provided, updates the description for this `registered_model`.
|
|
9561
10262
|
|
|
9562
|
-
|
|
10263
|
+
:returns: :class:`UpdateModelVersionResponse`
|
|
9563
10264
|
"""
|
|
9564
10265
|
body = {}
|
|
9565
10266
|
if description is not None:
|
|
@@ -9573,7 +10274,8 @@ class ModelRegistryAPI:
|
|
|
9573
10274
|
"Content-Type": "application/json",
|
|
9574
10275
|
}
|
|
9575
10276
|
|
|
9576
|
-
self._api.do("PATCH", "/api/2.0/mlflow/model-versions/update", body=body, headers=headers)
|
|
10277
|
+
res = self._api.do("PATCH", "/api/2.0/mlflow/model-versions/update", body=body, headers=headers)
|
|
10278
|
+
return UpdateModelVersionResponse.from_dict(res)
|
|
9577
10279
|
|
|
9578
10280
|
def update_permissions(
|
|
9579
10281
|
self,
|
|
@@ -9581,9 +10283,7 @@ class ModelRegistryAPI:
|
|
|
9581
10283
|
*,
|
|
9582
10284
|
access_control_list: Optional[List[RegisteredModelAccessControlRequest]] = None,
|
|
9583
10285
|
) -> RegisteredModelPermissions:
|
|
9584
|
-
"""
|
|
9585
|
-
|
|
9586
|
-
Updates the permissions on a registered model. Registered models can inherit permissions from their
|
|
10286
|
+
"""Updates the permissions on a registered model. Registered models can inherit permissions from their
|
|
9587
10287
|
root object.
|
|
9588
10288
|
|
|
9589
10289
|
:param registered_model_id: str
|
|
@@ -9614,12 +10314,8 @@ class ModelRegistryAPI:
|
|
|
9614
10314
|
http_url_spec: Optional[HttpUrlSpec] = None,
|
|
9615
10315
|
job_spec: Optional[JobSpec] = None,
|
|
9616
10316
|
status: Optional[RegistryWebhookStatus] = None,
|
|
9617
|
-
):
|
|
9618
|
-
"""
|
|
9619
|
-
|
|
9620
|
-
**NOTE:** This endpoint is in Public Preview.
|
|
9621
|
-
|
|
9622
|
-
Updates a registry webhook.
|
|
10317
|
+
) -> UpdateWebhookResponse:
|
|
10318
|
+
"""**NOTE:** This endpoint is in Public Preview. Updates a registry webhook.
|
|
9623
10319
|
|
|
9624
10320
|
:param id: str
|
|
9625
10321
|
Webhook ID
|
|
@@ -9657,15 +10353,8 @@ class ModelRegistryAPI:
|
|
|
9657
10353
|
:param http_url_spec: :class:`HttpUrlSpec` (optional)
|
|
9658
10354
|
:param job_spec: :class:`JobSpec` (optional)
|
|
9659
10355
|
:param status: :class:`RegistryWebhookStatus` (optional)
|
|
9660
|
-
Enable or disable triggering the webhook, or put the webhook into test mode. The default is
|
|
9661
|
-
`ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.
|
|
9662
|
-
|
|
9663
|
-
* `DISABLED`: Webhook is not triggered.
|
|
9664
|
-
|
|
9665
|
-
* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a real
|
|
9666
|
-
event.
|
|
9667
|
-
|
|
9668
10356
|
|
|
10357
|
+
:returns: :class:`UpdateWebhookResponse`
|
|
9669
10358
|
"""
|
|
9670
10359
|
body = {}
|
|
9671
10360
|
if description is not None:
|
|
@@ -9685,4 +10374,5 @@ class ModelRegistryAPI:
|
|
|
9685
10374
|
"Content-Type": "application/json",
|
|
9686
10375
|
}
|
|
9687
10376
|
|
|
9688
|
-
self._api.do("PATCH", "/api/2.0/mlflow/registry-webhooks/update", body=body, headers=headers)
|
|
10377
|
+
res = self._api.do("PATCH", "/api/2.0/mlflow/registry-webhooks/update", body=body, headers=headers)
|
|
10378
|
+
return UpdateWebhookResponse.from_dict(res)
|