databricks-sdk 0.57.0__py3-none-any.whl → 0.59.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 -9
- databricks/sdk/service/aibuilder.py +0 -163
- databricks/sdk/service/apps.py +53 -49
- databricks/sdk/service/billing.py +62 -223
- databricks/sdk/service/catalog.py +3052 -3707
- databricks/sdk/service/cleanrooms.py +5 -54
- databricks/sdk/service/compute.py +579 -2715
- databricks/sdk/service/dashboards.py +108 -317
- databricks/sdk/service/database.py +603 -122
- databricks/sdk/service/files.py +2 -218
- databricks/sdk/service/iam.py +19 -298
- databricks/sdk/service/jobs.py +77 -1263
- databricks/sdk/service/marketplace.py +3 -575
- databricks/sdk/service/ml.py +816 -2734
- databricks/sdk/service/oauth2.py +122 -238
- databricks/sdk/service/pipelines.py +133 -724
- databricks/sdk/service/provisioning.py +36 -757
- databricks/sdk/service/qualitymonitorv2.py +0 -18
- databricks/sdk/service/serving.py +37 -583
- databricks/sdk/service/settings.py +282 -1768
- databricks/sdk/service/sharing.py +6 -478
- databricks/sdk/service/sql.py +129 -1696
- databricks/sdk/service/vectorsearch.py +0 -410
- databricks/sdk/service/workspace.py +252 -727
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/RECORD +31 -31
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.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
|
|
|
@@ -179,77 +174,10 @@ class ActivityType(Enum):
|
|
|
179
174
|
SYSTEM_TRANSITION = "SYSTEM_TRANSITION"
|
|
180
175
|
|
|
181
176
|
|
|
182
|
-
@dataclass
|
|
183
|
-
class ApproveTransitionRequest:
|
|
184
|
-
name: str
|
|
185
|
-
"""Name of the model."""
|
|
186
|
-
|
|
187
|
-
version: str
|
|
188
|
-
"""Version of the model."""
|
|
189
|
-
|
|
190
|
-
stage: Stage
|
|
191
|
-
"""Target stage of the transition. Valid values are:
|
|
192
|
-
|
|
193
|
-
* `None`: The initial stage of a model version.
|
|
194
|
-
|
|
195
|
-
* `Staging`: Staging or pre-production stage.
|
|
196
|
-
|
|
197
|
-
* `Production`: Production stage.
|
|
198
|
-
|
|
199
|
-
* `Archived`: Archived stage."""
|
|
200
|
-
|
|
201
|
-
archive_existing_versions: bool
|
|
202
|
-
"""Specifies whether to archive all current model versions in the target stage."""
|
|
203
|
-
|
|
204
|
-
comment: Optional[str] = None
|
|
205
|
-
"""User-provided comment on the action."""
|
|
206
|
-
|
|
207
|
-
def as_dict(self) -> dict:
|
|
208
|
-
"""Serializes the ApproveTransitionRequest into a dictionary suitable for use as a JSON request body."""
|
|
209
|
-
body = {}
|
|
210
|
-
if self.archive_existing_versions is not None:
|
|
211
|
-
body["archive_existing_versions"] = self.archive_existing_versions
|
|
212
|
-
if self.comment is not None:
|
|
213
|
-
body["comment"] = self.comment
|
|
214
|
-
if self.name is not None:
|
|
215
|
-
body["name"] = self.name
|
|
216
|
-
if self.stage is not None:
|
|
217
|
-
body["stage"] = self.stage.value
|
|
218
|
-
if self.version is not None:
|
|
219
|
-
body["version"] = self.version
|
|
220
|
-
return body
|
|
221
|
-
|
|
222
|
-
def as_shallow_dict(self) -> dict:
|
|
223
|
-
"""Serializes the ApproveTransitionRequest into a shallow dictionary of its immediate attributes."""
|
|
224
|
-
body = {}
|
|
225
|
-
if self.archive_existing_versions is not None:
|
|
226
|
-
body["archive_existing_versions"] = self.archive_existing_versions
|
|
227
|
-
if self.comment is not None:
|
|
228
|
-
body["comment"] = self.comment
|
|
229
|
-
if self.name is not None:
|
|
230
|
-
body["name"] = self.name
|
|
231
|
-
if self.stage is not None:
|
|
232
|
-
body["stage"] = self.stage
|
|
233
|
-
if self.version is not None:
|
|
234
|
-
body["version"] = self.version
|
|
235
|
-
return body
|
|
236
|
-
|
|
237
|
-
@classmethod
|
|
238
|
-
def from_dict(cls, d: Dict[str, Any]) -> ApproveTransitionRequest:
|
|
239
|
-
"""Deserializes the ApproveTransitionRequest from a dictionary."""
|
|
240
|
-
return cls(
|
|
241
|
-
archive_existing_versions=d.get("archive_existing_versions", None),
|
|
242
|
-
comment=d.get("comment", None),
|
|
243
|
-
name=d.get("name", None),
|
|
244
|
-
stage=_enum(d, "stage", Stage),
|
|
245
|
-
version=d.get("version", None),
|
|
246
|
-
)
|
|
247
|
-
|
|
248
|
-
|
|
249
177
|
@dataclass
|
|
250
178
|
class ApproveTransitionRequestResponse:
|
|
251
179
|
activity: Optional[Activity] = None
|
|
252
|
-
"""
|
|
180
|
+
"""New activity generated as a result of this operation."""
|
|
253
181
|
|
|
254
182
|
def as_dict(self) -> dict:
|
|
255
183
|
"""Serializes the ApproveTransitionRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -272,30 +200,41 @@ class ApproveTransitionRequestResponse:
|
|
|
272
200
|
|
|
273
201
|
|
|
274
202
|
class CommentActivityAction(Enum):
|
|
275
|
-
"""An action that a user (with sufficient permissions) could take on
|
|
276
|
-
|
|
203
|
+
"""An action that a user (with sufficient permissions) could take on an activity or comment.
|
|
204
|
+
|
|
205
|
+
For activities, valid values are: * `APPROVE_TRANSITION_REQUEST`: Approve a transition request
|
|
206
|
+
|
|
207
|
+
* `REJECT_TRANSITION_REQUEST`: Reject a transition request
|
|
208
|
+
|
|
209
|
+
* `CANCEL_TRANSITION_REQUEST`: Cancel (delete) a transition request
|
|
210
|
+
|
|
211
|
+
For comments, valid values are: * `EDIT_COMMENT`: Edit the comment
|
|
277
212
|
|
|
278
213
|
* `DELETE_COMMENT`: Delete the comment"""
|
|
279
214
|
|
|
215
|
+
APPROVE_TRANSITION_REQUEST = "APPROVE_TRANSITION_REQUEST"
|
|
216
|
+
CANCEL_TRANSITION_REQUEST = "CANCEL_TRANSITION_REQUEST"
|
|
280
217
|
DELETE_COMMENT = "DELETE_COMMENT"
|
|
281
218
|
EDIT_COMMENT = "EDIT_COMMENT"
|
|
219
|
+
REJECT_TRANSITION_REQUEST = "REJECT_TRANSITION_REQUEST"
|
|
282
220
|
|
|
283
221
|
|
|
284
222
|
@dataclass
|
|
285
223
|
class CommentObject:
|
|
286
|
-
"""
|
|
224
|
+
"""For activities, this contains the activity recorded for the action. For comments, this contains
|
|
225
|
+
the comment details. For transition requests, this contains the transition request details."""
|
|
287
226
|
|
|
288
227
|
available_actions: Optional[List[CommentActivityAction]] = None
|
|
289
228
|
"""Array of actions on the activity allowed for the current viewer."""
|
|
290
229
|
|
|
291
230
|
comment: Optional[str] = None
|
|
292
|
-
"""User-provided comment
|
|
231
|
+
"""User-provided comment associated with the activity, comment, or transition request."""
|
|
293
232
|
|
|
294
233
|
creation_timestamp: Optional[int] = None
|
|
295
234
|
"""Creation time of the object, as a Unix timestamp in milliseconds."""
|
|
296
235
|
|
|
297
236
|
id: Optional[str] = None
|
|
298
|
-
"""
|
|
237
|
+
"""Unique identifier for the object."""
|
|
299
238
|
|
|
300
239
|
last_updated_timestamp: Optional[int] = None
|
|
301
240
|
"""Time of the object at last update, as a Unix timestamp in milliseconds."""
|
|
@@ -350,49 +289,10 @@ class CommentObject:
|
|
|
350
289
|
)
|
|
351
290
|
|
|
352
291
|
|
|
353
|
-
@dataclass
|
|
354
|
-
class CreateComment:
|
|
355
|
-
name: str
|
|
356
|
-
"""Name of the model."""
|
|
357
|
-
|
|
358
|
-
version: str
|
|
359
|
-
"""Version of the model."""
|
|
360
|
-
|
|
361
|
-
comment: str
|
|
362
|
-
"""User-provided comment on the action."""
|
|
363
|
-
|
|
364
|
-
def as_dict(self) -> dict:
|
|
365
|
-
"""Serializes the CreateComment into a dictionary suitable for use as a JSON request body."""
|
|
366
|
-
body = {}
|
|
367
|
-
if self.comment is not None:
|
|
368
|
-
body["comment"] = self.comment
|
|
369
|
-
if self.name is not None:
|
|
370
|
-
body["name"] = self.name
|
|
371
|
-
if self.version is not None:
|
|
372
|
-
body["version"] = self.version
|
|
373
|
-
return body
|
|
374
|
-
|
|
375
|
-
def as_shallow_dict(self) -> dict:
|
|
376
|
-
"""Serializes the CreateComment into a shallow dictionary of its immediate attributes."""
|
|
377
|
-
body = {}
|
|
378
|
-
if self.comment is not None:
|
|
379
|
-
body["comment"] = self.comment
|
|
380
|
-
if self.name is not None:
|
|
381
|
-
body["name"] = self.name
|
|
382
|
-
if self.version is not None:
|
|
383
|
-
body["version"] = self.version
|
|
384
|
-
return body
|
|
385
|
-
|
|
386
|
-
@classmethod
|
|
387
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateComment:
|
|
388
|
-
"""Deserializes the CreateComment from a dictionary."""
|
|
389
|
-
return cls(comment=d.get("comment", None), name=d.get("name", None), version=d.get("version", None))
|
|
390
|
-
|
|
391
|
-
|
|
392
292
|
@dataclass
|
|
393
293
|
class CreateCommentResponse:
|
|
394
294
|
comment: Optional[CommentObject] = None
|
|
395
|
-
"""
|
|
295
|
+
"""New comment object"""
|
|
396
296
|
|
|
397
297
|
def as_dict(self) -> dict:
|
|
398
298
|
"""Serializes the CreateCommentResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -414,53 +314,6 @@ class CreateCommentResponse:
|
|
|
414
314
|
return cls(comment=_from_dict(d, "comment", CommentObject))
|
|
415
315
|
|
|
416
316
|
|
|
417
|
-
@dataclass
|
|
418
|
-
class CreateExperiment:
|
|
419
|
-
name: str
|
|
420
|
-
"""Experiment name."""
|
|
421
|
-
|
|
422
|
-
artifact_location: Optional[str] = None
|
|
423
|
-
"""Location where all artifacts for the experiment are stored. If not provided, the remote server
|
|
424
|
-
will select an appropriate default."""
|
|
425
|
-
|
|
426
|
-
tags: Optional[List[ExperimentTag]] = None
|
|
427
|
-
"""A collection of tags to set on the experiment. Maximum tag size and number of tags per request
|
|
428
|
-
depends on the storage backend. All storage backends are guaranteed to support tag keys up to
|
|
429
|
-
250 bytes in size and tag values up to 5000 bytes in size. All storage backends are also
|
|
430
|
-
guaranteed to support up to 20 tags per request."""
|
|
431
|
-
|
|
432
|
-
def as_dict(self) -> dict:
|
|
433
|
-
"""Serializes the CreateExperiment into a dictionary suitable for use as a JSON request body."""
|
|
434
|
-
body = {}
|
|
435
|
-
if self.artifact_location is not None:
|
|
436
|
-
body["artifact_location"] = self.artifact_location
|
|
437
|
-
if self.name is not None:
|
|
438
|
-
body["name"] = self.name
|
|
439
|
-
if self.tags:
|
|
440
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
441
|
-
return body
|
|
442
|
-
|
|
443
|
-
def as_shallow_dict(self) -> dict:
|
|
444
|
-
"""Serializes the CreateExperiment into a shallow dictionary of its immediate attributes."""
|
|
445
|
-
body = {}
|
|
446
|
-
if self.artifact_location is not None:
|
|
447
|
-
body["artifact_location"] = self.artifact_location
|
|
448
|
-
if self.name is not None:
|
|
449
|
-
body["name"] = self.name
|
|
450
|
-
if self.tags:
|
|
451
|
-
body["tags"] = self.tags
|
|
452
|
-
return body
|
|
453
|
-
|
|
454
|
-
@classmethod
|
|
455
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateExperiment:
|
|
456
|
-
"""Deserializes the CreateExperiment from a dictionary."""
|
|
457
|
-
return cls(
|
|
458
|
-
artifact_location=d.get("artifact_location", None),
|
|
459
|
-
name=d.get("name", None),
|
|
460
|
-
tags=_repeated_dict(d, "tags", ExperimentTag),
|
|
461
|
-
)
|
|
462
|
-
|
|
463
|
-
|
|
464
317
|
@dataclass
|
|
465
318
|
class CreateExperimentResponse:
|
|
466
319
|
experiment_id: Optional[str] = None
|
|
@@ -486,177 +339,6 @@ class CreateExperimentResponse:
|
|
|
486
339
|
return cls(experiment_id=d.get("experiment_id", None))
|
|
487
340
|
|
|
488
341
|
|
|
489
|
-
@dataclass
|
|
490
|
-
class CreateForecastingExperimentRequest:
|
|
491
|
-
train_data_path: str
|
|
492
|
-
"""The fully qualified path of a Unity Catalog table, formatted as
|
|
493
|
-
catalog_name.schema_name.table_name, used as training data for the forecasting model."""
|
|
494
|
-
|
|
495
|
-
target_column: str
|
|
496
|
-
"""The column in the input training table used as the prediction target for model training. The
|
|
497
|
-
values in this column are used as the ground truth for model training."""
|
|
498
|
-
|
|
499
|
-
time_column: str
|
|
500
|
-
"""The column in the input training table that represents each row's timestamp."""
|
|
501
|
-
|
|
502
|
-
forecast_granularity: str
|
|
503
|
-
"""The time interval between consecutive rows in the time series data. Possible values include: '1
|
|
504
|
-
second', '1 minute', '5 minutes', '10 minutes', '15 minutes', '30 minutes', 'Hourly', 'Daily',
|
|
505
|
-
'Weekly', 'Monthly', 'Quarterly', 'Yearly'."""
|
|
506
|
-
|
|
507
|
-
forecast_horizon: int
|
|
508
|
-
"""The number of time steps into the future to make predictions, calculated as a multiple of
|
|
509
|
-
forecast_granularity. This value represents how far ahead the model should forecast."""
|
|
510
|
-
|
|
511
|
-
custom_weights_column: Optional[str] = None
|
|
512
|
-
"""The column in the training table used to customize weights for each time series."""
|
|
513
|
-
|
|
514
|
-
experiment_path: Optional[str] = None
|
|
515
|
-
"""The path in the workspace to store the created experiment."""
|
|
516
|
-
|
|
517
|
-
future_feature_data_path: Optional[str] = None
|
|
518
|
-
"""The fully qualified path of a Unity Catalog table, formatted as
|
|
519
|
-
catalog_name.schema_name.table_name, used to store future feature data for predictions."""
|
|
520
|
-
|
|
521
|
-
holiday_regions: Optional[List[str]] = None
|
|
522
|
-
"""The region code(s) to automatically add holiday features. Currently supports only one region."""
|
|
523
|
-
|
|
524
|
-
include_features: Optional[List[str]] = None
|
|
525
|
-
"""Specifies the list of feature columns to include in model training. These columns must exist in
|
|
526
|
-
the training data and be of type string, numerical, or boolean. If not specified, no additional
|
|
527
|
-
features will be included. Note: Certain columns are automatically handled: - Automatically
|
|
528
|
-
excluded: split_column, target_column, custom_weights_column. - Automatically included:
|
|
529
|
-
time_column."""
|
|
530
|
-
|
|
531
|
-
max_runtime: Optional[int] = None
|
|
532
|
-
"""The maximum duration for the experiment in minutes. The experiment stops automatically if it
|
|
533
|
-
exceeds this limit."""
|
|
534
|
-
|
|
535
|
-
prediction_data_path: Optional[str] = None
|
|
536
|
-
"""The fully qualified path of a Unity Catalog table, formatted as
|
|
537
|
-
catalog_name.schema_name.table_name, used to store predictions."""
|
|
538
|
-
|
|
539
|
-
primary_metric: Optional[str] = None
|
|
540
|
-
"""The evaluation metric used to optimize the forecasting model."""
|
|
541
|
-
|
|
542
|
-
register_to: Optional[str] = None
|
|
543
|
-
"""The fully qualified path of a Unity Catalog model, formatted as
|
|
544
|
-
catalog_name.schema_name.model_name, used to store the best model."""
|
|
545
|
-
|
|
546
|
-
split_column: Optional[str] = None
|
|
547
|
-
"""// The column in the training table used for custom data splits. Values must be 'train',
|
|
548
|
-
'validate', or 'test'."""
|
|
549
|
-
|
|
550
|
-
timeseries_identifier_columns: Optional[List[str]] = None
|
|
551
|
-
"""The column in the training table used to group the dataset for predicting individual time
|
|
552
|
-
series."""
|
|
553
|
-
|
|
554
|
-
training_frameworks: Optional[List[str]] = None
|
|
555
|
-
"""List of frameworks to include for model tuning. Possible values are 'Prophet', 'ARIMA',
|
|
556
|
-
'DeepAR'. An empty list includes all supported frameworks."""
|
|
557
|
-
|
|
558
|
-
def as_dict(self) -> dict:
|
|
559
|
-
"""Serializes the CreateForecastingExperimentRequest into a dictionary suitable for use as a JSON request body."""
|
|
560
|
-
body = {}
|
|
561
|
-
if self.custom_weights_column is not None:
|
|
562
|
-
body["custom_weights_column"] = self.custom_weights_column
|
|
563
|
-
if self.experiment_path is not None:
|
|
564
|
-
body["experiment_path"] = self.experiment_path
|
|
565
|
-
if self.forecast_granularity is not None:
|
|
566
|
-
body["forecast_granularity"] = self.forecast_granularity
|
|
567
|
-
if self.forecast_horizon is not None:
|
|
568
|
-
body["forecast_horizon"] = self.forecast_horizon
|
|
569
|
-
if self.future_feature_data_path is not None:
|
|
570
|
-
body["future_feature_data_path"] = self.future_feature_data_path
|
|
571
|
-
if self.holiday_regions:
|
|
572
|
-
body["holiday_regions"] = [v for v in self.holiday_regions]
|
|
573
|
-
if self.include_features:
|
|
574
|
-
body["include_features"] = [v for v in self.include_features]
|
|
575
|
-
if self.max_runtime is not None:
|
|
576
|
-
body["max_runtime"] = self.max_runtime
|
|
577
|
-
if self.prediction_data_path is not None:
|
|
578
|
-
body["prediction_data_path"] = self.prediction_data_path
|
|
579
|
-
if self.primary_metric is not None:
|
|
580
|
-
body["primary_metric"] = self.primary_metric
|
|
581
|
-
if self.register_to is not None:
|
|
582
|
-
body["register_to"] = self.register_to
|
|
583
|
-
if self.split_column is not None:
|
|
584
|
-
body["split_column"] = self.split_column
|
|
585
|
-
if self.target_column is not None:
|
|
586
|
-
body["target_column"] = self.target_column
|
|
587
|
-
if self.time_column is not None:
|
|
588
|
-
body["time_column"] = self.time_column
|
|
589
|
-
if self.timeseries_identifier_columns:
|
|
590
|
-
body["timeseries_identifier_columns"] = [v for v in self.timeseries_identifier_columns]
|
|
591
|
-
if self.train_data_path is not None:
|
|
592
|
-
body["train_data_path"] = self.train_data_path
|
|
593
|
-
if self.training_frameworks:
|
|
594
|
-
body["training_frameworks"] = [v for v in self.training_frameworks]
|
|
595
|
-
return body
|
|
596
|
-
|
|
597
|
-
def as_shallow_dict(self) -> dict:
|
|
598
|
-
"""Serializes the CreateForecastingExperimentRequest into a shallow dictionary of its immediate attributes."""
|
|
599
|
-
body = {}
|
|
600
|
-
if self.custom_weights_column is not None:
|
|
601
|
-
body["custom_weights_column"] = self.custom_weights_column
|
|
602
|
-
if self.experiment_path is not None:
|
|
603
|
-
body["experiment_path"] = self.experiment_path
|
|
604
|
-
if self.forecast_granularity is not None:
|
|
605
|
-
body["forecast_granularity"] = self.forecast_granularity
|
|
606
|
-
if self.forecast_horizon is not None:
|
|
607
|
-
body["forecast_horizon"] = self.forecast_horizon
|
|
608
|
-
if self.future_feature_data_path is not None:
|
|
609
|
-
body["future_feature_data_path"] = self.future_feature_data_path
|
|
610
|
-
if self.holiday_regions:
|
|
611
|
-
body["holiday_regions"] = self.holiday_regions
|
|
612
|
-
if self.include_features:
|
|
613
|
-
body["include_features"] = self.include_features
|
|
614
|
-
if self.max_runtime is not None:
|
|
615
|
-
body["max_runtime"] = self.max_runtime
|
|
616
|
-
if self.prediction_data_path is not None:
|
|
617
|
-
body["prediction_data_path"] = self.prediction_data_path
|
|
618
|
-
if self.primary_metric is not None:
|
|
619
|
-
body["primary_metric"] = self.primary_metric
|
|
620
|
-
if self.register_to is not None:
|
|
621
|
-
body["register_to"] = self.register_to
|
|
622
|
-
if self.split_column is not None:
|
|
623
|
-
body["split_column"] = self.split_column
|
|
624
|
-
if self.target_column is not None:
|
|
625
|
-
body["target_column"] = self.target_column
|
|
626
|
-
if self.time_column is not None:
|
|
627
|
-
body["time_column"] = self.time_column
|
|
628
|
-
if self.timeseries_identifier_columns:
|
|
629
|
-
body["timeseries_identifier_columns"] = self.timeseries_identifier_columns
|
|
630
|
-
if self.train_data_path is not None:
|
|
631
|
-
body["train_data_path"] = self.train_data_path
|
|
632
|
-
if self.training_frameworks:
|
|
633
|
-
body["training_frameworks"] = self.training_frameworks
|
|
634
|
-
return body
|
|
635
|
-
|
|
636
|
-
@classmethod
|
|
637
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateForecastingExperimentRequest:
|
|
638
|
-
"""Deserializes the CreateForecastingExperimentRequest from a dictionary."""
|
|
639
|
-
return cls(
|
|
640
|
-
custom_weights_column=d.get("custom_weights_column", None),
|
|
641
|
-
experiment_path=d.get("experiment_path", None),
|
|
642
|
-
forecast_granularity=d.get("forecast_granularity", None),
|
|
643
|
-
forecast_horizon=d.get("forecast_horizon", None),
|
|
644
|
-
future_feature_data_path=d.get("future_feature_data_path", None),
|
|
645
|
-
holiday_regions=d.get("holiday_regions", None),
|
|
646
|
-
include_features=d.get("include_features", None),
|
|
647
|
-
max_runtime=d.get("max_runtime", None),
|
|
648
|
-
prediction_data_path=d.get("prediction_data_path", None),
|
|
649
|
-
primary_metric=d.get("primary_metric", None),
|
|
650
|
-
register_to=d.get("register_to", None),
|
|
651
|
-
split_column=d.get("split_column", None),
|
|
652
|
-
target_column=d.get("target_column", None),
|
|
653
|
-
time_column=d.get("time_column", None),
|
|
654
|
-
timeseries_identifier_columns=d.get("timeseries_identifier_columns", None),
|
|
655
|
-
train_data_path=d.get("train_data_path", None),
|
|
656
|
-
training_frameworks=d.get("training_frameworks", None),
|
|
657
|
-
)
|
|
658
|
-
|
|
659
|
-
|
|
660
342
|
@dataclass
|
|
661
343
|
class CreateForecastingExperimentResponse:
|
|
662
344
|
experiment_id: Optional[str] = None
|
|
@@ -682,73 +364,6 @@ class CreateForecastingExperimentResponse:
|
|
|
682
364
|
return cls(experiment_id=d.get("experiment_id", None))
|
|
683
365
|
|
|
684
366
|
|
|
685
|
-
@dataclass
|
|
686
|
-
class CreateLoggedModelRequest:
|
|
687
|
-
experiment_id: str
|
|
688
|
-
"""The ID of the experiment that owns the model."""
|
|
689
|
-
|
|
690
|
-
model_type: Optional[str] = None
|
|
691
|
-
"""The type of the model, such as ``"Agent"``, ``"Classifier"``, ``"LLM"``."""
|
|
692
|
-
|
|
693
|
-
name: Optional[str] = None
|
|
694
|
-
"""The name of the model (optional). If not specified one will be generated."""
|
|
695
|
-
|
|
696
|
-
params: Optional[List[LoggedModelParameter]] = None
|
|
697
|
-
"""Parameters attached to the model."""
|
|
698
|
-
|
|
699
|
-
source_run_id: Optional[str] = None
|
|
700
|
-
"""The ID of the run that created the model."""
|
|
701
|
-
|
|
702
|
-
tags: Optional[List[LoggedModelTag]] = None
|
|
703
|
-
"""Tags attached to the model."""
|
|
704
|
-
|
|
705
|
-
def as_dict(self) -> dict:
|
|
706
|
-
"""Serializes the CreateLoggedModelRequest into a dictionary suitable for use as a JSON request body."""
|
|
707
|
-
body = {}
|
|
708
|
-
if self.experiment_id is not None:
|
|
709
|
-
body["experiment_id"] = self.experiment_id
|
|
710
|
-
if self.model_type is not None:
|
|
711
|
-
body["model_type"] = self.model_type
|
|
712
|
-
if self.name is not None:
|
|
713
|
-
body["name"] = self.name
|
|
714
|
-
if self.params:
|
|
715
|
-
body["params"] = [v.as_dict() for v in self.params]
|
|
716
|
-
if self.source_run_id is not None:
|
|
717
|
-
body["source_run_id"] = self.source_run_id
|
|
718
|
-
if self.tags:
|
|
719
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
720
|
-
return body
|
|
721
|
-
|
|
722
|
-
def as_shallow_dict(self) -> dict:
|
|
723
|
-
"""Serializes the CreateLoggedModelRequest into a shallow dictionary of its immediate attributes."""
|
|
724
|
-
body = {}
|
|
725
|
-
if self.experiment_id is not None:
|
|
726
|
-
body["experiment_id"] = self.experiment_id
|
|
727
|
-
if self.model_type is not None:
|
|
728
|
-
body["model_type"] = self.model_type
|
|
729
|
-
if self.name is not None:
|
|
730
|
-
body["name"] = self.name
|
|
731
|
-
if self.params:
|
|
732
|
-
body["params"] = self.params
|
|
733
|
-
if self.source_run_id is not None:
|
|
734
|
-
body["source_run_id"] = self.source_run_id
|
|
735
|
-
if self.tags:
|
|
736
|
-
body["tags"] = self.tags
|
|
737
|
-
return body
|
|
738
|
-
|
|
739
|
-
@classmethod
|
|
740
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateLoggedModelRequest:
|
|
741
|
-
"""Deserializes the CreateLoggedModelRequest from a dictionary."""
|
|
742
|
-
return cls(
|
|
743
|
-
experiment_id=d.get("experiment_id", None),
|
|
744
|
-
model_type=d.get("model_type", None),
|
|
745
|
-
name=d.get("name", None),
|
|
746
|
-
params=_repeated_dict(d, "params", LoggedModelParameter),
|
|
747
|
-
source_run_id=d.get("source_run_id", None),
|
|
748
|
-
tags=_repeated_dict(d, "tags", LoggedModelTag),
|
|
749
|
-
)
|
|
750
|
-
|
|
751
|
-
|
|
752
367
|
@dataclass
|
|
753
368
|
class CreateLoggedModelResponse:
|
|
754
369
|
model: Optional[LoggedModel] = None
|
|
@@ -774,47 +389,6 @@ class CreateLoggedModelResponse:
|
|
|
774
389
|
return cls(model=_from_dict(d, "model", LoggedModel))
|
|
775
390
|
|
|
776
391
|
|
|
777
|
-
@dataclass
|
|
778
|
-
class CreateModelRequest:
|
|
779
|
-
name: str
|
|
780
|
-
"""Register models under this name"""
|
|
781
|
-
|
|
782
|
-
description: Optional[str] = None
|
|
783
|
-
"""Optional description for registered model."""
|
|
784
|
-
|
|
785
|
-
tags: Optional[List[ModelTag]] = None
|
|
786
|
-
"""Additional metadata for registered model."""
|
|
787
|
-
|
|
788
|
-
def as_dict(self) -> dict:
|
|
789
|
-
"""Serializes the CreateModelRequest into a dictionary suitable for use as a JSON request body."""
|
|
790
|
-
body = {}
|
|
791
|
-
if self.description is not None:
|
|
792
|
-
body["description"] = self.description
|
|
793
|
-
if self.name is not None:
|
|
794
|
-
body["name"] = self.name
|
|
795
|
-
if self.tags:
|
|
796
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
797
|
-
return body
|
|
798
|
-
|
|
799
|
-
def as_shallow_dict(self) -> dict:
|
|
800
|
-
"""Serializes the CreateModelRequest into a shallow dictionary of its immediate attributes."""
|
|
801
|
-
body = {}
|
|
802
|
-
if self.description is not None:
|
|
803
|
-
body["description"] = self.description
|
|
804
|
-
if self.name is not None:
|
|
805
|
-
body["name"] = self.name
|
|
806
|
-
if self.tags:
|
|
807
|
-
body["tags"] = self.tags
|
|
808
|
-
return body
|
|
809
|
-
|
|
810
|
-
@classmethod
|
|
811
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateModelRequest:
|
|
812
|
-
"""Deserializes the CreateModelRequest from a dictionary."""
|
|
813
|
-
return cls(
|
|
814
|
-
description=d.get("description", None), name=d.get("name", None), tags=_repeated_dict(d, "tags", ModelTag)
|
|
815
|
-
)
|
|
816
|
-
|
|
817
|
-
|
|
818
392
|
@dataclass
|
|
819
393
|
class CreateModelResponse:
|
|
820
394
|
registered_model: Optional[Model] = None
|
|
@@ -840,81 +414,12 @@ class CreateModelResponse:
|
|
|
840
414
|
|
|
841
415
|
|
|
842
416
|
@dataclass
|
|
843
|
-
class
|
|
844
|
-
|
|
845
|
-
"""
|
|
846
|
-
|
|
847
|
-
source: str
|
|
848
|
-
"""URI indicating the location of the model artifacts."""
|
|
849
|
-
|
|
850
|
-
description: Optional[str] = None
|
|
851
|
-
"""Optional description for model version."""
|
|
852
|
-
|
|
853
|
-
run_id: Optional[str] = None
|
|
854
|
-
"""MLflow run ID for correlation, if `source` was generated by an experiment run in MLflow tracking
|
|
855
|
-
server"""
|
|
856
|
-
|
|
857
|
-
run_link: Optional[str] = None
|
|
858
|
-
"""MLflow run link - this is the exact link of the run that generated this model version,
|
|
859
|
-
potentially hosted at another instance of MLflow."""
|
|
860
|
-
|
|
861
|
-
tags: Optional[List[ModelVersionTag]] = None
|
|
862
|
-
"""Additional metadata for model version."""
|
|
417
|
+
class CreateModelVersionResponse:
|
|
418
|
+
model_version: Optional[ModelVersion] = None
|
|
419
|
+
"""Return new version number generated for this model in registry."""
|
|
863
420
|
|
|
864
421
|
def as_dict(self) -> dict:
|
|
865
|
-
"""Serializes the
|
|
866
|
-
body = {}
|
|
867
|
-
if self.description is not None:
|
|
868
|
-
body["description"] = self.description
|
|
869
|
-
if self.name is not None:
|
|
870
|
-
body["name"] = self.name
|
|
871
|
-
if self.run_id is not None:
|
|
872
|
-
body["run_id"] = self.run_id
|
|
873
|
-
if self.run_link is not None:
|
|
874
|
-
body["run_link"] = self.run_link
|
|
875
|
-
if self.source is not None:
|
|
876
|
-
body["source"] = self.source
|
|
877
|
-
if self.tags:
|
|
878
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
879
|
-
return body
|
|
880
|
-
|
|
881
|
-
def as_shallow_dict(self) -> dict:
|
|
882
|
-
"""Serializes the CreateModelVersionRequest into a shallow dictionary of its immediate attributes."""
|
|
883
|
-
body = {}
|
|
884
|
-
if self.description is not None:
|
|
885
|
-
body["description"] = self.description
|
|
886
|
-
if self.name is not None:
|
|
887
|
-
body["name"] = self.name
|
|
888
|
-
if self.run_id is not None:
|
|
889
|
-
body["run_id"] = self.run_id
|
|
890
|
-
if self.run_link is not None:
|
|
891
|
-
body["run_link"] = self.run_link
|
|
892
|
-
if self.source is not None:
|
|
893
|
-
body["source"] = self.source
|
|
894
|
-
if self.tags:
|
|
895
|
-
body["tags"] = self.tags
|
|
896
|
-
return body
|
|
897
|
-
|
|
898
|
-
@classmethod
|
|
899
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateModelVersionRequest:
|
|
900
|
-
"""Deserializes the CreateModelVersionRequest from a dictionary."""
|
|
901
|
-
return cls(
|
|
902
|
-
description=d.get("description", None),
|
|
903
|
-
name=d.get("name", None),
|
|
904
|
-
run_id=d.get("run_id", None),
|
|
905
|
-
run_link=d.get("run_link", None),
|
|
906
|
-
source=d.get("source", None),
|
|
907
|
-
tags=_repeated_dict(d, "tags", ModelVersionTag),
|
|
908
|
-
)
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
@dataclass
|
|
912
|
-
class CreateModelVersionResponse:
|
|
913
|
-
model_version: Optional[ModelVersion] = None
|
|
914
|
-
"""Return new version number generated for this model in registry."""
|
|
915
|
-
|
|
916
|
-
def as_dict(self) -> dict:
|
|
917
|
-
"""Serializes the CreateModelVersionResponse into a dictionary suitable for use as a JSON request body."""
|
|
422
|
+
"""Serializes the CreateModelVersionResponse into a dictionary suitable for use as a JSON request body."""
|
|
918
423
|
body = {}
|
|
919
424
|
if self.model_version:
|
|
920
425
|
body["model_version"] = self.model_version.as_dict()
|
|
@@ -933,165 +438,6 @@ class CreateModelVersionResponse:
|
|
|
933
438
|
return cls(model_version=_from_dict(d, "model_version", ModelVersion))
|
|
934
439
|
|
|
935
440
|
|
|
936
|
-
@dataclass
|
|
937
|
-
class CreateRegistryWebhook:
|
|
938
|
-
events: List[RegistryWebhookEvent]
|
|
939
|
-
"""Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A new model version was
|
|
940
|
-
created for the associated model.
|
|
941
|
-
|
|
942
|
-
* `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was changed.
|
|
943
|
-
|
|
944
|
-
* `TRANSITION_REQUEST_CREATED`: A user requested a model version’s stage be transitioned.
|
|
945
|
-
|
|
946
|
-
* `COMMENT_CREATED`: A user wrote a comment on a registered model.
|
|
947
|
-
|
|
948
|
-
* `REGISTERED_MODEL_CREATED`: A new registered model was created. This event type can only be
|
|
949
|
-
specified for a registry-wide webhook, which can be created by not specifying a model name in
|
|
950
|
-
the create request.
|
|
951
|
-
|
|
952
|
-
* `MODEL_VERSION_TAG_SET`: A user set a tag on the model version.
|
|
953
|
-
|
|
954
|
-
* `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was transitioned to staging.
|
|
955
|
-
|
|
956
|
-
* `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was transitioned to production.
|
|
957
|
-
|
|
958
|
-
* `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived.
|
|
959
|
-
|
|
960
|
-
* `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model version be transitioned to
|
|
961
|
-
staging.
|
|
962
|
-
|
|
963
|
-
* `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model version be transitioned
|
|
964
|
-
to production.
|
|
965
|
-
|
|
966
|
-
* `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model version be archived."""
|
|
967
|
-
|
|
968
|
-
description: Optional[str] = None
|
|
969
|
-
"""User-specified description for the webhook."""
|
|
970
|
-
|
|
971
|
-
http_url_spec: Optional[HttpUrlSpec] = None
|
|
972
|
-
|
|
973
|
-
job_spec: Optional[JobSpec] = None
|
|
974
|
-
|
|
975
|
-
model_name: Optional[str] = None
|
|
976
|
-
"""If model name is not specified, a registry-wide webhook is created that listens for the
|
|
977
|
-
specified events across all versions of all registered models."""
|
|
978
|
-
|
|
979
|
-
status: Optional[RegistryWebhookStatus] = None
|
|
980
|
-
"""Enable or disable triggering the webhook, or put the webhook into test mode. The default is
|
|
981
|
-
`ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.
|
|
982
|
-
|
|
983
|
-
* `DISABLED`: Webhook is not triggered.
|
|
984
|
-
|
|
985
|
-
* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a
|
|
986
|
-
real event."""
|
|
987
|
-
|
|
988
|
-
def as_dict(self) -> dict:
|
|
989
|
-
"""Serializes the CreateRegistryWebhook into a dictionary suitable for use as a JSON request body."""
|
|
990
|
-
body = {}
|
|
991
|
-
if self.description is not None:
|
|
992
|
-
body["description"] = self.description
|
|
993
|
-
if self.events:
|
|
994
|
-
body["events"] = [v.value for v in self.events]
|
|
995
|
-
if self.http_url_spec:
|
|
996
|
-
body["http_url_spec"] = self.http_url_spec.as_dict()
|
|
997
|
-
if self.job_spec:
|
|
998
|
-
body["job_spec"] = self.job_spec.as_dict()
|
|
999
|
-
if self.model_name is not None:
|
|
1000
|
-
body["model_name"] = self.model_name
|
|
1001
|
-
if self.status is not None:
|
|
1002
|
-
body["status"] = self.status.value
|
|
1003
|
-
return body
|
|
1004
|
-
|
|
1005
|
-
def as_shallow_dict(self) -> dict:
|
|
1006
|
-
"""Serializes the CreateRegistryWebhook into a shallow dictionary of its immediate attributes."""
|
|
1007
|
-
body = {}
|
|
1008
|
-
if self.description is not None:
|
|
1009
|
-
body["description"] = self.description
|
|
1010
|
-
if self.events:
|
|
1011
|
-
body["events"] = self.events
|
|
1012
|
-
if self.http_url_spec:
|
|
1013
|
-
body["http_url_spec"] = self.http_url_spec
|
|
1014
|
-
if self.job_spec:
|
|
1015
|
-
body["job_spec"] = self.job_spec
|
|
1016
|
-
if self.model_name is not None:
|
|
1017
|
-
body["model_name"] = self.model_name
|
|
1018
|
-
if self.status is not None:
|
|
1019
|
-
body["status"] = self.status
|
|
1020
|
-
return body
|
|
1021
|
-
|
|
1022
|
-
@classmethod
|
|
1023
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateRegistryWebhook:
|
|
1024
|
-
"""Deserializes the CreateRegistryWebhook from a dictionary."""
|
|
1025
|
-
return cls(
|
|
1026
|
-
description=d.get("description", None),
|
|
1027
|
-
events=_repeated_enum(d, "events", RegistryWebhookEvent),
|
|
1028
|
-
http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpec),
|
|
1029
|
-
job_spec=_from_dict(d, "job_spec", JobSpec),
|
|
1030
|
-
model_name=d.get("model_name", None),
|
|
1031
|
-
status=_enum(d, "status", RegistryWebhookStatus),
|
|
1032
|
-
)
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
@dataclass
|
|
1036
|
-
class CreateRun:
|
|
1037
|
-
experiment_id: Optional[str] = None
|
|
1038
|
-
"""ID of the associated experiment."""
|
|
1039
|
-
|
|
1040
|
-
run_name: Optional[str] = None
|
|
1041
|
-
"""The name of the run."""
|
|
1042
|
-
|
|
1043
|
-
start_time: Optional[int] = None
|
|
1044
|
-
"""Unix timestamp in milliseconds of when the run started."""
|
|
1045
|
-
|
|
1046
|
-
tags: Optional[List[RunTag]] = None
|
|
1047
|
-
"""Additional metadata for run."""
|
|
1048
|
-
|
|
1049
|
-
user_id: Optional[str] = None
|
|
1050
|
-
"""ID of the user executing the run. This field is deprecated as of MLflow 1.0, and will be removed
|
|
1051
|
-
in a future MLflow release. Use 'mlflow.user' tag instead."""
|
|
1052
|
-
|
|
1053
|
-
def as_dict(self) -> dict:
|
|
1054
|
-
"""Serializes the CreateRun into a dictionary suitable for use as a JSON request body."""
|
|
1055
|
-
body = {}
|
|
1056
|
-
if self.experiment_id is not None:
|
|
1057
|
-
body["experiment_id"] = self.experiment_id
|
|
1058
|
-
if self.run_name is not None:
|
|
1059
|
-
body["run_name"] = self.run_name
|
|
1060
|
-
if self.start_time is not None:
|
|
1061
|
-
body["start_time"] = self.start_time
|
|
1062
|
-
if self.tags:
|
|
1063
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
1064
|
-
if self.user_id is not None:
|
|
1065
|
-
body["user_id"] = self.user_id
|
|
1066
|
-
return body
|
|
1067
|
-
|
|
1068
|
-
def as_shallow_dict(self) -> dict:
|
|
1069
|
-
"""Serializes the CreateRun into a shallow dictionary of its immediate attributes."""
|
|
1070
|
-
body = {}
|
|
1071
|
-
if self.experiment_id is not None:
|
|
1072
|
-
body["experiment_id"] = self.experiment_id
|
|
1073
|
-
if self.run_name is not None:
|
|
1074
|
-
body["run_name"] = self.run_name
|
|
1075
|
-
if self.start_time is not None:
|
|
1076
|
-
body["start_time"] = self.start_time
|
|
1077
|
-
if self.tags:
|
|
1078
|
-
body["tags"] = self.tags
|
|
1079
|
-
if self.user_id is not None:
|
|
1080
|
-
body["user_id"] = self.user_id
|
|
1081
|
-
return body
|
|
1082
|
-
|
|
1083
|
-
@classmethod
|
|
1084
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateRun:
|
|
1085
|
-
"""Deserializes the CreateRun from a dictionary."""
|
|
1086
|
-
return cls(
|
|
1087
|
-
experiment_id=d.get("experiment_id", None),
|
|
1088
|
-
run_name=d.get("run_name", None),
|
|
1089
|
-
start_time=d.get("start_time", None),
|
|
1090
|
-
tags=_repeated_dict(d, "tags", RunTag),
|
|
1091
|
-
user_id=d.get("user_id", None),
|
|
1092
|
-
)
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
441
|
@dataclass
|
|
1096
442
|
class CreateRunResponse:
|
|
1097
443
|
run: Optional[Run] = None
|
|
@@ -1117,69 +463,10 @@ class CreateRunResponse:
|
|
|
1117
463
|
return cls(run=_from_dict(d, "run", Run))
|
|
1118
464
|
|
|
1119
465
|
|
|
1120
|
-
@dataclass
|
|
1121
|
-
class CreateTransitionRequest:
|
|
1122
|
-
name: str
|
|
1123
|
-
"""Name of the model."""
|
|
1124
|
-
|
|
1125
|
-
version: str
|
|
1126
|
-
"""Version of the model."""
|
|
1127
|
-
|
|
1128
|
-
stage: Stage
|
|
1129
|
-
"""Target stage of the transition. Valid values are:
|
|
1130
|
-
|
|
1131
|
-
* `None`: The initial stage of a model version.
|
|
1132
|
-
|
|
1133
|
-
* `Staging`: Staging or pre-production stage.
|
|
1134
|
-
|
|
1135
|
-
* `Production`: Production stage.
|
|
1136
|
-
|
|
1137
|
-
* `Archived`: Archived stage."""
|
|
1138
|
-
|
|
1139
|
-
comment: Optional[str] = None
|
|
1140
|
-
"""User-provided comment on the action."""
|
|
1141
|
-
|
|
1142
|
-
def as_dict(self) -> dict:
|
|
1143
|
-
"""Serializes the CreateTransitionRequest into a dictionary suitable for use as a JSON request body."""
|
|
1144
|
-
body = {}
|
|
1145
|
-
if self.comment is not None:
|
|
1146
|
-
body["comment"] = self.comment
|
|
1147
|
-
if self.name is not None:
|
|
1148
|
-
body["name"] = self.name
|
|
1149
|
-
if self.stage is not None:
|
|
1150
|
-
body["stage"] = self.stage.value
|
|
1151
|
-
if self.version is not None:
|
|
1152
|
-
body["version"] = self.version
|
|
1153
|
-
return body
|
|
1154
|
-
|
|
1155
|
-
def as_shallow_dict(self) -> dict:
|
|
1156
|
-
"""Serializes the CreateTransitionRequest into a shallow dictionary of its immediate attributes."""
|
|
1157
|
-
body = {}
|
|
1158
|
-
if self.comment is not None:
|
|
1159
|
-
body["comment"] = self.comment
|
|
1160
|
-
if self.name is not None:
|
|
1161
|
-
body["name"] = self.name
|
|
1162
|
-
if self.stage is not None:
|
|
1163
|
-
body["stage"] = self.stage
|
|
1164
|
-
if self.version is not None:
|
|
1165
|
-
body["version"] = self.version
|
|
1166
|
-
return body
|
|
1167
|
-
|
|
1168
|
-
@classmethod
|
|
1169
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateTransitionRequest:
|
|
1170
|
-
"""Deserializes the CreateTransitionRequest from a dictionary."""
|
|
1171
|
-
return cls(
|
|
1172
|
-
comment=d.get("comment", None),
|
|
1173
|
-
name=d.get("name", None),
|
|
1174
|
-
stage=_enum(d, "stage", Stage),
|
|
1175
|
-
version=d.get("version", None),
|
|
1176
|
-
)
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
466
|
@dataclass
|
|
1180
467
|
class CreateTransitionRequestResponse:
|
|
1181
468
|
request: Optional[TransitionRequest] = None
|
|
1182
|
-
"""
|
|
469
|
+
"""New activity generated for stage transition request."""
|
|
1183
470
|
|
|
1184
471
|
def as_dict(self) -> dict:
|
|
1185
472
|
"""Serializes the CreateTransitionRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -1351,31 +638,6 @@ class DeleteCommentResponse:
|
|
|
1351
638
|
return cls()
|
|
1352
639
|
|
|
1353
640
|
|
|
1354
|
-
@dataclass
|
|
1355
|
-
class DeleteExperiment:
|
|
1356
|
-
experiment_id: str
|
|
1357
|
-
"""ID of the associated experiment."""
|
|
1358
|
-
|
|
1359
|
-
def as_dict(self) -> dict:
|
|
1360
|
-
"""Serializes the DeleteExperiment into a dictionary suitable for use as a JSON request body."""
|
|
1361
|
-
body = {}
|
|
1362
|
-
if self.experiment_id is not None:
|
|
1363
|
-
body["experiment_id"] = self.experiment_id
|
|
1364
|
-
return body
|
|
1365
|
-
|
|
1366
|
-
def as_shallow_dict(self) -> dict:
|
|
1367
|
-
"""Serializes the DeleteExperiment into a shallow dictionary of its immediate attributes."""
|
|
1368
|
-
body = {}
|
|
1369
|
-
if self.experiment_id is not None:
|
|
1370
|
-
body["experiment_id"] = self.experiment_id
|
|
1371
|
-
return body
|
|
1372
|
-
|
|
1373
|
-
@classmethod
|
|
1374
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteExperiment:
|
|
1375
|
-
"""Deserializes the DeleteExperiment from a dictionary."""
|
|
1376
|
-
return cls(experiment_id=d.get("experiment_id", None))
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
641
|
@dataclass
|
|
1380
642
|
class DeleteExperimentResponse:
|
|
1381
643
|
def as_dict(self) -> dict:
|
|
@@ -1503,125 +765,37 @@ class DeleteModelVersionTagResponse:
|
|
|
1503
765
|
|
|
1504
766
|
|
|
1505
767
|
@dataclass
|
|
1506
|
-
class
|
|
768
|
+
class DeleteRunResponse:
|
|
1507
769
|
def as_dict(self) -> dict:
|
|
1508
|
-
"""Serializes the
|
|
770
|
+
"""Serializes the DeleteRunResponse into a dictionary suitable for use as a JSON request body."""
|
|
1509
771
|
body = {}
|
|
1510
772
|
return body
|
|
1511
773
|
|
|
1512
774
|
def as_shallow_dict(self) -> dict:
|
|
1513
|
-
"""Serializes the
|
|
775
|
+
"""Serializes the DeleteRunResponse into a shallow dictionary of its immediate attributes."""
|
|
1514
776
|
body = {}
|
|
1515
777
|
return body
|
|
1516
778
|
|
|
1517
779
|
@classmethod
|
|
1518
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
1519
|
-
"""Deserializes the
|
|
780
|
+
def from_dict(cls, d: Dict[str, Any]) -> DeleteRunResponse:
|
|
781
|
+
"""Deserializes the DeleteRunResponse from a dictionary."""
|
|
1520
782
|
return cls()
|
|
1521
783
|
|
|
1522
784
|
|
|
1523
785
|
@dataclass
|
|
1524
|
-
class
|
|
1525
|
-
|
|
1526
|
-
"""
|
|
786
|
+
class DeleteRunsResponse:
|
|
787
|
+
runs_deleted: Optional[int] = None
|
|
788
|
+
"""The number of runs deleted."""
|
|
1527
789
|
|
|
1528
790
|
def as_dict(self) -> dict:
|
|
1529
|
-
"""Serializes the
|
|
791
|
+
"""Serializes the DeleteRunsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1530
792
|
body = {}
|
|
1531
|
-
if self.
|
|
1532
|
-
body["
|
|
793
|
+
if self.runs_deleted is not None:
|
|
794
|
+
body["runs_deleted"] = self.runs_deleted
|
|
1533
795
|
return body
|
|
1534
796
|
|
|
1535
797
|
def as_shallow_dict(self) -> dict:
|
|
1536
|
-
"""Serializes the
|
|
1537
|
-
body = {}
|
|
1538
|
-
if self.run_id is not None:
|
|
1539
|
-
body["run_id"] = self.run_id
|
|
1540
|
-
return body
|
|
1541
|
-
|
|
1542
|
-
@classmethod
|
|
1543
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteRun:
|
|
1544
|
-
"""Deserializes the DeleteRun from a dictionary."""
|
|
1545
|
-
return cls(run_id=d.get("run_id", None))
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
@dataclass
|
|
1549
|
-
class DeleteRunResponse:
|
|
1550
|
-
def as_dict(self) -> dict:
|
|
1551
|
-
"""Serializes the DeleteRunResponse into a dictionary suitable for use as a JSON request body."""
|
|
1552
|
-
body = {}
|
|
1553
|
-
return body
|
|
1554
|
-
|
|
1555
|
-
def as_shallow_dict(self) -> dict:
|
|
1556
|
-
"""Serializes the DeleteRunResponse into a shallow dictionary of its immediate attributes."""
|
|
1557
|
-
body = {}
|
|
1558
|
-
return body
|
|
1559
|
-
|
|
1560
|
-
@classmethod
|
|
1561
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteRunResponse:
|
|
1562
|
-
"""Deserializes the DeleteRunResponse from a dictionary."""
|
|
1563
|
-
return cls()
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
@dataclass
|
|
1567
|
-
class DeleteRuns:
|
|
1568
|
-
experiment_id: str
|
|
1569
|
-
"""The ID of the experiment containing the runs to delete."""
|
|
1570
|
-
|
|
1571
|
-
max_timestamp_millis: int
|
|
1572
|
-
"""The maximum creation timestamp in milliseconds since the UNIX epoch for deleting runs. Only runs
|
|
1573
|
-
created prior to or at this timestamp are deleted."""
|
|
1574
|
-
|
|
1575
|
-
max_runs: Optional[int] = None
|
|
1576
|
-
"""An optional positive integer indicating the maximum number of runs to delete. The maximum
|
|
1577
|
-
allowed value for max_runs is 10000."""
|
|
1578
|
-
|
|
1579
|
-
def as_dict(self) -> dict:
|
|
1580
|
-
"""Serializes the DeleteRuns into a dictionary suitable for use as a JSON request body."""
|
|
1581
|
-
body = {}
|
|
1582
|
-
if self.experiment_id is not None:
|
|
1583
|
-
body["experiment_id"] = self.experiment_id
|
|
1584
|
-
if self.max_runs is not None:
|
|
1585
|
-
body["max_runs"] = self.max_runs
|
|
1586
|
-
if self.max_timestamp_millis is not None:
|
|
1587
|
-
body["max_timestamp_millis"] = self.max_timestamp_millis
|
|
1588
|
-
return body
|
|
1589
|
-
|
|
1590
|
-
def as_shallow_dict(self) -> dict:
|
|
1591
|
-
"""Serializes the DeleteRuns into a shallow dictionary of its immediate attributes."""
|
|
1592
|
-
body = {}
|
|
1593
|
-
if self.experiment_id is not None:
|
|
1594
|
-
body["experiment_id"] = self.experiment_id
|
|
1595
|
-
if self.max_runs is not None:
|
|
1596
|
-
body["max_runs"] = self.max_runs
|
|
1597
|
-
if self.max_timestamp_millis is not None:
|
|
1598
|
-
body["max_timestamp_millis"] = self.max_timestamp_millis
|
|
1599
|
-
return body
|
|
1600
|
-
|
|
1601
|
-
@classmethod
|
|
1602
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteRuns:
|
|
1603
|
-
"""Deserializes the DeleteRuns from a dictionary."""
|
|
1604
|
-
return cls(
|
|
1605
|
-
experiment_id=d.get("experiment_id", None),
|
|
1606
|
-
max_runs=d.get("max_runs", None),
|
|
1607
|
-
max_timestamp_millis=d.get("max_timestamp_millis", None),
|
|
1608
|
-
)
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
@dataclass
|
|
1612
|
-
class DeleteRunsResponse:
|
|
1613
|
-
runs_deleted: Optional[int] = None
|
|
1614
|
-
"""The number of runs deleted."""
|
|
1615
|
-
|
|
1616
|
-
def as_dict(self) -> dict:
|
|
1617
|
-
"""Serializes the DeleteRunsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1618
|
-
body = {}
|
|
1619
|
-
if self.runs_deleted is not None:
|
|
1620
|
-
body["runs_deleted"] = self.runs_deleted
|
|
1621
|
-
return body
|
|
1622
|
-
|
|
1623
|
-
def as_shallow_dict(self) -> dict:
|
|
1624
|
-
"""Serializes the DeleteRunsResponse into a shallow dictionary of its immediate attributes."""
|
|
798
|
+
"""Serializes the DeleteRunsResponse into a shallow dictionary of its immediate attributes."""
|
|
1625
799
|
body = {}
|
|
1626
800
|
if self.runs_deleted is not None:
|
|
1627
801
|
body["runs_deleted"] = self.runs_deleted
|
|
@@ -1633,38 +807,6 @@ class DeleteRunsResponse:
|
|
|
1633
807
|
return cls(runs_deleted=d.get("runs_deleted", None))
|
|
1634
808
|
|
|
1635
809
|
|
|
1636
|
-
@dataclass
|
|
1637
|
-
class DeleteTag:
|
|
1638
|
-
run_id: str
|
|
1639
|
-
"""ID of the run that the tag was logged under. Must be provided."""
|
|
1640
|
-
|
|
1641
|
-
key: str
|
|
1642
|
-
"""Name of the tag. Maximum size is 255 bytes. Must be provided."""
|
|
1643
|
-
|
|
1644
|
-
def as_dict(self) -> dict:
|
|
1645
|
-
"""Serializes the DeleteTag into a dictionary suitable for use as a JSON request body."""
|
|
1646
|
-
body = {}
|
|
1647
|
-
if self.key is not None:
|
|
1648
|
-
body["key"] = self.key
|
|
1649
|
-
if self.run_id is not None:
|
|
1650
|
-
body["run_id"] = self.run_id
|
|
1651
|
-
return body
|
|
1652
|
-
|
|
1653
|
-
def as_shallow_dict(self) -> dict:
|
|
1654
|
-
"""Serializes the DeleteTag into a shallow dictionary of its immediate attributes."""
|
|
1655
|
-
body = {}
|
|
1656
|
-
if self.key is not None:
|
|
1657
|
-
body["key"] = self.key
|
|
1658
|
-
if self.run_id is not None:
|
|
1659
|
-
body["run_id"] = self.run_id
|
|
1660
|
-
return body
|
|
1661
|
-
|
|
1662
|
-
@classmethod
|
|
1663
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteTag:
|
|
1664
|
-
"""Deserializes the DeleteTag from a dictionary."""
|
|
1665
|
-
return cls(key=d.get("key", None), run_id=d.get("run_id", None))
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
810
|
@dataclass
|
|
1669
811
|
class DeleteTagResponse:
|
|
1670
812
|
def as_dict(self) -> dict:
|
|
@@ -1685,28 +827,27 @@ class DeleteTagResponse:
|
|
|
1685
827
|
|
|
1686
828
|
@dataclass
|
|
1687
829
|
class DeleteTransitionRequestResponse:
|
|
830
|
+
activity: Optional[Activity] = None
|
|
831
|
+
"""New activity generated as a result of this operation."""
|
|
832
|
+
|
|
1688
833
|
def as_dict(self) -> dict:
|
|
1689
834
|
"""Serializes the DeleteTransitionRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
1690
835
|
body = {}
|
|
836
|
+
if self.activity:
|
|
837
|
+
body["activity"] = self.activity.as_dict()
|
|
1691
838
|
return body
|
|
1692
839
|
|
|
1693
840
|
def as_shallow_dict(self) -> dict:
|
|
1694
841
|
"""Serializes the DeleteTransitionRequestResponse into a shallow dictionary of its immediate attributes."""
|
|
1695
842
|
body = {}
|
|
843
|
+
if self.activity:
|
|
844
|
+
body["activity"] = self.activity
|
|
1696
845
|
return body
|
|
1697
846
|
|
|
1698
847
|
@classmethod
|
|
1699
848
|
def from_dict(cls, d: Dict[str, Any]) -> DeleteTransitionRequestResponse:
|
|
1700
849
|
"""Deserializes the DeleteTransitionRequestResponse from a dictionary."""
|
|
1701
|
-
return cls()
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
class DeleteTransitionRequestStage(Enum):
|
|
1705
|
-
|
|
1706
|
-
ARCHIVED = "Archived"
|
|
1707
|
-
NONE = "None"
|
|
1708
|
-
PRODUCTION = "Production"
|
|
1709
|
-
STAGING = "Staging"
|
|
850
|
+
return cls(activity=_from_dict(d, "activity", Activity))
|
|
1710
851
|
|
|
1711
852
|
|
|
1712
853
|
@dataclass
|
|
@@ -1811,7 +952,6 @@ class ExperimentAccessControlRequest:
|
|
|
1811
952
|
"""name of the group"""
|
|
1812
953
|
|
|
1813
954
|
permission_level: Optional[ExperimentPermissionLevel] = None
|
|
1814
|
-
"""Permission level"""
|
|
1815
955
|
|
|
1816
956
|
service_principal_name: Optional[str] = None
|
|
1817
957
|
"""application ID of a service principal"""
|
|
@@ -1922,7 +1062,6 @@ class ExperimentPermission:
|
|
|
1922
1062
|
inherited_from_object: Optional[List[str]] = None
|
|
1923
1063
|
|
|
1924
1064
|
permission_level: Optional[ExperimentPermissionLevel] = None
|
|
1925
|
-
"""Permission level"""
|
|
1926
1065
|
|
|
1927
1066
|
def as_dict(self) -> dict:
|
|
1928
1067
|
"""Serializes the ExperimentPermission into a dictionary suitable for use as a JSON request body."""
|
|
@@ -2009,7 +1148,6 @@ class ExperimentPermissionsDescription:
|
|
|
2009
1148
|
description: Optional[str] = None
|
|
2010
1149
|
|
|
2011
1150
|
permission_level: Optional[ExperimentPermissionLevel] = None
|
|
2012
|
-
"""Permission level"""
|
|
2013
1151
|
|
|
2014
1152
|
def as_dict(self) -> dict:
|
|
2015
1153
|
"""Serializes the ExperimentPermissionsDescription into a dictionary suitable for use as a JSON request body."""
|
|
@@ -2038,40 +1176,6 @@ class ExperimentPermissionsDescription:
|
|
|
2038
1176
|
)
|
|
2039
1177
|
|
|
2040
1178
|
|
|
2041
|
-
@dataclass
|
|
2042
|
-
class ExperimentPermissionsRequest:
|
|
2043
|
-
access_control_list: Optional[List[ExperimentAccessControlRequest]] = None
|
|
2044
|
-
|
|
2045
|
-
experiment_id: Optional[str] = None
|
|
2046
|
-
"""The experiment for which to get or manage permissions."""
|
|
2047
|
-
|
|
2048
|
-
def as_dict(self) -> dict:
|
|
2049
|
-
"""Serializes the ExperimentPermissionsRequest into a dictionary suitable for use as a JSON request body."""
|
|
2050
|
-
body = {}
|
|
2051
|
-
if self.access_control_list:
|
|
2052
|
-
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
2053
|
-
if self.experiment_id is not None:
|
|
2054
|
-
body["experiment_id"] = self.experiment_id
|
|
2055
|
-
return body
|
|
2056
|
-
|
|
2057
|
-
def as_shallow_dict(self) -> dict:
|
|
2058
|
-
"""Serializes the ExperimentPermissionsRequest into a shallow dictionary of its immediate attributes."""
|
|
2059
|
-
body = {}
|
|
2060
|
-
if self.access_control_list:
|
|
2061
|
-
body["access_control_list"] = self.access_control_list
|
|
2062
|
-
if self.experiment_id is not None:
|
|
2063
|
-
body["experiment_id"] = self.experiment_id
|
|
2064
|
-
return body
|
|
2065
|
-
|
|
2066
|
-
@classmethod
|
|
2067
|
-
def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissionsRequest:
|
|
2068
|
-
"""Deserializes the ExperimentPermissionsRequest from a dictionary."""
|
|
2069
|
-
return cls(
|
|
2070
|
-
access_control_list=_repeated_dict(d, "access_control_list", ExperimentAccessControlRequest),
|
|
2071
|
-
experiment_id=d.get("experiment_id", None),
|
|
2072
|
-
)
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
1179
|
@dataclass
|
|
2076
1180
|
class ExperimentTag:
|
|
2077
1181
|
"""A tag for an experiment."""
|
|
@@ -2107,263 +1211,433 @@ class ExperimentTag:
|
|
|
2107
1211
|
|
|
2108
1212
|
|
|
2109
1213
|
@dataclass
|
|
2110
|
-
class
|
|
2111
|
-
"""
|
|
1214
|
+
class Feature:
|
|
1215
|
+
"""Feature for model version."""
|
|
2112
1216
|
|
|
2113
|
-
|
|
2114
|
-
"""
|
|
1217
|
+
feature_name: Optional[str] = None
|
|
1218
|
+
"""Feature name"""
|
|
2115
1219
|
|
|
2116
|
-
|
|
2117
|
-
"""
|
|
1220
|
+
feature_table_id: Optional[str] = None
|
|
1221
|
+
"""Feature table id"""
|
|
2118
1222
|
|
|
2119
|
-
|
|
2120
|
-
"""
|
|
1223
|
+
feature_table_name: Optional[str] = None
|
|
1224
|
+
"""Feature table name"""
|
|
2121
1225
|
|
|
2122
1226
|
def as_dict(self) -> dict:
|
|
2123
|
-
"""Serializes the
|
|
1227
|
+
"""Serializes the Feature into a dictionary suitable for use as a JSON request body."""
|
|
2124
1228
|
body = {}
|
|
2125
|
-
if self.
|
|
2126
|
-
body["
|
|
2127
|
-
if self.
|
|
2128
|
-
body["
|
|
2129
|
-
if self.
|
|
2130
|
-
body["
|
|
1229
|
+
if self.feature_name is not None:
|
|
1230
|
+
body["feature_name"] = self.feature_name
|
|
1231
|
+
if self.feature_table_id is not None:
|
|
1232
|
+
body["feature_table_id"] = self.feature_table_id
|
|
1233
|
+
if self.feature_table_name is not None:
|
|
1234
|
+
body["feature_table_name"] = self.feature_table_name
|
|
2131
1235
|
return body
|
|
2132
1236
|
|
|
2133
1237
|
def as_shallow_dict(self) -> dict:
|
|
2134
|
-
"""Serializes the
|
|
1238
|
+
"""Serializes the Feature into a shallow dictionary of its immediate attributes."""
|
|
2135
1239
|
body = {}
|
|
2136
|
-
if self.
|
|
2137
|
-
body["
|
|
2138
|
-
if self.
|
|
2139
|
-
body["
|
|
2140
|
-
if self.
|
|
2141
|
-
body["
|
|
1240
|
+
if self.feature_name is not None:
|
|
1241
|
+
body["feature_name"] = self.feature_name
|
|
1242
|
+
if self.feature_table_id is not None:
|
|
1243
|
+
body["feature_table_id"] = self.feature_table_id
|
|
1244
|
+
if self.feature_table_name is not None:
|
|
1245
|
+
body["feature_table_name"] = self.feature_table_name
|
|
2142
1246
|
return body
|
|
2143
1247
|
|
|
2144
1248
|
@classmethod
|
|
2145
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2146
|
-
"""Deserializes the
|
|
2147
|
-
return cls(
|
|
1249
|
+
def from_dict(cls, d: Dict[str, Any]) -> Feature:
|
|
1250
|
+
"""Deserializes the Feature from a dictionary."""
|
|
1251
|
+
return cls(
|
|
1252
|
+
feature_name=d.get("feature_name", None),
|
|
1253
|
+
feature_table_id=d.get("feature_table_id", None),
|
|
1254
|
+
feature_table_name=d.get("feature_table_name", None),
|
|
1255
|
+
)
|
|
2148
1256
|
|
|
2149
1257
|
|
|
2150
1258
|
@dataclass
|
|
2151
|
-
class
|
|
2152
|
-
|
|
2153
|
-
"""
|
|
2154
|
-
something went wrong when logging the model weights / agent code."""
|
|
1259
|
+
class FeatureLineage:
|
|
1260
|
+
feature_specs: Optional[List[FeatureLineageFeatureSpec]] = None
|
|
1261
|
+
"""List of feature specs that contain this feature."""
|
|
2155
1262
|
|
|
2156
|
-
|
|
2157
|
-
"""
|
|
1263
|
+
models: Optional[List[FeatureLineageModel]] = None
|
|
1264
|
+
"""List of Unity Catalog models that were trained on this feature."""
|
|
1265
|
+
|
|
1266
|
+
online_features: Optional[List[FeatureLineageOnlineFeature]] = None
|
|
1267
|
+
"""List of online features that use this feature as source."""
|
|
2158
1268
|
|
|
2159
1269
|
def as_dict(self) -> dict:
|
|
2160
|
-
"""Serializes the
|
|
1270
|
+
"""Serializes the FeatureLineage into a dictionary suitable for use as a JSON request body."""
|
|
2161
1271
|
body = {}
|
|
2162
|
-
if self.
|
|
2163
|
-
body["
|
|
2164
|
-
if self.
|
|
2165
|
-
body["
|
|
1272
|
+
if self.feature_specs:
|
|
1273
|
+
body["feature_specs"] = [v.as_dict() for v in self.feature_specs]
|
|
1274
|
+
if self.models:
|
|
1275
|
+
body["models"] = [v.as_dict() for v in self.models]
|
|
1276
|
+
if self.online_features:
|
|
1277
|
+
body["online_features"] = [v.as_dict() for v in self.online_features]
|
|
2166
1278
|
return body
|
|
2167
1279
|
|
|
2168
1280
|
def as_shallow_dict(self) -> dict:
|
|
2169
|
-
"""Serializes the
|
|
1281
|
+
"""Serializes the FeatureLineage into a shallow dictionary of its immediate attributes."""
|
|
2170
1282
|
body = {}
|
|
2171
|
-
if self.
|
|
2172
|
-
body["
|
|
2173
|
-
if self.
|
|
2174
|
-
body["
|
|
1283
|
+
if self.feature_specs:
|
|
1284
|
+
body["feature_specs"] = self.feature_specs
|
|
1285
|
+
if self.models:
|
|
1286
|
+
body["models"] = self.models
|
|
1287
|
+
if self.online_features:
|
|
1288
|
+
body["online_features"] = self.online_features
|
|
2175
1289
|
return body
|
|
2176
1290
|
|
|
2177
1291
|
@classmethod
|
|
2178
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2179
|
-
"""Deserializes the
|
|
2180
|
-
return cls(
|
|
1292
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureLineage:
|
|
1293
|
+
"""Deserializes the FeatureLineage from a dictionary."""
|
|
1294
|
+
return cls(
|
|
1295
|
+
feature_specs=_repeated_dict(d, "feature_specs", FeatureLineageFeatureSpec),
|
|
1296
|
+
models=_repeated_dict(d, "models", FeatureLineageModel),
|
|
1297
|
+
online_features=_repeated_dict(d, "online_features", FeatureLineageOnlineFeature),
|
|
1298
|
+
)
|
|
2181
1299
|
|
|
2182
1300
|
|
|
2183
1301
|
@dataclass
|
|
2184
|
-
class
|
|
2185
|
-
|
|
2186
|
-
"""The
|
|
1302
|
+
class FeatureLineageFeatureSpec:
|
|
1303
|
+
name: Optional[str] = None
|
|
1304
|
+
"""The full name of the feature spec in Unity Catalog."""
|
|
2187
1305
|
|
|
2188
1306
|
def as_dict(self) -> dict:
|
|
2189
|
-
"""Serializes the
|
|
1307
|
+
"""Serializes the FeatureLineageFeatureSpec into a dictionary suitable for use as a JSON request body."""
|
|
2190
1308
|
body = {}
|
|
2191
|
-
if self.
|
|
2192
|
-
body["
|
|
1309
|
+
if self.name is not None:
|
|
1310
|
+
body["name"] = self.name
|
|
2193
1311
|
return body
|
|
2194
1312
|
|
|
2195
1313
|
def as_shallow_dict(self) -> dict:
|
|
2196
|
-
"""Serializes the
|
|
1314
|
+
"""Serializes the FeatureLineageFeatureSpec into a shallow dictionary of its immediate attributes."""
|
|
2197
1315
|
body = {}
|
|
2198
|
-
if self.
|
|
2199
|
-
body["
|
|
1316
|
+
if self.name is not None:
|
|
1317
|
+
body["name"] = self.name
|
|
2200
1318
|
return body
|
|
2201
1319
|
|
|
2202
1320
|
@classmethod
|
|
2203
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2204
|
-
"""Deserializes the
|
|
2205
|
-
return cls(
|
|
1321
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureLineageFeatureSpec:
|
|
1322
|
+
"""Deserializes the FeatureLineageFeatureSpec from a dictionary."""
|
|
1323
|
+
return cls(name=d.get("name", None))
|
|
2206
1324
|
|
|
2207
1325
|
|
|
2208
1326
|
@dataclass
|
|
2209
|
-
class
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
experiment_id: Optional[str] = None
|
|
2213
|
-
"""The unique ID for the forecasting experiment."""
|
|
2214
|
-
|
|
2215
|
-
experiment_page_url: Optional[str] = None
|
|
2216
|
-
"""The URL to the forecasting experiment page."""
|
|
1327
|
+
class FeatureLineageModel:
|
|
1328
|
+
name: Optional[str] = None
|
|
1329
|
+
"""The full name of the model in Unity Catalog."""
|
|
2217
1330
|
|
|
2218
|
-
|
|
2219
|
-
"""The
|
|
1331
|
+
version: Optional[int] = None
|
|
1332
|
+
"""The version of the model."""
|
|
2220
1333
|
|
|
2221
1334
|
def as_dict(self) -> dict:
|
|
2222
|
-
"""Serializes the
|
|
1335
|
+
"""Serializes the FeatureLineageModel into a dictionary suitable for use as a JSON request body."""
|
|
2223
1336
|
body = {}
|
|
2224
|
-
if self.
|
|
2225
|
-
body["
|
|
2226
|
-
if self.
|
|
2227
|
-
body["
|
|
2228
|
-
if self.state is not None:
|
|
2229
|
-
body["state"] = self.state.value
|
|
1337
|
+
if self.name is not None:
|
|
1338
|
+
body["name"] = self.name
|
|
1339
|
+
if self.version is not None:
|
|
1340
|
+
body["version"] = self.version
|
|
2230
1341
|
return body
|
|
2231
1342
|
|
|
2232
1343
|
def as_shallow_dict(self) -> dict:
|
|
2233
|
-
"""Serializes the
|
|
1344
|
+
"""Serializes the FeatureLineageModel into a shallow dictionary of its immediate attributes."""
|
|
2234
1345
|
body = {}
|
|
2235
|
-
if self.
|
|
2236
|
-
body["
|
|
2237
|
-
if self.
|
|
2238
|
-
body["
|
|
2239
|
-
if self.state is not None:
|
|
2240
|
-
body["state"] = self.state
|
|
1346
|
+
if self.name is not None:
|
|
1347
|
+
body["name"] = self.name
|
|
1348
|
+
if self.version is not None:
|
|
1349
|
+
body["version"] = self.version
|
|
2241
1350
|
return body
|
|
2242
1351
|
|
|
2243
1352
|
@classmethod
|
|
2244
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2245
|
-
"""Deserializes the
|
|
2246
|
-
return cls(
|
|
2247
|
-
experiment_id=d.get("experiment_id", None),
|
|
2248
|
-
experiment_page_url=d.get("experiment_page_url", None),
|
|
2249
|
-
state=_enum(d, "state", ForecastingExperimentState),
|
|
2250
|
-
)
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
class ForecastingExperimentState(Enum):
|
|
2254
|
-
|
|
2255
|
-
CANCELLED = "CANCELLED"
|
|
2256
|
-
FAILED = "FAILED"
|
|
2257
|
-
PENDING = "PENDING"
|
|
2258
|
-
RUNNING = "RUNNING"
|
|
2259
|
-
SUCCEEDED = "SUCCEEDED"
|
|
1353
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureLineageModel:
|
|
1354
|
+
"""Deserializes the FeatureLineageModel from a dictionary."""
|
|
1355
|
+
return cls(name=d.get("name", None), version=d.get("version", None))
|
|
2260
1356
|
|
|
2261
1357
|
|
|
2262
1358
|
@dataclass
|
|
2263
|
-
class
|
|
2264
|
-
|
|
2265
|
-
"""
|
|
1359
|
+
class FeatureLineageOnlineFeature:
|
|
1360
|
+
feature_name: Optional[str] = None
|
|
1361
|
+
"""The name of the online feature (column name)."""
|
|
1362
|
+
|
|
1363
|
+
table_name: Optional[str] = None
|
|
1364
|
+
"""The full name of the online table in Unity Catalog."""
|
|
2266
1365
|
|
|
2267
1366
|
def as_dict(self) -> dict:
|
|
2268
|
-
"""Serializes the
|
|
1367
|
+
"""Serializes the FeatureLineageOnlineFeature into a dictionary suitable for use as a JSON request body."""
|
|
2269
1368
|
body = {}
|
|
2270
|
-
if self.
|
|
2271
|
-
body["
|
|
1369
|
+
if self.feature_name is not None:
|
|
1370
|
+
body["feature_name"] = self.feature_name
|
|
1371
|
+
if self.table_name is not None:
|
|
1372
|
+
body["table_name"] = self.table_name
|
|
2272
1373
|
return body
|
|
2273
1374
|
|
|
2274
1375
|
def as_shallow_dict(self) -> dict:
|
|
2275
|
-
"""Serializes the
|
|
1376
|
+
"""Serializes the FeatureLineageOnlineFeature into a shallow dictionary of its immediate attributes."""
|
|
2276
1377
|
body = {}
|
|
2277
|
-
if self.
|
|
2278
|
-
body["
|
|
1378
|
+
if self.feature_name is not None:
|
|
1379
|
+
body["feature_name"] = self.feature_name
|
|
1380
|
+
if self.table_name is not None:
|
|
1381
|
+
body["table_name"] = self.table_name
|
|
2279
1382
|
return body
|
|
2280
1383
|
|
|
2281
1384
|
@classmethod
|
|
2282
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2283
|
-
"""Deserializes the
|
|
2284
|
-
return cls(
|
|
1385
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureLineageOnlineFeature:
|
|
1386
|
+
"""Deserializes the FeatureLineageOnlineFeature from a dictionary."""
|
|
1387
|
+
return cls(feature_name=d.get("feature_name", None), table_name=d.get("table_name", None))
|
|
2285
1388
|
|
|
2286
1389
|
|
|
2287
1390
|
@dataclass
|
|
2288
|
-
class
|
|
2289
|
-
|
|
2290
|
-
|
|
1391
|
+
class FeatureList:
|
|
1392
|
+
"""Feature list wrap all the features for a model version"""
|
|
1393
|
+
|
|
1394
|
+
features: Optional[List[Feature]] = None
|
|
2291
1395
|
|
|
2292
1396
|
def as_dict(self) -> dict:
|
|
2293
|
-
"""Serializes the
|
|
1397
|
+
"""Serializes the FeatureList into a dictionary suitable for use as a JSON request body."""
|
|
2294
1398
|
body = {}
|
|
2295
|
-
if self.
|
|
2296
|
-
body["
|
|
1399
|
+
if self.features:
|
|
1400
|
+
body["features"] = [v.as_dict() for v in self.features]
|
|
2297
1401
|
return body
|
|
2298
1402
|
|
|
2299
1403
|
def as_shallow_dict(self) -> dict:
|
|
2300
|
-
"""Serializes the
|
|
1404
|
+
"""Serializes the FeatureList into a shallow dictionary of its immediate attributes."""
|
|
2301
1405
|
body = {}
|
|
2302
|
-
if self.
|
|
2303
|
-
body["
|
|
1406
|
+
if self.features:
|
|
1407
|
+
body["features"] = self.features
|
|
2304
1408
|
return body
|
|
2305
1409
|
|
|
2306
1410
|
@classmethod
|
|
2307
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2308
|
-
"""Deserializes the
|
|
2309
|
-
return cls(
|
|
1411
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureList:
|
|
1412
|
+
"""Deserializes the FeatureList from a dictionary."""
|
|
1413
|
+
return cls(features=_repeated_dict(d, "features", Feature))
|
|
2310
1414
|
|
|
2311
1415
|
|
|
2312
1416
|
@dataclass
|
|
2313
|
-
class
|
|
1417
|
+
class FeatureTag:
|
|
1418
|
+
"""Represents a tag on a feature in a feature table."""
|
|
1419
|
+
|
|
1420
|
+
key: str
|
|
1421
|
+
|
|
1422
|
+
value: Optional[str] = None
|
|
1423
|
+
|
|
1424
|
+
def as_dict(self) -> dict:
|
|
1425
|
+
"""Serializes the FeatureTag into a dictionary suitable for use as a JSON request body."""
|
|
1426
|
+
body = {}
|
|
1427
|
+
if self.key is not None:
|
|
1428
|
+
body["key"] = self.key
|
|
1429
|
+
if self.value is not None:
|
|
1430
|
+
body["value"] = self.value
|
|
1431
|
+
return body
|
|
1432
|
+
|
|
1433
|
+
def as_shallow_dict(self) -> dict:
|
|
1434
|
+
"""Serializes the FeatureTag into a shallow dictionary of its immediate attributes."""
|
|
1435
|
+
body = {}
|
|
1436
|
+
if self.key is not None:
|
|
1437
|
+
body["key"] = self.key
|
|
1438
|
+
if self.value is not None:
|
|
1439
|
+
body["value"] = self.value
|
|
1440
|
+
return body
|
|
1441
|
+
|
|
1442
|
+
@classmethod
|
|
1443
|
+
def from_dict(cls, d: Dict[str, Any]) -> FeatureTag:
|
|
1444
|
+
"""Deserializes the FeatureTag from a dictionary."""
|
|
1445
|
+
return cls(key=d.get("key", None), value=d.get("value", None))
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
@dataclass
|
|
1449
|
+
class FileInfo:
|
|
1450
|
+
"""Metadata of a single artifact file or directory."""
|
|
1451
|
+
|
|
1452
|
+
file_size: Optional[int] = None
|
|
1453
|
+
"""The size in bytes of the file. Unset for directories."""
|
|
1454
|
+
|
|
1455
|
+
is_dir: Optional[bool] = None
|
|
1456
|
+
"""Whether the path is a directory."""
|
|
1457
|
+
|
|
1458
|
+
path: Optional[str] = None
|
|
1459
|
+
"""The path relative to the root artifact directory run."""
|
|
1460
|
+
|
|
1461
|
+
def as_dict(self) -> dict:
|
|
1462
|
+
"""Serializes the FileInfo into a dictionary suitable for use as a JSON request body."""
|
|
1463
|
+
body = {}
|
|
1464
|
+
if self.file_size is not None:
|
|
1465
|
+
body["file_size"] = self.file_size
|
|
1466
|
+
if self.is_dir is not None:
|
|
1467
|
+
body["is_dir"] = self.is_dir
|
|
1468
|
+
if self.path is not None:
|
|
1469
|
+
body["path"] = self.path
|
|
1470
|
+
return body
|
|
1471
|
+
|
|
1472
|
+
def as_shallow_dict(self) -> dict:
|
|
1473
|
+
"""Serializes the FileInfo into a shallow dictionary of its immediate attributes."""
|
|
1474
|
+
body = {}
|
|
1475
|
+
if self.file_size is not None:
|
|
1476
|
+
body["file_size"] = self.file_size
|
|
1477
|
+
if self.is_dir is not None:
|
|
1478
|
+
body["is_dir"] = self.is_dir
|
|
1479
|
+
if self.path is not None:
|
|
1480
|
+
body["path"] = self.path
|
|
1481
|
+
return body
|
|
1482
|
+
|
|
1483
|
+
@classmethod
|
|
1484
|
+
def from_dict(cls, d: Dict[str, Any]) -> FileInfo:
|
|
1485
|
+
"""Deserializes the FileInfo from a dictionary."""
|
|
1486
|
+
return cls(file_size=d.get("file_size", None), is_dir=d.get("is_dir", None), path=d.get("path", None))
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
@dataclass
|
|
1490
|
+
class FinalizeLoggedModelResponse:
|
|
1491
|
+
model: Optional[LoggedModel] = None
|
|
1492
|
+
"""The updated logged model."""
|
|
1493
|
+
|
|
1494
|
+
def as_dict(self) -> dict:
|
|
1495
|
+
"""Serializes the FinalizeLoggedModelResponse into a dictionary suitable for use as a JSON request body."""
|
|
1496
|
+
body = {}
|
|
1497
|
+
if self.model:
|
|
1498
|
+
body["model"] = self.model.as_dict()
|
|
1499
|
+
return body
|
|
1500
|
+
|
|
1501
|
+
def as_shallow_dict(self) -> dict:
|
|
1502
|
+
"""Serializes the FinalizeLoggedModelResponse into a shallow dictionary of its immediate attributes."""
|
|
1503
|
+
body = {}
|
|
1504
|
+
if self.model:
|
|
1505
|
+
body["model"] = self.model
|
|
1506
|
+
return body
|
|
1507
|
+
|
|
1508
|
+
@classmethod
|
|
1509
|
+
def from_dict(cls, d: Dict[str, Any]) -> FinalizeLoggedModelResponse:
|
|
1510
|
+
"""Deserializes the FinalizeLoggedModelResponse from a dictionary."""
|
|
1511
|
+
return cls(model=_from_dict(d, "model", LoggedModel))
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
@dataclass
|
|
1515
|
+
class ForecastingExperiment:
|
|
1516
|
+
"""Represents a forecasting experiment with its unique identifier, URL, and state."""
|
|
1517
|
+
|
|
1518
|
+
experiment_id: Optional[str] = None
|
|
1519
|
+
"""The unique ID for the forecasting experiment."""
|
|
1520
|
+
|
|
1521
|
+
experiment_page_url: Optional[str] = None
|
|
1522
|
+
"""The URL to the forecasting experiment page."""
|
|
1523
|
+
|
|
1524
|
+
state: Optional[ForecastingExperimentState] = None
|
|
1525
|
+
"""The current state of the forecasting experiment."""
|
|
1526
|
+
|
|
1527
|
+
def as_dict(self) -> dict:
|
|
1528
|
+
"""Serializes the ForecastingExperiment into a dictionary suitable for use as a JSON request body."""
|
|
1529
|
+
body = {}
|
|
1530
|
+
if self.experiment_id is not None:
|
|
1531
|
+
body["experiment_id"] = self.experiment_id
|
|
1532
|
+
if self.experiment_page_url is not None:
|
|
1533
|
+
body["experiment_page_url"] = self.experiment_page_url
|
|
1534
|
+
if self.state is not None:
|
|
1535
|
+
body["state"] = self.state.value
|
|
1536
|
+
return body
|
|
1537
|
+
|
|
1538
|
+
def as_shallow_dict(self) -> dict:
|
|
1539
|
+
"""Serializes the ForecastingExperiment into a shallow dictionary of its immediate attributes."""
|
|
1540
|
+
body = {}
|
|
1541
|
+
if self.experiment_id is not None:
|
|
1542
|
+
body["experiment_id"] = self.experiment_id
|
|
1543
|
+
if self.experiment_page_url is not None:
|
|
1544
|
+
body["experiment_page_url"] = self.experiment_page_url
|
|
1545
|
+
if self.state is not None:
|
|
1546
|
+
body["state"] = self.state
|
|
1547
|
+
return body
|
|
1548
|
+
|
|
1549
|
+
@classmethod
|
|
1550
|
+
def from_dict(cls, d: Dict[str, Any]) -> ForecastingExperiment:
|
|
1551
|
+
"""Deserializes the ForecastingExperiment from a dictionary."""
|
|
1552
|
+
return cls(
|
|
1553
|
+
experiment_id=d.get("experiment_id", None),
|
|
1554
|
+
experiment_page_url=d.get("experiment_page_url", None),
|
|
1555
|
+
state=_enum(d, "state", ForecastingExperimentState),
|
|
1556
|
+
)
|
|
1557
|
+
|
|
1558
|
+
|
|
1559
|
+
class ForecastingExperimentState(Enum):
|
|
1560
|
+
|
|
1561
|
+
CANCELLED = "CANCELLED"
|
|
1562
|
+
FAILED = "FAILED"
|
|
1563
|
+
PENDING = "PENDING"
|
|
1564
|
+
RUNNING = "RUNNING"
|
|
1565
|
+
SUCCEEDED = "SUCCEEDED"
|
|
1566
|
+
|
|
1567
|
+
|
|
1568
|
+
@dataclass
|
|
1569
|
+
class GetExperimentByNameResponse:
|
|
2314
1570
|
experiment: Optional[Experiment] = None
|
|
2315
1571
|
"""Experiment details."""
|
|
2316
1572
|
|
|
2317
1573
|
def as_dict(self) -> dict:
|
|
2318
|
-
"""Serializes the
|
|
1574
|
+
"""Serializes the GetExperimentByNameResponse into a dictionary suitable for use as a JSON request body."""
|
|
2319
1575
|
body = {}
|
|
2320
1576
|
if self.experiment:
|
|
2321
1577
|
body["experiment"] = self.experiment.as_dict()
|
|
2322
1578
|
return body
|
|
2323
1579
|
|
|
2324
1580
|
def as_shallow_dict(self) -> dict:
|
|
2325
|
-
"""Serializes the
|
|
1581
|
+
"""Serializes the GetExperimentByNameResponse into a shallow dictionary of its immediate attributes."""
|
|
2326
1582
|
body = {}
|
|
2327
1583
|
if self.experiment:
|
|
2328
1584
|
body["experiment"] = self.experiment
|
|
2329
1585
|
return body
|
|
2330
1586
|
|
|
2331
1587
|
@classmethod
|
|
2332
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2333
|
-
"""Deserializes the
|
|
1588
|
+
def from_dict(cls, d: Dict[str, Any]) -> GetExperimentByNameResponse:
|
|
1589
|
+
"""Deserializes the GetExperimentByNameResponse from a dictionary."""
|
|
2334
1590
|
return cls(experiment=_from_dict(d, "experiment", Experiment))
|
|
2335
1591
|
|
|
2336
1592
|
|
|
2337
1593
|
@dataclass
|
|
2338
|
-
class
|
|
2339
|
-
|
|
2340
|
-
"""
|
|
1594
|
+
class GetExperimentPermissionLevelsResponse:
|
|
1595
|
+
permission_levels: Optional[List[ExperimentPermissionsDescription]] = None
|
|
1596
|
+
"""Specific permission levels"""
|
|
1597
|
+
|
|
1598
|
+
def as_dict(self) -> dict:
|
|
1599
|
+
"""Serializes the GetExperimentPermissionLevelsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1600
|
+
body = {}
|
|
1601
|
+
if self.permission_levels:
|
|
1602
|
+
body["permission_levels"] = [v.as_dict() for v in self.permission_levels]
|
|
1603
|
+
return body
|
|
1604
|
+
|
|
1605
|
+
def as_shallow_dict(self) -> dict:
|
|
1606
|
+
"""Serializes the GetExperimentPermissionLevelsResponse into a shallow dictionary of its immediate attributes."""
|
|
1607
|
+
body = {}
|
|
1608
|
+
if self.permission_levels:
|
|
1609
|
+
body["permission_levels"] = self.permission_levels
|
|
1610
|
+
return body
|
|
1611
|
+
|
|
1612
|
+
@classmethod
|
|
1613
|
+
def from_dict(cls, d: Dict[str, Any]) -> GetExperimentPermissionLevelsResponse:
|
|
1614
|
+
"""Deserializes the GetExperimentPermissionLevelsResponse from a dictionary."""
|
|
1615
|
+
return cls(permission_levels=_repeated_dict(d, "permission_levels", ExperimentPermissionsDescription))
|
|
1616
|
+
|
|
2341
1617
|
|
|
2342
|
-
|
|
2343
|
-
|
|
1618
|
+
@dataclass
|
|
1619
|
+
class GetExperimentResponse:
|
|
1620
|
+
experiment: Optional[Experiment] = None
|
|
1621
|
+
"""Experiment details."""
|
|
2344
1622
|
|
|
2345
1623
|
def as_dict(self) -> dict:
|
|
2346
|
-
"""Serializes the
|
|
1624
|
+
"""Serializes the GetExperimentResponse into a dictionary suitable for use as a JSON request body."""
|
|
2347
1625
|
body = {}
|
|
2348
|
-
if self.
|
|
2349
|
-
body["
|
|
2350
|
-
if self.stages:
|
|
2351
|
-
body["stages"] = [v for v in self.stages]
|
|
1626
|
+
if self.experiment:
|
|
1627
|
+
body["experiment"] = self.experiment.as_dict()
|
|
2352
1628
|
return body
|
|
2353
1629
|
|
|
2354
1630
|
def as_shallow_dict(self) -> dict:
|
|
2355
|
-
"""Serializes the
|
|
1631
|
+
"""Serializes the GetExperimentResponse into a shallow dictionary of its immediate attributes."""
|
|
2356
1632
|
body = {}
|
|
2357
|
-
if self.
|
|
2358
|
-
body["
|
|
2359
|
-
if self.stages:
|
|
2360
|
-
body["stages"] = self.stages
|
|
1633
|
+
if self.experiment:
|
|
1634
|
+
body["experiment"] = self.experiment
|
|
2361
1635
|
return body
|
|
2362
1636
|
|
|
2363
1637
|
@classmethod
|
|
2364
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2365
|
-
"""Deserializes the
|
|
2366
|
-
return cls(
|
|
1638
|
+
def from_dict(cls, d: Dict[str, Any]) -> GetExperimentResponse:
|
|
1639
|
+
"""Deserializes the GetExperimentResponse from a dictionary."""
|
|
1640
|
+
return cls(experiment=_from_dict(d, "experiment", Experiment))
|
|
2367
1641
|
|
|
2368
1642
|
|
|
2369
1643
|
@dataclass
|
|
@@ -2753,9 +2027,8 @@ class JobSpecWithoutSecret:
|
|
|
2753
2027
|
"""ID of the job that the webhook runs."""
|
|
2754
2028
|
|
|
2755
2029
|
workspace_url: Optional[str] = None
|
|
2756
|
-
"""URL of the workspace containing the job that this webhook runs.
|
|
2757
|
-
|
|
2758
|
-
as the webhook’s."""
|
|
2030
|
+
"""URL of the workspace containing the job that this webhook runs. If not specified, the job’s
|
|
2031
|
+
workspace URL is assumed to be the same as the workspace where the webhook is created."""
|
|
2759
2032
|
|
|
2760
2033
|
def as_dict(self) -> dict:
|
|
2761
2034
|
"""Serializes the JobSpecWithoutSecret into a dictionary suitable for use as a JSON request body."""
|
|
@@ -2859,6 +2132,41 @@ class ListExperimentsResponse:
|
|
|
2859
2132
|
)
|
|
2860
2133
|
|
|
2861
2134
|
|
|
2135
|
+
@dataclass
|
|
2136
|
+
class ListFeatureTagsResponse:
|
|
2137
|
+
"""Response message for ListFeatureTag."""
|
|
2138
|
+
|
|
2139
|
+
feature_tags: Optional[List[FeatureTag]] = None
|
|
2140
|
+
|
|
2141
|
+
next_page_token: Optional[str] = None
|
|
2142
|
+
"""Pagination token to request the next page of results for this query."""
|
|
2143
|
+
|
|
2144
|
+
def as_dict(self) -> dict:
|
|
2145
|
+
"""Serializes the ListFeatureTagsResponse into a dictionary suitable for use as a JSON request body."""
|
|
2146
|
+
body = {}
|
|
2147
|
+
if self.feature_tags:
|
|
2148
|
+
body["feature_tags"] = [v.as_dict() for v in self.feature_tags]
|
|
2149
|
+
if self.next_page_token is not None:
|
|
2150
|
+
body["next_page_token"] = self.next_page_token
|
|
2151
|
+
return body
|
|
2152
|
+
|
|
2153
|
+
def as_shallow_dict(self) -> dict:
|
|
2154
|
+
"""Serializes the ListFeatureTagsResponse into a shallow dictionary of its immediate attributes."""
|
|
2155
|
+
body = {}
|
|
2156
|
+
if self.feature_tags:
|
|
2157
|
+
body["feature_tags"] = self.feature_tags
|
|
2158
|
+
if self.next_page_token is not None:
|
|
2159
|
+
body["next_page_token"] = self.next_page_token
|
|
2160
|
+
return body
|
|
2161
|
+
|
|
2162
|
+
@classmethod
|
|
2163
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListFeatureTagsResponse:
|
|
2164
|
+
"""Deserializes the ListFeatureTagsResponse from a dictionary."""
|
|
2165
|
+
return cls(
|
|
2166
|
+
feature_tags=_repeated_dict(d, "feature_tags", FeatureTag), next_page_token=d.get("next_page_token", None)
|
|
2167
|
+
)
|
|
2168
|
+
|
|
2169
|
+
|
|
2862
2170
|
@dataclass
|
|
2863
2171
|
class ListModelsResponse:
|
|
2864
2172
|
next_page_token: Optional[str] = None
|
|
@@ -2988,129 +2296,32 @@ class ListTransitionRequestsResponse:
|
|
|
2988
2296
|
|
|
2989
2297
|
|
|
2990
2298
|
@dataclass
|
|
2991
|
-
class
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2299
|
+
class LogBatchResponse:
|
|
2300
|
+
def as_dict(self) -> dict:
|
|
2301
|
+
"""Serializes the LogBatchResponse into a dictionary suitable for use as a JSON request body."""
|
|
2302
|
+
body = {}
|
|
2303
|
+
return body
|
|
2995
2304
|
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2305
|
+
def as_shallow_dict(self) -> dict:
|
|
2306
|
+
"""Serializes the LogBatchResponse into a shallow dictionary of its immediate attributes."""
|
|
2307
|
+
body = {}
|
|
2308
|
+
return body
|
|
2999
2309
|
|
|
3000
|
-
|
|
3001
|
-
|
|
2310
|
+
@classmethod
|
|
2311
|
+
def from_dict(cls, d: Dict[str, Any]) -> LogBatchResponse:
|
|
2312
|
+
"""Deserializes the LogBatchResponse from a dictionary."""
|
|
2313
|
+
return cls()
|
|
3002
2314
|
|
|
3003
|
-
tags: Optional[List[RunTag]] = None
|
|
3004
|
-
"""Tags to log. A single request can contain up to 100 tags, and up to 1000 metrics, params, and
|
|
3005
|
-
tags in total."""
|
|
3006
2315
|
|
|
2316
|
+
@dataclass
|
|
2317
|
+
class LogInputsResponse:
|
|
3007
2318
|
def as_dict(self) -> dict:
|
|
3008
|
-
"""Serializes the
|
|
2319
|
+
"""Serializes the LogInputsResponse into a dictionary suitable for use as a JSON request body."""
|
|
3009
2320
|
body = {}
|
|
3010
|
-
if self.metrics:
|
|
3011
|
-
body["metrics"] = [v.as_dict() for v in self.metrics]
|
|
3012
|
-
if self.params:
|
|
3013
|
-
body["params"] = [v.as_dict() for v in self.params]
|
|
3014
|
-
if self.run_id is not None:
|
|
3015
|
-
body["run_id"] = self.run_id
|
|
3016
|
-
if self.tags:
|
|
3017
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
3018
2321
|
return body
|
|
3019
2322
|
|
|
3020
2323
|
def as_shallow_dict(self) -> dict:
|
|
3021
|
-
"""Serializes the
|
|
3022
|
-
body = {}
|
|
3023
|
-
if self.metrics:
|
|
3024
|
-
body["metrics"] = self.metrics
|
|
3025
|
-
if self.params:
|
|
3026
|
-
body["params"] = self.params
|
|
3027
|
-
if self.run_id is not None:
|
|
3028
|
-
body["run_id"] = self.run_id
|
|
3029
|
-
if self.tags:
|
|
3030
|
-
body["tags"] = self.tags
|
|
3031
|
-
return body
|
|
3032
|
-
|
|
3033
|
-
@classmethod
|
|
3034
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogBatch:
|
|
3035
|
-
"""Deserializes the LogBatch from a dictionary."""
|
|
3036
|
-
return cls(
|
|
3037
|
-
metrics=_repeated_dict(d, "metrics", Metric),
|
|
3038
|
-
params=_repeated_dict(d, "params", Param),
|
|
3039
|
-
run_id=d.get("run_id", None),
|
|
3040
|
-
tags=_repeated_dict(d, "tags", RunTag),
|
|
3041
|
-
)
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
@dataclass
|
|
3045
|
-
class LogBatchResponse:
|
|
3046
|
-
def as_dict(self) -> dict:
|
|
3047
|
-
"""Serializes the LogBatchResponse into a dictionary suitable for use as a JSON request body."""
|
|
3048
|
-
body = {}
|
|
3049
|
-
return body
|
|
3050
|
-
|
|
3051
|
-
def as_shallow_dict(self) -> dict:
|
|
3052
|
-
"""Serializes the LogBatchResponse into a shallow dictionary of its immediate attributes."""
|
|
3053
|
-
body = {}
|
|
3054
|
-
return body
|
|
3055
|
-
|
|
3056
|
-
@classmethod
|
|
3057
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogBatchResponse:
|
|
3058
|
-
"""Deserializes the LogBatchResponse from a dictionary."""
|
|
3059
|
-
return cls()
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
@dataclass
|
|
3063
|
-
class LogInputs:
|
|
3064
|
-
run_id: str
|
|
3065
|
-
"""ID of the run to log under"""
|
|
3066
|
-
|
|
3067
|
-
datasets: Optional[List[DatasetInput]] = None
|
|
3068
|
-
"""Dataset inputs"""
|
|
3069
|
-
|
|
3070
|
-
models: Optional[List[ModelInput]] = None
|
|
3071
|
-
"""Model inputs"""
|
|
3072
|
-
|
|
3073
|
-
def as_dict(self) -> dict:
|
|
3074
|
-
"""Serializes the LogInputs into a dictionary suitable for use as a JSON request body."""
|
|
3075
|
-
body = {}
|
|
3076
|
-
if self.datasets:
|
|
3077
|
-
body["datasets"] = [v.as_dict() for v in self.datasets]
|
|
3078
|
-
if self.models:
|
|
3079
|
-
body["models"] = [v.as_dict() for v in self.models]
|
|
3080
|
-
if self.run_id is not None:
|
|
3081
|
-
body["run_id"] = self.run_id
|
|
3082
|
-
return body
|
|
3083
|
-
|
|
3084
|
-
def as_shallow_dict(self) -> dict:
|
|
3085
|
-
"""Serializes the LogInputs into a shallow dictionary of its immediate attributes."""
|
|
3086
|
-
body = {}
|
|
3087
|
-
if self.datasets:
|
|
3088
|
-
body["datasets"] = self.datasets
|
|
3089
|
-
if self.models:
|
|
3090
|
-
body["models"] = self.models
|
|
3091
|
-
if self.run_id is not None:
|
|
3092
|
-
body["run_id"] = self.run_id
|
|
3093
|
-
return body
|
|
3094
|
-
|
|
3095
|
-
@classmethod
|
|
3096
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogInputs:
|
|
3097
|
-
"""Deserializes the LogInputs from a dictionary."""
|
|
3098
|
-
return cls(
|
|
3099
|
-
datasets=_repeated_dict(d, "datasets", DatasetInput),
|
|
3100
|
-
models=_repeated_dict(d, "models", ModelInput),
|
|
3101
|
-
run_id=d.get("run_id", None),
|
|
3102
|
-
)
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
@dataclass
|
|
3106
|
-
class LogInputsResponse:
|
|
3107
|
-
def as_dict(self) -> dict:
|
|
3108
|
-
"""Serializes the LogInputsResponse into a dictionary suitable for use as a JSON request body."""
|
|
3109
|
-
body = {}
|
|
3110
|
-
return body
|
|
3111
|
-
|
|
3112
|
-
def as_shallow_dict(self) -> dict:
|
|
3113
|
-
"""Serializes the LogInputsResponse into a shallow dictionary of its immediate attributes."""
|
|
2324
|
+
"""Serializes the LogInputsResponse into a shallow dictionary of its immediate attributes."""
|
|
3114
2325
|
body = {}
|
|
3115
2326
|
return body
|
|
3116
2327
|
|
|
@@ -3120,38 +2331,6 @@ class LogInputsResponse:
|
|
|
3120
2331
|
return cls()
|
|
3121
2332
|
|
|
3122
2333
|
|
|
3123
|
-
@dataclass
|
|
3124
|
-
class LogLoggedModelParamsRequest:
|
|
3125
|
-
model_id: Optional[str] = None
|
|
3126
|
-
"""The ID of the logged model to log params for."""
|
|
3127
|
-
|
|
3128
|
-
params: Optional[List[LoggedModelParameter]] = None
|
|
3129
|
-
"""Parameters to attach to the model."""
|
|
3130
|
-
|
|
3131
|
-
def as_dict(self) -> dict:
|
|
3132
|
-
"""Serializes the LogLoggedModelParamsRequest into a dictionary suitable for use as a JSON request body."""
|
|
3133
|
-
body = {}
|
|
3134
|
-
if self.model_id is not None:
|
|
3135
|
-
body["model_id"] = self.model_id
|
|
3136
|
-
if self.params:
|
|
3137
|
-
body["params"] = [v.as_dict() for v in self.params]
|
|
3138
|
-
return body
|
|
3139
|
-
|
|
3140
|
-
def as_shallow_dict(self) -> dict:
|
|
3141
|
-
"""Serializes the LogLoggedModelParamsRequest into a shallow dictionary of its immediate attributes."""
|
|
3142
|
-
body = {}
|
|
3143
|
-
if self.model_id is not None:
|
|
3144
|
-
body["model_id"] = self.model_id
|
|
3145
|
-
if self.params:
|
|
3146
|
-
body["params"] = self.params
|
|
3147
|
-
return body
|
|
3148
|
-
|
|
3149
|
-
@classmethod
|
|
3150
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogLoggedModelParamsRequest:
|
|
3151
|
-
"""Deserializes the LogLoggedModelParamsRequest from a dictionary."""
|
|
3152
|
-
return cls(model_id=d.get("model_id", None), params=_repeated_dict(d, "params", LoggedModelParameter))
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
2334
|
@dataclass
|
|
3156
2335
|
class LogLoggedModelParamsRequestResponse:
|
|
3157
2336
|
def as_dict(self) -> dict:
|
|
@@ -3170,100 +2349,6 @@ class LogLoggedModelParamsRequestResponse:
|
|
|
3170
2349
|
return cls()
|
|
3171
2350
|
|
|
3172
2351
|
|
|
3173
|
-
@dataclass
|
|
3174
|
-
class LogMetric:
|
|
3175
|
-
key: str
|
|
3176
|
-
"""Name of the metric."""
|
|
3177
|
-
|
|
3178
|
-
value: float
|
|
3179
|
-
"""Double value of the metric being logged."""
|
|
3180
|
-
|
|
3181
|
-
timestamp: int
|
|
3182
|
-
"""Unix timestamp in milliseconds at the time metric was logged."""
|
|
3183
|
-
|
|
3184
|
-
dataset_digest: Optional[str] = None
|
|
3185
|
-
"""Dataset digest of the dataset associated with the metric, e.g. an md5 hash of the dataset that
|
|
3186
|
-
uniquely identifies it within datasets of the same name."""
|
|
3187
|
-
|
|
3188
|
-
dataset_name: Optional[str] = None
|
|
3189
|
-
"""The name of the dataset associated with the metric. E.g. “my.uc.table@2”
|
|
3190
|
-
“nyc-taxi-dataset”, “fantastic-elk-3”"""
|
|
3191
|
-
|
|
3192
|
-
model_id: Optional[str] = None
|
|
3193
|
-
"""ID of the logged model associated with the metric, if applicable"""
|
|
3194
|
-
|
|
3195
|
-
run_id: Optional[str] = None
|
|
3196
|
-
"""ID of the run under which to log the metric. Must be provided."""
|
|
3197
|
-
|
|
3198
|
-
run_uuid: Optional[str] = None
|
|
3199
|
-
"""[Deprecated, use `run_id` instead] ID of the run under which to log the metric. This field will
|
|
3200
|
-
be removed in a future MLflow version."""
|
|
3201
|
-
|
|
3202
|
-
step: Optional[int] = None
|
|
3203
|
-
"""Step at which to log the metric"""
|
|
3204
|
-
|
|
3205
|
-
def as_dict(self) -> dict:
|
|
3206
|
-
"""Serializes the LogMetric into a dictionary suitable for use as a JSON request body."""
|
|
3207
|
-
body = {}
|
|
3208
|
-
if self.dataset_digest is not None:
|
|
3209
|
-
body["dataset_digest"] = self.dataset_digest
|
|
3210
|
-
if self.dataset_name is not None:
|
|
3211
|
-
body["dataset_name"] = self.dataset_name
|
|
3212
|
-
if self.key is not None:
|
|
3213
|
-
body["key"] = self.key
|
|
3214
|
-
if self.model_id is not None:
|
|
3215
|
-
body["model_id"] = self.model_id
|
|
3216
|
-
if self.run_id is not None:
|
|
3217
|
-
body["run_id"] = self.run_id
|
|
3218
|
-
if self.run_uuid is not None:
|
|
3219
|
-
body["run_uuid"] = self.run_uuid
|
|
3220
|
-
if self.step is not None:
|
|
3221
|
-
body["step"] = self.step
|
|
3222
|
-
if self.timestamp is not None:
|
|
3223
|
-
body["timestamp"] = self.timestamp
|
|
3224
|
-
if self.value is not None:
|
|
3225
|
-
body["value"] = self.value
|
|
3226
|
-
return body
|
|
3227
|
-
|
|
3228
|
-
def as_shallow_dict(self) -> dict:
|
|
3229
|
-
"""Serializes the LogMetric into a shallow dictionary of its immediate attributes."""
|
|
3230
|
-
body = {}
|
|
3231
|
-
if self.dataset_digest is not None:
|
|
3232
|
-
body["dataset_digest"] = self.dataset_digest
|
|
3233
|
-
if self.dataset_name is not None:
|
|
3234
|
-
body["dataset_name"] = self.dataset_name
|
|
3235
|
-
if self.key is not None:
|
|
3236
|
-
body["key"] = self.key
|
|
3237
|
-
if self.model_id is not None:
|
|
3238
|
-
body["model_id"] = self.model_id
|
|
3239
|
-
if self.run_id is not None:
|
|
3240
|
-
body["run_id"] = self.run_id
|
|
3241
|
-
if self.run_uuid is not None:
|
|
3242
|
-
body["run_uuid"] = self.run_uuid
|
|
3243
|
-
if self.step is not None:
|
|
3244
|
-
body["step"] = self.step
|
|
3245
|
-
if self.timestamp is not None:
|
|
3246
|
-
body["timestamp"] = self.timestamp
|
|
3247
|
-
if self.value is not None:
|
|
3248
|
-
body["value"] = self.value
|
|
3249
|
-
return body
|
|
3250
|
-
|
|
3251
|
-
@classmethod
|
|
3252
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogMetric:
|
|
3253
|
-
"""Deserializes the LogMetric from a dictionary."""
|
|
3254
|
-
return cls(
|
|
3255
|
-
dataset_digest=d.get("dataset_digest", None),
|
|
3256
|
-
dataset_name=d.get("dataset_name", None),
|
|
3257
|
-
key=d.get("key", None),
|
|
3258
|
-
model_id=d.get("model_id", None),
|
|
3259
|
-
run_id=d.get("run_id", None),
|
|
3260
|
-
run_uuid=d.get("run_uuid", None),
|
|
3261
|
-
step=d.get("step", None),
|
|
3262
|
-
timestamp=d.get("timestamp", None),
|
|
3263
|
-
value=d.get("value", None),
|
|
3264
|
-
)
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
2352
|
@dataclass
|
|
3268
2353
|
class LogMetricResponse:
|
|
3269
2354
|
def as_dict(self) -> dict:
|
|
@@ -3282,38 +2367,6 @@ class LogMetricResponse:
|
|
|
3282
2367
|
return cls()
|
|
3283
2368
|
|
|
3284
2369
|
|
|
3285
|
-
@dataclass
|
|
3286
|
-
class LogModel:
|
|
3287
|
-
model_json: Optional[str] = None
|
|
3288
|
-
"""MLmodel file in json format."""
|
|
3289
|
-
|
|
3290
|
-
run_id: Optional[str] = None
|
|
3291
|
-
"""ID of the run to log under"""
|
|
3292
|
-
|
|
3293
|
-
def as_dict(self) -> dict:
|
|
3294
|
-
"""Serializes the LogModel into a dictionary suitable for use as a JSON request body."""
|
|
3295
|
-
body = {}
|
|
3296
|
-
if self.model_json is not None:
|
|
3297
|
-
body["model_json"] = self.model_json
|
|
3298
|
-
if self.run_id is not None:
|
|
3299
|
-
body["run_id"] = self.run_id
|
|
3300
|
-
return body
|
|
3301
|
-
|
|
3302
|
-
def as_shallow_dict(self) -> dict:
|
|
3303
|
-
"""Serializes the LogModel into a shallow dictionary of its immediate attributes."""
|
|
3304
|
-
body = {}
|
|
3305
|
-
if self.model_json is not None:
|
|
3306
|
-
body["model_json"] = self.model_json
|
|
3307
|
-
if self.run_id is not None:
|
|
3308
|
-
body["run_id"] = self.run_id
|
|
3309
|
-
return body
|
|
3310
|
-
|
|
3311
|
-
@classmethod
|
|
3312
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogModel:
|
|
3313
|
-
"""Deserializes the LogModel from a dictionary."""
|
|
3314
|
-
return cls(model_json=d.get("model_json", None), run_id=d.get("run_id", None))
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
2370
|
@dataclass
|
|
3318
2371
|
class LogModelResponse:
|
|
3319
2372
|
def as_dict(self) -> dict:
|
|
@@ -3332,38 +2385,6 @@ class LogModelResponse:
|
|
|
3332
2385
|
return cls()
|
|
3333
2386
|
|
|
3334
2387
|
|
|
3335
|
-
@dataclass
|
|
3336
|
-
class LogOutputsRequest:
|
|
3337
|
-
run_id: str
|
|
3338
|
-
"""The ID of the Run from which to log outputs."""
|
|
3339
|
-
|
|
3340
|
-
models: Optional[List[ModelOutput]] = None
|
|
3341
|
-
"""The model outputs from the Run."""
|
|
3342
|
-
|
|
3343
|
-
def as_dict(self) -> dict:
|
|
3344
|
-
"""Serializes the LogOutputsRequest into a dictionary suitable for use as a JSON request body."""
|
|
3345
|
-
body = {}
|
|
3346
|
-
if self.models:
|
|
3347
|
-
body["models"] = [v.as_dict() for v in self.models]
|
|
3348
|
-
if self.run_id is not None:
|
|
3349
|
-
body["run_id"] = self.run_id
|
|
3350
|
-
return body
|
|
3351
|
-
|
|
3352
|
-
def as_shallow_dict(self) -> dict:
|
|
3353
|
-
"""Serializes the LogOutputsRequest into a shallow dictionary of its immediate attributes."""
|
|
3354
|
-
body = {}
|
|
3355
|
-
if self.models:
|
|
3356
|
-
body["models"] = self.models
|
|
3357
|
-
if self.run_id is not None:
|
|
3358
|
-
body["run_id"] = self.run_id
|
|
3359
|
-
return body
|
|
3360
|
-
|
|
3361
|
-
@classmethod
|
|
3362
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogOutputsRequest:
|
|
3363
|
-
"""Deserializes the LogOutputsRequest from a dictionary."""
|
|
3364
|
-
return cls(models=_repeated_dict(d, "models", ModelOutput), run_id=d.get("run_id", None))
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
2388
|
@dataclass
|
|
3368
2389
|
class LogOutputsResponse:
|
|
3369
2390
|
def as_dict(self) -> dict:
|
|
@@ -3382,58 +2403,6 @@ class LogOutputsResponse:
|
|
|
3382
2403
|
return cls()
|
|
3383
2404
|
|
|
3384
2405
|
|
|
3385
|
-
@dataclass
|
|
3386
|
-
class LogParam:
|
|
3387
|
-
key: str
|
|
3388
|
-
"""Name of the param. Maximum size is 255 bytes."""
|
|
3389
|
-
|
|
3390
|
-
value: str
|
|
3391
|
-
"""String value of the param being logged. Maximum size is 500 bytes."""
|
|
3392
|
-
|
|
3393
|
-
run_id: Optional[str] = None
|
|
3394
|
-
"""ID of the run under which to log the param. Must be provided."""
|
|
3395
|
-
|
|
3396
|
-
run_uuid: Optional[str] = None
|
|
3397
|
-
"""[Deprecated, use `run_id` instead] ID of the run under which to log the param. This field will
|
|
3398
|
-
be removed in a future MLflow version."""
|
|
3399
|
-
|
|
3400
|
-
def as_dict(self) -> dict:
|
|
3401
|
-
"""Serializes the LogParam into a dictionary suitable for use as a JSON request body."""
|
|
3402
|
-
body = {}
|
|
3403
|
-
if self.key is not None:
|
|
3404
|
-
body["key"] = self.key
|
|
3405
|
-
if self.run_id is not None:
|
|
3406
|
-
body["run_id"] = self.run_id
|
|
3407
|
-
if self.run_uuid is not None:
|
|
3408
|
-
body["run_uuid"] = self.run_uuid
|
|
3409
|
-
if self.value is not None:
|
|
3410
|
-
body["value"] = self.value
|
|
3411
|
-
return body
|
|
3412
|
-
|
|
3413
|
-
def as_shallow_dict(self) -> dict:
|
|
3414
|
-
"""Serializes the LogParam into a shallow dictionary of its immediate attributes."""
|
|
3415
|
-
body = {}
|
|
3416
|
-
if self.key is not None:
|
|
3417
|
-
body["key"] = self.key
|
|
3418
|
-
if self.run_id is not None:
|
|
3419
|
-
body["run_id"] = self.run_id
|
|
3420
|
-
if self.run_uuid is not None:
|
|
3421
|
-
body["run_uuid"] = self.run_uuid
|
|
3422
|
-
if self.value is not None:
|
|
3423
|
-
body["value"] = self.value
|
|
3424
|
-
return body
|
|
3425
|
-
|
|
3426
|
-
@classmethod
|
|
3427
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogParam:
|
|
3428
|
-
"""Deserializes the LogParam from a dictionary."""
|
|
3429
|
-
return cls(
|
|
3430
|
-
key=d.get("key", None),
|
|
3431
|
-
run_id=d.get("run_id", None),
|
|
3432
|
-
run_uuid=d.get("run_uuid", None),
|
|
3433
|
-
value=d.get("value", None),
|
|
3434
|
-
)
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
2406
|
@dataclass
|
|
3438
2407
|
class LogParamResponse:
|
|
3439
2408
|
def as_dict(self) -> dict:
|
|
@@ -3892,7 +2861,7 @@ class ModelDatabricks:
|
|
|
3892
2861
|
"""Unique identifier for the object."""
|
|
3893
2862
|
|
|
3894
2863
|
last_updated_timestamp: Optional[int] = None
|
|
3895
|
-
"""
|
|
2864
|
+
"""Last update time of the object, as a Unix timestamp in milliseconds."""
|
|
3896
2865
|
|
|
3897
2866
|
latest_versions: Optional[List[ModelVersion]] = None
|
|
3898
2867
|
"""Array of model versions, each the latest version for its stage."""
|
|
@@ -3901,8 +2870,7 @@ class ModelDatabricks:
|
|
|
3901
2870
|
"""Name of the model."""
|
|
3902
2871
|
|
|
3903
2872
|
permission_level: Optional[PermissionLevel] = None
|
|
3904
|
-
"""Permission level
|
|
3905
|
-
[MLflow Model permissions](..)."""
|
|
2873
|
+
"""Permission level granted for the requesting user on this registered model"""
|
|
3906
2874
|
|
|
3907
2875
|
tags: Optional[List[ModelTag]] = None
|
|
3908
2876
|
"""Array of tags associated with the model."""
|
|
@@ -4035,6 +3003,8 @@ class ModelOutput:
|
|
|
4035
3003
|
|
|
4036
3004
|
@dataclass
|
|
4037
3005
|
class ModelTag:
|
|
3006
|
+
"""Tag for a registered model"""
|
|
3007
|
+
|
|
4038
3008
|
key: Optional[str] = None
|
|
4039
3009
|
"""The tag key."""
|
|
4040
3010
|
|
|
@@ -4194,29 +3164,29 @@ class ModelVersionDatabricks:
|
|
|
4194
3164
|
creation_timestamp: Optional[int] = None
|
|
4195
3165
|
"""Creation time of the object, as a Unix timestamp in milliseconds."""
|
|
4196
3166
|
|
|
4197
|
-
current_stage: Optional[
|
|
4198
|
-
"""Stage of the model version. Valid values are:
|
|
4199
|
-
|
|
4200
|
-
* `None`: The initial stage of a model version.
|
|
4201
|
-
|
|
4202
|
-
* `Staging`: Staging or pre-production stage.
|
|
4203
|
-
|
|
4204
|
-
* `Production`: Production stage.
|
|
4205
|
-
|
|
4206
|
-
* `Archived`: Archived stage."""
|
|
3167
|
+
current_stage: Optional[str] = None
|
|
4207
3168
|
|
|
4208
3169
|
description: Optional[str] = None
|
|
4209
3170
|
"""User-specified description for the object."""
|
|
4210
3171
|
|
|
3172
|
+
email_subscription_status: Optional[RegistryEmailSubscriptionType] = None
|
|
3173
|
+
"""Email Subscription Status: This is the subscription status of the user to the model version
|
|
3174
|
+
Users get subscribed by interacting with the model version."""
|
|
3175
|
+
|
|
3176
|
+
feature_list: Optional[FeatureList] = None
|
|
3177
|
+
"""Feature lineage of `model_version`."""
|
|
3178
|
+
|
|
4211
3179
|
last_updated_timestamp: Optional[int] = None
|
|
4212
3180
|
"""Time of the object at last update, as a Unix timestamp in milliseconds."""
|
|
4213
3181
|
|
|
4214
3182
|
name: Optional[str] = None
|
|
4215
3183
|
"""Name of the model."""
|
|
4216
3184
|
|
|
3185
|
+
open_requests: Optional[List[Activity]] = None
|
|
3186
|
+
"""Open requests for this `model_versions`. Gap in sequence number is intentional and is done in
|
|
3187
|
+
order to match field sequence numbers of `ModelVersion` proto message"""
|
|
3188
|
+
|
|
4217
3189
|
permission_level: Optional[PermissionLevel] = None
|
|
4218
|
-
"""Permission level of the requesting user on the object. For what is allowed at each level, see
|
|
4219
|
-
[MLflow Model permissions](..)."""
|
|
4220
3190
|
|
|
4221
3191
|
run_id: Optional[str] = None
|
|
4222
3192
|
"""Unique identifier for the MLflow tracking run associated with the source model artifacts."""
|
|
@@ -4231,12 +3201,6 @@ class ModelVersionDatabricks:
|
|
|
4231
3201
|
model version."""
|
|
4232
3202
|
|
|
4233
3203
|
status: Optional[Status] = None
|
|
4234
|
-
"""The status of the model version. Valid values are: * `PENDING_REGISTRATION`: Request to register
|
|
4235
|
-
a new model version is pending as server performs background tasks.
|
|
4236
|
-
|
|
4237
|
-
* `FAILED_REGISTRATION`: Request to register a new model version has failed.
|
|
4238
|
-
|
|
4239
|
-
* `READY`: Model version is ready for use."""
|
|
4240
3204
|
|
|
4241
3205
|
status_message: Optional[str] = None
|
|
4242
3206
|
"""Details on the current status, for example why registration failed."""
|
|
@@ -4256,13 +3220,19 @@ class ModelVersionDatabricks:
|
|
|
4256
3220
|
if self.creation_timestamp is not None:
|
|
4257
3221
|
body["creation_timestamp"] = self.creation_timestamp
|
|
4258
3222
|
if self.current_stage is not None:
|
|
4259
|
-
body["current_stage"] = self.current_stage
|
|
3223
|
+
body["current_stage"] = self.current_stage
|
|
4260
3224
|
if self.description is not None:
|
|
4261
3225
|
body["description"] = self.description
|
|
3226
|
+
if self.email_subscription_status is not None:
|
|
3227
|
+
body["email_subscription_status"] = self.email_subscription_status.value
|
|
3228
|
+
if self.feature_list:
|
|
3229
|
+
body["feature_list"] = self.feature_list.as_dict()
|
|
4262
3230
|
if self.last_updated_timestamp is not None:
|
|
4263
3231
|
body["last_updated_timestamp"] = self.last_updated_timestamp
|
|
4264
3232
|
if self.name is not None:
|
|
4265
3233
|
body["name"] = self.name
|
|
3234
|
+
if self.open_requests:
|
|
3235
|
+
body["open_requests"] = [v.as_dict() for v in self.open_requests]
|
|
4266
3236
|
if self.permission_level is not None:
|
|
4267
3237
|
body["permission_level"] = self.permission_level.value
|
|
4268
3238
|
if self.run_id is not None:
|
|
@@ -4292,10 +3262,16 @@ class ModelVersionDatabricks:
|
|
|
4292
3262
|
body["current_stage"] = self.current_stage
|
|
4293
3263
|
if self.description is not None:
|
|
4294
3264
|
body["description"] = self.description
|
|
3265
|
+
if self.email_subscription_status is not None:
|
|
3266
|
+
body["email_subscription_status"] = self.email_subscription_status
|
|
3267
|
+
if self.feature_list:
|
|
3268
|
+
body["feature_list"] = self.feature_list
|
|
4295
3269
|
if self.last_updated_timestamp is not None:
|
|
4296
3270
|
body["last_updated_timestamp"] = self.last_updated_timestamp
|
|
4297
3271
|
if self.name is not None:
|
|
4298
3272
|
body["name"] = self.name
|
|
3273
|
+
if self.open_requests:
|
|
3274
|
+
body["open_requests"] = self.open_requests
|
|
4299
3275
|
if self.permission_level is not None:
|
|
4300
3276
|
body["permission_level"] = self.permission_level
|
|
4301
3277
|
if self.run_id is not None:
|
|
@@ -4321,10 +3297,13 @@ class ModelVersionDatabricks:
|
|
|
4321
3297
|
"""Deserializes the ModelVersionDatabricks from a dictionary."""
|
|
4322
3298
|
return cls(
|
|
4323
3299
|
creation_timestamp=d.get("creation_timestamp", None),
|
|
4324
|
-
current_stage=
|
|
3300
|
+
current_stage=d.get("current_stage", None),
|
|
4325
3301
|
description=d.get("description", None),
|
|
3302
|
+
email_subscription_status=_enum(d, "email_subscription_status", RegistryEmailSubscriptionType),
|
|
3303
|
+
feature_list=_from_dict(d, "feature_list", FeatureList),
|
|
4326
3304
|
last_updated_timestamp=d.get("last_updated_timestamp", None),
|
|
4327
3305
|
name=d.get("name", None),
|
|
3306
|
+
open_requests=_repeated_dict(d, "open_requests", Activity),
|
|
4328
3307
|
permission_level=_enum(d, "permission_level", PermissionLevel),
|
|
4329
3308
|
run_id=d.get("run_id", None),
|
|
4330
3309
|
run_link=d.get("run_link", None),
|
|
@@ -4338,7 +3317,12 @@ class ModelVersionDatabricks:
|
|
|
4338
3317
|
|
|
4339
3318
|
|
|
4340
3319
|
class ModelVersionStatus(Enum):
|
|
4341
|
-
"""
|
|
3320
|
+
"""The status of the model version. Valid values are: * `PENDING_REGISTRATION`: Request to register
|
|
3321
|
+
a new model version is pending as server performs background tasks.
|
|
3322
|
+
|
|
3323
|
+
* `FAILED_REGISTRATION`: Request to register a new model version has failed.
|
|
3324
|
+
|
|
3325
|
+
* `READY`: Model version is ready for use."""
|
|
4342
3326
|
|
|
4343
3327
|
FAILED_REGISTRATION = "FAILED_REGISTRATION"
|
|
4344
3328
|
PENDING_REGISTRATION = "PENDING_REGISTRATION"
|
|
@@ -4384,7 +3368,7 @@ class OnlineStore:
|
|
|
4384
3368
|
name: str
|
|
4385
3369
|
"""The name of the online store. This is the unique identifier for the online store."""
|
|
4386
3370
|
|
|
4387
|
-
capacity:
|
|
3371
|
+
capacity: str
|
|
4388
3372
|
"""The capacity of the online store. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"."""
|
|
4389
3373
|
|
|
4390
3374
|
creation_time: Optional[str] = None
|
|
@@ -4393,6 +3377,9 @@ class OnlineStore:
|
|
|
4393
3377
|
creator: Optional[str] = None
|
|
4394
3378
|
"""The email of the creator of the online store."""
|
|
4395
3379
|
|
|
3380
|
+
read_replica_count: Optional[int] = None
|
|
3381
|
+
"""The number of read replicas for the online store. Defaults to 0."""
|
|
3382
|
+
|
|
4396
3383
|
state: Optional[OnlineStoreState] = None
|
|
4397
3384
|
"""The current state of the online store."""
|
|
4398
3385
|
|
|
@@ -4407,6 +3394,8 @@ class OnlineStore:
|
|
|
4407
3394
|
body["creator"] = self.creator
|
|
4408
3395
|
if self.name is not None:
|
|
4409
3396
|
body["name"] = self.name
|
|
3397
|
+
if self.read_replica_count is not None:
|
|
3398
|
+
body["read_replica_count"] = self.read_replica_count
|
|
4410
3399
|
if self.state is not None:
|
|
4411
3400
|
body["state"] = self.state.value
|
|
4412
3401
|
return body
|
|
@@ -4422,6 +3411,8 @@ class OnlineStore:
|
|
|
4422
3411
|
body["creator"] = self.creator
|
|
4423
3412
|
if self.name is not None:
|
|
4424
3413
|
body["name"] = self.name
|
|
3414
|
+
if self.read_replica_count is not None:
|
|
3415
|
+
body["read_replica_count"] = self.read_replica_count
|
|
4425
3416
|
if self.state is not None:
|
|
4426
3417
|
body["state"] = self.state
|
|
4427
3418
|
return body
|
|
@@ -4434,6 +3425,7 @@ class OnlineStore:
|
|
|
4434
3425
|
creation_time=d.get("creation_time", None),
|
|
4435
3426
|
creator=d.get("creator", None),
|
|
4436
3427
|
name=d.get("name", None),
|
|
3428
|
+
read_replica_count=d.get("read_replica_count", None),
|
|
4437
3429
|
state=_enum(d, "state", OnlineStoreState),
|
|
4438
3430
|
)
|
|
4439
3431
|
|
|
@@ -4486,6 +3478,7 @@ class PermissionLevel(Enum):
|
|
|
4486
3478
|
"""Permission level of the requesting user on the object. For what is allowed at each level, see
|
|
4487
3479
|
[MLflow Model permissions](..)."""
|
|
4488
3480
|
|
|
3481
|
+
CAN_CREATE_REGISTERED_MODEL = "CAN_CREATE_REGISTERED_MODEL"
|
|
4489
3482
|
CAN_EDIT = "CAN_EDIT"
|
|
4490
3483
|
CAN_MANAGE = "CAN_MANAGE"
|
|
4491
3484
|
CAN_MANAGE_PRODUCTION_VERSIONS = "CAN_MANAGE_PRODUCTION_VERSIONS"
|
|
@@ -4498,9 +3491,8 @@ class PublishSpec:
|
|
|
4498
3491
|
online_store: str
|
|
4499
3492
|
"""The name of the target online store."""
|
|
4500
3493
|
|
|
4501
|
-
online_table_name:
|
|
4502
|
-
"""The full three-part (catalog, schema, table) name of the online table.
|
|
4503
|
-
specified."""
|
|
3494
|
+
online_table_name: str
|
|
3495
|
+
"""The full three-part (catalog, schema, table) name of the online table."""
|
|
4504
3496
|
|
|
4505
3497
|
publish_mode: Optional[PublishSpecPublishMode] = None
|
|
4506
3498
|
"""The publish mode of the pipeline that syncs the online table with the source table. Defaults to
|
|
@@ -4545,40 +3537,6 @@ class PublishSpecPublishMode(Enum):
|
|
|
4545
3537
|
TRIGGERED = "TRIGGERED"
|
|
4546
3538
|
|
|
4547
3539
|
|
|
4548
|
-
@dataclass
|
|
4549
|
-
class PublishTableRequest:
|
|
4550
|
-
publish_spec: PublishSpec
|
|
4551
|
-
"""The specification for publishing the online table from the source table."""
|
|
4552
|
-
|
|
4553
|
-
source_table_name: Optional[str] = None
|
|
4554
|
-
"""The full three-part (catalog, schema, table) name of the source table."""
|
|
4555
|
-
|
|
4556
|
-
def as_dict(self) -> dict:
|
|
4557
|
-
"""Serializes the PublishTableRequest into a dictionary suitable for use as a JSON request body."""
|
|
4558
|
-
body = {}
|
|
4559
|
-
if self.publish_spec:
|
|
4560
|
-
body["publish_spec"] = self.publish_spec.as_dict()
|
|
4561
|
-
if self.source_table_name is not None:
|
|
4562
|
-
body["source_table_name"] = self.source_table_name
|
|
4563
|
-
return body
|
|
4564
|
-
|
|
4565
|
-
def as_shallow_dict(self) -> dict:
|
|
4566
|
-
"""Serializes the PublishTableRequest into a shallow dictionary of its immediate attributes."""
|
|
4567
|
-
body = {}
|
|
4568
|
-
if self.publish_spec:
|
|
4569
|
-
body["publish_spec"] = self.publish_spec
|
|
4570
|
-
if self.source_table_name is not None:
|
|
4571
|
-
body["source_table_name"] = self.source_table_name
|
|
4572
|
-
return body
|
|
4573
|
-
|
|
4574
|
-
@classmethod
|
|
4575
|
-
def from_dict(cls, d: Dict[str, Any]) -> PublishTableRequest:
|
|
4576
|
-
"""Deserializes the PublishTableRequest from a dictionary."""
|
|
4577
|
-
return cls(
|
|
4578
|
-
publish_spec=_from_dict(d, "publish_spec", PublishSpec), source_table_name=d.get("source_table_name", None)
|
|
4579
|
-
)
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
3540
|
@dataclass
|
|
4583
3541
|
class PublishTableResponse:
|
|
4584
3542
|
online_table_name: Optional[str] = None
|
|
@@ -4617,7 +3575,6 @@ class RegisteredModelAccessControlRequest:
|
|
|
4617
3575
|
"""name of the group"""
|
|
4618
3576
|
|
|
4619
3577
|
permission_level: Optional[RegisteredModelPermissionLevel] = None
|
|
4620
|
-
"""Permission level"""
|
|
4621
3578
|
|
|
4622
3579
|
service_principal_name: Optional[str] = None
|
|
4623
3580
|
"""application ID of a service principal"""
|
|
@@ -4728,7 +3685,6 @@ class RegisteredModelPermission:
|
|
|
4728
3685
|
inherited_from_object: Optional[List[str]] = None
|
|
4729
3686
|
|
|
4730
3687
|
permission_level: Optional[RegisteredModelPermissionLevel] = None
|
|
4731
|
-
"""Permission level"""
|
|
4732
3688
|
|
|
4733
3689
|
def as_dict(self) -> dict:
|
|
4734
3690
|
"""Serializes the RegisteredModelPermission into a dictionary suitable for use as a JSON request body."""
|
|
@@ -4817,7 +3773,6 @@ class RegisteredModelPermissionsDescription:
|
|
|
4817
3773
|
description: Optional[str] = None
|
|
4818
3774
|
|
|
4819
3775
|
permission_level: Optional[RegisteredModelPermissionLevel] = None
|
|
4820
|
-
"""Permission level"""
|
|
4821
3776
|
|
|
4822
3777
|
def as_dict(self) -> dict:
|
|
4823
3778
|
"""Serializes the RegisteredModelPermissionsDescription into a dictionary suitable for use as a JSON request body."""
|
|
@@ -4846,38 +3801,16 @@ class RegisteredModelPermissionsDescription:
|
|
|
4846
3801
|
)
|
|
4847
3802
|
|
|
4848
3803
|
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
"""The registered model for which to get or manage permissions."""
|
|
4855
|
-
|
|
4856
|
-
def as_dict(self) -> dict:
|
|
4857
|
-
"""Serializes the RegisteredModelPermissionsRequest into a dictionary suitable for use as a JSON request body."""
|
|
4858
|
-
body = {}
|
|
4859
|
-
if self.access_control_list:
|
|
4860
|
-
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
4861
|
-
if self.registered_model_id is not None:
|
|
4862
|
-
body["registered_model_id"] = self.registered_model_id
|
|
4863
|
-
return body
|
|
4864
|
-
|
|
4865
|
-
def as_shallow_dict(self) -> dict:
|
|
4866
|
-
"""Serializes the RegisteredModelPermissionsRequest into a shallow dictionary of its immediate attributes."""
|
|
4867
|
-
body = {}
|
|
4868
|
-
if self.access_control_list:
|
|
4869
|
-
body["access_control_list"] = self.access_control_list
|
|
4870
|
-
if self.registered_model_id is not None:
|
|
4871
|
-
body["registered_model_id"] = self.registered_model_id
|
|
4872
|
-
return body
|
|
3804
|
+
class RegistryEmailSubscriptionType(Enum):
|
|
3805
|
+
""".. note:: Experimental: This entity may change or be removed in a future release without
|
|
3806
|
+
warning. Email subscription types for registry notifications: - `ALL_EVENTS`: Subscribed to all
|
|
3807
|
+
events. - `DEFAULT`: Default subscription type. - `SUBSCRIBED`: Subscribed to notifications. -
|
|
3808
|
+
`UNSUBSCRIBED`: Not subscribed to notifications."""
|
|
4873
3809
|
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
access_control_list=_repeated_dict(d, "access_control_list", RegisteredModelAccessControlRequest),
|
|
4879
|
-
registered_model_id=d.get("registered_model_id", None),
|
|
4880
|
-
)
|
|
3810
|
+
ALL_EVENTS = "ALL_EVENTS"
|
|
3811
|
+
DEFAULT = "DEFAULT"
|
|
3812
|
+
SUBSCRIBED = "SUBSCRIBED"
|
|
3813
|
+
UNSUBSCRIBED = "UNSUBSCRIBED"
|
|
4881
3814
|
|
|
4882
3815
|
|
|
4883
3816
|
@dataclass
|
|
@@ -4932,13 +3865,6 @@ class RegistryWebhook:
|
|
|
4932
3865
|
"""Name of the model whose events would trigger this webhook."""
|
|
4933
3866
|
|
|
4934
3867
|
status: Optional[RegistryWebhookStatus] = None
|
|
4935
|
-
"""Enable or disable triggering the webhook, or put the webhook into test mode. The default is
|
|
4936
|
-
`ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.
|
|
4937
|
-
|
|
4938
|
-
* `DISABLED`: Webhook is not triggered.
|
|
4939
|
-
|
|
4940
|
-
* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a
|
|
4941
|
-
real event."""
|
|
4942
3868
|
|
|
4943
3869
|
def as_dict(self) -> dict:
|
|
4944
3870
|
"""Serializes the RegistryWebhook into a dictionary suitable for use as a JSON request body."""
|
|
@@ -5032,69 +3958,10 @@ class RegistryWebhookStatus(Enum):
|
|
|
5032
3958
|
TEST_MODE = "TEST_MODE"
|
|
5033
3959
|
|
|
5034
3960
|
|
|
5035
|
-
@dataclass
|
|
5036
|
-
class RejectTransitionRequest:
|
|
5037
|
-
name: str
|
|
5038
|
-
"""Name of the model."""
|
|
5039
|
-
|
|
5040
|
-
version: str
|
|
5041
|
-
"""Version of the model."""
|
|
5042
|
-
|
|
5043
|
-
stage: Stage
|
|
5044
|
-
"""Target stage of the transition. Valid values are:
|
|
5045
|
-
|
|
5046
|
-
* `None`: The initial stage of a model version.
|
|
5047
|
-
|
|
5048
|
-
* `Staging`: Staging or pre-production stage.
|
|
5049
|
-
|
|
5050
|
-
* `Production`: Production stage.
|
|
5051
|
-
|
|
5052
|
-
* `Archived`: Archived stage."""
|
|
5053
|
-
|
|
5054
|
-
comment: Optional[str] = None
|
|
5055
|
-
"""User-provided comment on the action."""
|
|
5056
|
-
|
|
5057
|
-
def as_dict(self) -> dict:
|
|
5058
|
-
"""Serializes the RejectTransitionRequest into a dictionary suitable for use as a JSON request body."""
|
|
5059
|
-
body = {}
|
|
5060
|
-
if self.comment is not None:
|
|
5061
|
-
body["comment"] = self.comment
|
|
5062
|
-
if self.name is not None:
|
|
5063
|
-
body["name"] = self.name
|
|
5064
|
-
if self.stage is not None:
|
|
5065
|
-
body["stage"] = self.stage.value
|
|
5066
|
-
if self.version is not None:
|
|
5067
|
-
body["version"] = self.version
|
|
5068
|
-
return body
|
|
5069
|
-
|
|
5070
|
-
def as_shallow_dict(self) -> dict:
|
|
5071
|
-
"""Serializes the RejectTransitionRequest into a shallow dictionary of its immediate attributes."""
|
|
5072
|
-
body = {}
|
|
5073
|
-
if self.comment is not None:
|
|
5074
|
-
body["comment"] = self.comment
|
|
5075
|
-
if self.name is not None:
|
|
5076
|
-
body["name"] = self.name
|
|
5077
|
-
if self.stage is not None:
|
|
5078
|
-
body["stage"] = self.stage
|
|
5079
|
-
if self.version is not None:
|
|
5080
|
-
body["version"] = self.version
|
|
5081
|
-
return body
|
|
5082
|
-
|
|
5083
|
-
@classmethod
|
|
5084
|
-
def from_dict(cls, d: Dict[str, Any]) -> RejectTransitionRequest:
|
|
5085
|
-
"""Deserializes the RejectTransitionRequest from a dictionary."""
|
|
5086
|
-
return cls(
|
|
5087
|
-
comment=d.get("comment", None),
|
|
5088
|
-
name=d.get("name", None),
|
|
5089
|
-
stage=_enum(d, "stage", Stage),
|
|
5090
|
-
version=d.get("version", None),
|
|
5091
|
-
)
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
3961
|
@dataclass
|
|
5095
3962
|
class RejectTransitionRequestResponse:
|
|
5096
3963
|
activity: Optional[Activity] = None
|
|
5097
|
-
"""
|
|
3964
|
+
"""New activity generated as a result of this operation."""
|
|
5098
3965
|
|
|
5099
3966
|
def as_dict(self) -> dict:
|
|
5100
3967
|
"""Serializes the RejectTransitionRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -5116,38 +3983,6 @@ class RejectTransitionRequestResponse:
|
|
|
5116
3983
|
return cls(activity=_from_dict(d, "activity", Activity))
|
|
5117
3984
|
|
|
5118
3985
|
|
|
5119
|
-
@dataclass
|
|
5120
|
-
class RenameModelRequest:
|
|
5121
|
-
name: str
|
|
5122
|
-
"""Registered model unique name identifier."""
|
|
5123
|
-
|
|
5124
|
-
new_name: Optional[str] = None
|
|
5125
|
-
"""If provided, updates the name for this `registered_model`."""
|
|
5126
|
-
|
|
5127
|
-
def as_dict(self) -> dict:
|
|
5128
|
-
"""Serializes the RenameModelRequest into a dictionary suitable for use as a JSON request body."""
|
|
5129
|
-
body = {}
|
|
5130
|
-
if self.name is not None:
|
|
5131
|
-
body["name"] = self.name
|
|
5132
|
-
if self.new_name is not None:
|
|
5133
|
-
body["new_name"] = self.new_name
|
|
5134
|
-
return body
|
|
5135
|
-
|
|
5136
|
-
def as_shallow_dict(self) -> dict:
|
|
5137
|
-
"""Serializes the RenameModelRequest into a shallow dictionary of its immediate attributes."""
|
|
5138
|
-
body = {}
|
|
5139
|
-
if self.name is not None:
|
|
5140
|
-
body["name"] = self.name
|
|
5141
|
-
if self.new_name is not None:
|
|
5142
|
-
body["new_name"] = self.new_name
|
|
5143
|
-
return body
|
|
5144
|
-
|
|
5145
|
-
@classmethod
|
|
5146
|
-
def from_dict(cls, d: Dict[str, Any]) -> RenameModelRequest:
|
|
5147
|
-
"""Deserializes the RenameModelRequest from a dictionary."""
|
|
5148
|
-
return cls(name=d.get("name", None), new_name=d.get("new_name", None))
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
3986
|
@dataclass
|
|
5152
3987
|
class RenameModelResponse:
|
|
5153
3988
|
registered_model: Optional[Model] = None
|
|
@@ -5172,31 +4007,6 @@ class RenameModelResponse:
|
|
|
5172
4007
|
return cls(registered_model=_from_dict(d, "registered_model", Model))
|
|
5173
4008
|
|
|
5174
4009
|
|
|
5175
|
-
@dataclass
|
|
5176
|
-
class RestoreExperiment:
|
|
5177
|
-
experiment_id: str
|
|
5178
|
-
"""ID of the associated experiment."""
|
|
5179
|
-
|
|
5180
|
-
def as_dict(self) -> dict:
|
|
5181
|
-
"""Serializes the RestoreExperiment into a dictionary suitable for use as a JSON request body."""
|
|
5182
|
-
body = {}
|
|
5183
|
-
if self.experiment_id is not None:
|
|
5184
|
-
body["experiment_id"] = self.experiment_id
|
|
5185
|
-
return body
|
|
5186
|
-
|
|
5187
|
-
def as_shallow_dict(self) -> dict:
|
|
5188
|
-
"""Serializes the RestoreExperiment into a shallow dictionary of its immediate attributes."""
|
|
5189
|
-
body = {}
|
|
5190
|
-
if self.experiment_id is not None:
|
|
5191
|
-
body["experiment_id"] = self.experiment_id
|
|
5192
|
-
return body
|
|
5193
|
-
|
|
5194
|
-
@classmethod
|
|
5195
|
-
def from_dict(cls, d: Dict[str, Any]) -> RestoreExperiment:
|
|
5196
|
-
"""Deserializes the RestoreExperiment from a dictionary."""
|
|
5197
|
-
return cls(experiment_id=d.get("experiment_id", None))
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
4010
|
@dataclass
|
|
5201
4011
|
class RestoreExperimentResponse:
|
|
5202
4012
|
def as_dict(self) -> dict:
|
|
@@ -5215,31 +4025,6 @@ class RestoreExperimentResponse:
|
|
|
5215
4025
|
return cls()
|
|
5216
4026
|
|
|
5217
4027
|
|
|
5218
|
-
@dataclass
|
|
5219
|
-
class RestoreRun:
|
|
5220
|
-
run_id: str
|
|
5221
|
-
"""ID of the run to restore."""
|
|
5222
|
-
|
|
5223
|
-
def as_dict(self) -> dict:
|
|
5224
|
-
"""Serializes the RestoreRun into a dictionary suitable for use as a JSON request body."""
|
|
5225
|
-
body = {}
|
|
5226
|
-
if self.run_id is not None:
|
|
5227
|
-
body["run_id"] = self.run_id
|
|
5228
|
-
return body
|
|
5229
|
-
|
|
5230
|
-
def as_shallow_dict(self) -> dict:
|
|
5231
|
-
"""Serializes the RestoreRun into a shallow dictionary of its immediate attributes."""
|
|
5232
|
-
body = {}
|
|
5233
|
-
if self.run_id is not None:
|
|
5234
|
-
body["run_id"] = self.run_id
|
|
5235
|
-
return body
|
|
5236
|
-
|
|
5237
|
-
@classmethod
|
|
5238
|
-
def from_dict(cls, d: Dict[str, Any]) -> RestoreRun:
|
|
5239
|
-
"""Deserializes the RestoreRun from a dictionary."""
|
|
5240
|
-
return cls(run_id=d.get("run_id", None))
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
4028
|
@dataclass
|
|
5244
4029
|
class RestoreRunResponse:
|
|
5245
4030
|
def as_dict(self) -> dict:
|
|
@@ -5258,51 +4043,6 @@ class RestoreRunResponse:
|
|
|
5258
4043
|
return cls()
|
|
5259
4044
|
|
|
5260
4045
|
|
|
5261
|
-
@dataclass
|
|
5262
|
-
class RestoreRuns:
|
|
5263
|
-
experiment_id: str
|
|
5264
|
-
"""The ID of the experiment containing the runs to restore."""
|
|
5265
|
-
|
|
5266
|
-
min_timestamp_millis: int
|
|
5267
|
-
"""The minimum deletion timestamp in milliseconds since the UNIX epoch for restoring runs. Only
|
|
5268
|
-
runs deleted no earlier than this timestamp are restored."""
|
|
5269
|
-
|
|
5270
|
-
max_runs: Optional[int] = None
|
|
5271
|
-
"""An optional positive integer indicating the maximum number of runs to restore. The maximum
|
|
5272
|
-
allowed value for max_runs is 10000."""
|
|
5273
|
-
|
|
5274
|
-
def as_dict(self) -> dict:
|
|
5275
|
-
"""Serializes the RestoreRuns into a dictionary suitable for use as a JSON request body."""
|
|
5276
|
-
body = {}
|
|
5277
|
-
if self.experiment_id is not None:
|
|
5278
|
-
body["experiment_id"] = self.experiment_id
|
|
5279
|
-
if self.max_runs is not None:
|
|
5280
|
-
body["max_runs"] = self.max_runs
|
|
5281
|
-
if self.min_timestamp_millis is not None:
|
|
5282
|
-
body["min_timestamp_millis"] = self.min_timestamp_millis
|
|
5283
|
-
return body
|
|
5284
|
-
|
|
5285
|
-
def as_shallow_dict(self) -> dict:
|
|
5286
|
-
"""Serializes the RestoreRuns into a shallow dictionary of its immediate attributes."""
|
|
5287
|
-
body = {}
|
|
5288
|
-
if self.experiment_id is not None:
|
|
5289
|
-
body["experiment_id"] = self.experiment_id
|
|
5290
|
-
if self.max_runs is not None:
|
|
5291
|
-
body["max_runs"] = self.max_runs
|
|
5292
|
-
if self.min_timestamp_millis is not None:
|
|
5293
|
-
body["min_timestamp_millis"] = self.min_timestamp_millis
|
|
5294
|
-
return body
|
|
5295
|
-
|
|
5296
|
-
@classmethod
|
|
5297
|
-
def from_dict(cls, d: Dict[str, Any]) -> RestoreRuns:
|
|
5298
|
-
"""Deserializes the RestoreRuns from a dictionary."""
|
|
5299
|
-
return cls(
|
|
5300
|
-
experiment_id=d.get("experiment_id", None),
|
|
5301
|
-
max_runs=d.get("max_runs", None),
|
|
5302
|
-
min_timestamp_millis=d.get("min_timestamp_millis", None),
|
|
5303
|
-
)
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
4046
|
@dataclass
|
|
5307
4047
|
class RestoreRunsResponse:
|
|
5308
4048
|
runs_restored: Optional[int] = None
|
|
@@ -5604,68 +4344,6 @@ class RunTag:
|
|
|
5604
4344
|
return cls(key=d.get("key", None), value=d.get("value", None))
|
|
5605
4345
|
|
|
5606
4346
|
|
|
5607
|
-
@dataclass
|
|
5608
|
-
class SearchExperiments:
|
|
5609
|
-
filter: Optional[str] = None
|
|
5610
|
-
"""String representing a SQL filter condition (e.g. "name ILIKE 'my-experiment%'")"""
|
|
5611
|
-
|
|
5612
|
-
max_results: Optional[int] = None
|
|
5613
|
-
"""Maximum number of experiments desired. Max threshold is 3000."""
|
|
5614
|
-
|
|
5615
|
-
order_by: Optional[List[str]] = None
|
|
5616
|
-
"""List of columns for ordering search results, which can include experiment name and last updated
|
|
5617
|
-
timestamp with an optional "DESC" or "ASC" annotation, where "ASC" is the default. Tiebreaks are
|
|
5618
|
-
done by experiment id DESC."""
|
|
5619
|
-
|
|
5620
|
-
page_token: Optional[str] = None
|
|
5621
|
-
"""Token indicating the page of experiments to fetch"""
|
|
5622
|
-
|
|
5623
|
-
view_type: Optional[ViewType] = None
|
|
5624
|
-
"""Qualifier for type of experiments to be returned. If unspecified, return only active
|
|
5625
|
-
experiments."""
|
|
5626
|
-
|
|
5627
|
-
def as_dict(self) -> dict:
|
|
5628
|
-
"""Serializes the SearchExperiments into a dictionary suitable for use as a JSON request body."""
|
|
5629
|
-
body = {}
|
|
5630
|
-
if self.filter is not None:
|
|
5631
|
-
body["filter"] = self.filter
|
|
5632
|
-
if self.max_results is not None:
|
|
5633
|
-
body["max_results"] = self.max_results
|
|
5634
|
-
if self.order_by:
|
|
5635
|
-
body["order_by"] = [v for v in self.order_by]
|
|
5636
|
-
if self.page_token is not None:
|
|
5637
|
-
body["page_token"] = self.page_token
|
|
5638
|
-
if self.view_type is not None:
|
|
5639
|
-
body["view_type"] = self.view_type.value
|
|
5640
|
-
return body
|
|
5641
|
-
|
|
5642
|
-
def as_shallow_dict(self) -> dict:
|
|
5643
|
-
"""Serializes the SearchExperiments into a shallow dictionary of its immediate attributes."""
|
|
5644
|
-
body = {}
|
|
5645
|
-
if self.filter is not None:
|
|
5646
|
-
body["filter"] = self.filter
|
|
5647
|
-
if self.max_results is not None:
|
|
5648
|
-
body["max_results"] = self.max_results
|
|
5649
|
-
if self.order_by:
|
|
5650
|
-
body["order_by"] = self.order_by
|
|
5651
|
-
if self.page_token is not None:
|
|
5652
|
-
body["page_token"] = self.page_token
|
|
5653
|
-
if self.view_type is not None:
|
|
5654
|
-
body["view_type"] = self.view_type
|
|
5655
|
-
return body
|
|
5656
|
-
|
|
5657
|
-
@classmethod
|
|
5658
|
-
def from_dict(cls, d: Dict[str, Any]) -> SearchExperiments:
|
|
5659
|
-
"""Deserializes the SearchExperiments from a dictionary."""
|
|
5660
|
-
return cls(
|
|
5661
|
-
filter=d.get("filter", None),
|
|
5662
|
-
max_results=d.get("max_results", None),
|
|
5663
|
-
order_by=d.get("order_by", None),
|
|
5664
|
-
page_token=d.get("page_token", None),
|
|
5665
|
-
view_type=_enum(d, "view_type", ViewType),
|
|
5666
|
-
)
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
4347
|
@dataclass
|
|
5670
4348
|
class SearchExperimentsResponse:
|
|
5671
4349
|
experiments: Optional[List[Experiment]] = None
|
|
@@ -5788,80 +4466,6 @@ class SearchLoggedModelsOrderBy:
|
|
|
5788
4466
|
)
|
|
5789
4467
|
|
|
5790
4468
|
|
|
5791
|
-
@dataclass
|
|
5792
|
-
class SearchLoggedModelsRequest:
|
|
5793
|
-
datasets: Optional[List[SearchLoggedModelsDataset]] = None
|
|
5794
|
-
"""List of datasets on which to apply the metrics filter clauses. For example, a filter with
|
|
5795
|
-
`metrics.accuracy > 0.9` and dataset info with name "test_dataset" means we will return all
|
|
5796
|
-
logged models with accuracy > 0.9 on the test_dataset. Metric values from ANY dataset matching
|
|
5797
|
-
the criteria are considered. If no datasets are specified, then metrics across all datasets are
|
|
5798
|
-
considered in the filter."""
|
|
5799
|
-
|
|
5800
|
-
experiment_ids: Optional[List[str]] = None
|
|
5801
|
-
"""The IDs of the experiments in which to search for logged models."""
|
|
5802
|
-
|
|
5803
|
-
filter: Optional[str] = None
|
|
5804
|
-
"""A filter expression over logged model info and data that allows returning a subset of logged
|
|
5805
|
-
models. The syntax is a subset of SQL that supports AND'ing together binary operations.
|
|
5806
|
-
|
|
5807
|
-
Example: ``params.alpha < 0.3 AND metrics.accuracy > 0.9``."""
|
|
5808
|
-
|
|
5809
|
-
max_results: Optional[int] = None
|
|
5810
|
-
"""The maximum number of Logged Models to return. The maximum limit is 50."""
|
|
5811
|
-
|
|
5812
|
-
order_by: Optional[List[SearchLoggedModelsOrderBy]] = None
|
|
5813
|
-
"""The list of columns for ordering the results, with additional fields for sorting criteria."""
|
|
5814
|
-
|
|
5815
|
-
page_token: Optional[str] = None
|
|
5816
|
-
"""The token indicating the page of logged models to fetch."""
|
|
5817
|
-
|
|
5818
|
-
def as_dict(self) -> dict:
|
|
5819
|
-
"""Serializes the SearchLoggedModelsRequest into a dictionary suitable for use as a JSON request body."""
|
|
5820
|
-
body = {}
|
|
5821
|
-
if self.datasets:
|
|
5822
|
-
body["datasets"] = [v.as_dict() for v in self.datasets]
|
|
5823
|
-
if self.experiment_ids:
|
|
5824
|
-
body["experiment_ids"] = [v for v in self.experiment_ids]
|
|
5825
|
-
if self.filter is not None:
|
|
5826
|
-
body["filter"] = self.filter
|
|
5827
|
-
if self.max_results is not None:
|
|
5828
|
-
body["max_results"] = self.max_results
|
|
5829
|
-
if self.order_by:
|
|
5830
|
-
body["order_by"] = [v.as_dict() for v in self.order_by]
|
|
5831
|
-
if self.page_token is not None:
|
|
5832
|
-
body["page_token"] = self.page_token
|
|
5833
|
-
return body
|
|
5834
|
-
|
|
5835
|
-
def as_shallow_dict(self) -> dict:
|
|
5836
|
-
"""Serializes the SearchLoggedModelsRequest into a shallow dictionary of its immediate attributes."""
|
|
5837
|
-
body = {}
|
|
5838
|
-
if self.datasets:
|
|
5839
|
-
body["datasets"] = self.datasets
|
|
5840
|
-
if self.experiment_ids:
|
|
5841
|
-
body["experiment_ids"] = self.experiment_ids
|
|
5842
|
-
if self.filter is not None:
|
|
5843
|
-
body["filter"] = self.filter
|
|
5844
|
-
if self.max_results is not None:
|
|
5845
|
-
body["max_results"] = self.max_results
|
|
5846
|
-
if self.order_by:
|
|
5847
|
-
body["order_by"] = self.order_by
|
|
5848
|
-
if self.page_token is not None:
|
|
5849
|
-
body["page_token"] = self.page_token
|
|
5850
|
-
return body
|
|
5851
|
-
|
|
5852
|
-
@classmethod
|
|
5853
|
-
def from_dict(cls, d: Dict[str, Any]) -> SearchLoggedModelsRequest:
|
|
5854
|
-
"""Deserializes the SearchLoggedModelsRequest from a dictionary."""
|
|
5855
|
-
return cls(
|
|
5856
|
-
datasets=_repeated_dict(d, "datasets", SearchLoggedModelsDataset),
|
|
5857
|
-
experiment_ids=d.get("experiment_ids", None),
|
|
5858
|
-
filter=d.get("filter", None),
|
|
5859
|
-
max_results=d.get("max_results", None),
|
|
5860
|
-
order_by=_repeated_dict(d, "order_by", SearchLoggedModelsOrderBy),
|
|
5861
|
-
page_token=d.get("page_token", None),
|
|
5862
|
-
)
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
4469
|
@dataclass
|
|
5866
4470
|
class SearchLoggedModelsResponse:
|
|
5867
4471
|
models: Optional[List[LoggedModel]] = None
|
|
@@ -5965,95 +4569,15 @@ class SearchModelsResponse:
|
|
|
5965
4569
|
|
|
5966
4570
|
|
|
5967
4571
|
@dataclass
|
|
5968
|
-
class
|
|
5969
|
-
|
|
5970
|
-
"""
|
|
5971
|
-
|
|
5972
|
-
filter: Optional[str] = None
|
|
5973
|
-
"""A filter expression over params, metrics, and tags, that allows returning a subset of runs. The
|
|
5974
|
-
syntax is a subset of SQL that supports ANDing together binary operations between a param,
|
|
5975
|
-
metric, or tag and a constant.
|
|
5976
|
-
|
|
5977
|
-
Example: `metrics.rmse < 1 and params.model_class = 'LogisticRegression'`
|
|
5978
|
-
|
|
5979
|
-
You can select columns with special characters (hyphen, space, period, etc.) by using double
|
|
5980
|
-
quotes: `metrics."model class" = 'LinearRegression' and tags."user-name" = 'Tomas'`
|
|
5981
|
-
|
|
5982
|
-
Supported operators are `=`, `!=`, `>`, `>=`, `<`, and `<=`."""
|
|
5983
|
-
|
|
5984
|
-
max_results: Optional[int] = None
|
|
5985
|
-
"""Maximum number of runs desired. Max threshold is 50000"""
|
|
5986
|
-
|
|
5987
|
-
order_by: Optional[List[str]] = None
|
|
5988
|
-
"""List of columns to be ordered by, including attributes, params, metrics, and tags with an
|
|
5989
|
-
optional `"DESC"` or `"ASC"` annotation, where `"ASC"` is the default. Example: `["params.input
|
|
5990
|
-
DESC", "metrics.alpha ASC", "metrics.rmse"]`. Tiebreaks are done by start_time `DESC` followed
|
|
5991
|
-
by `run_id` for runs with the same start time (and this is the default ordering criterion if
|
|
5992
|
-
order_by is not provided)."""
|
|
5993
|
-
|
|
5994
|
-
page_token: Optional[str] = None
|
|
5995
|
-
"""Token for the current page of runs."""
|
|
4572
|
+
class SearchRunsResponse:
|
|
4573
|
+
next_page_token: Optional[str] = None
|
|
4574
|
+
"""Token for the next page of runs."""
|
|
5996
4575
|
|
|
5997
|
-
|
|
5998
|
-
"""
|
|
4576
|
+
runs: Optional[List[Run]] = None
|
|
4577
|
+
"""Runs that match the search criteria."""
|
|
5999
4578
|
|
|
6000
4579
|
def as_dict(self) -> dict:
|
|
6001
|
-
"""Serializes the
|
|
6002
|
-
body = {}
|
|
6003
|
-
if self.experiment_ids:
|
|
6004
|
-
body["experiment_ids"] = [v for v in self.experiment_ids]
|
|
6005
|
-
if self.filter is not None:
|
|
6006
|
-
body["filter"] = self.filter
|
|
6007
|
-
if self.max_results is not None:
|
|
6008
|
-
body["max_results"] = self.max_results
|
|
6009
|
-
if self.order_by:
|
|
6010
|
-
body["order_by"] = [v for v in self.order_by]
|
|
6011
|
-
if self.page_token is not None:
|
|
6012
|
-
body["page_token"] = self.page_token
|
|
6013
|
-
if self.run_view_type is not None:
|
|
6014
|
-
body["run_view_type"] = self.run_view_type.value
|
|
6015
|
-
return body
|
|
6016
|
-
|
|
6017
|
-
def as_shallow_dict(self) -> dict:
|
|
6018
|
-
"""Serializes the SearchRuns into a shallow dictionary of its immediate attributes."""
|
|
6019
|
-
body = {}
|
|
6020
|
-
if self.experiment_ids:
|
|
6021
|
-
body["experiment_ids"] = self.experiment_ids
|
|
6022
|
-
if self.filter is not None:
|
|
6023
|
-
body["filter"] = self.filter
|
|
6024
|
-
if self.max_results is not None:
|
|
6025
|
-
body["max_results"] = self.max_results
|
|
6026
|
-
if self.order_by:
|
|
6027
|
-
body["order_by"] = self.order_by
|
|
6028
|
-
if self.page_token is not None:
|
|
6029
|
-
body["page_token"] = self.page_token
|
|
6030
|
-
if self.run_view_type is not None:
|
|
6031
|
-
body["run_view_type"] = self.run_view_type
|
|
6032
|
-
return body
|
|
6033
|
-
|
|
6034
|
-
@classmethod
|
|
6035
|
-
def from_dict(cls, d: Dict[str, Any]) -> SearchRuns:
|
|
6036
|
-
"""Deserializes the SearchRuns from a dictionary."""
|
|
6037
|
-
return cls(
|
|
6038
|
-
experiment_ids=d.get("experiment_ids", None),
|
|
6039
|
-
filter=d.get("filter", None),
|
|
6040
|
-
max_results=d.get("max_results", None),
|
|
6041
|
-
order_by=d.get("order_by", None),
|
|
6042
|
-
page_token=d.get("page_token", None),
|
|
6043
|
-
run_view_type=_enum(d, "run_view_type", ViewType),
|
|
6044
|
-
)
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
@dataclass
|
|
6048
|
-
class SearchRunsResponse:
|
|
6049
|
-
next_page_token: Optional[str] = None
|
|
6050
|
-
"""Token for the next page of runs."""
|
|
6051
|
-
|
|
6052
|
-
runs: Optional[List[Run]] = None
|
|
6053
|
-
"""Runs that match the search criteria."""
|
|
6054
|
-
|
|
6055
|
-
def as_dict(self) -> dict:
|
|
6056
|
-
"""Serializes the SearchRunsResponse into a dictionary suitable for use as a JSON request body."""
|
|
4580
|
+
"""Serializes the SearchRunsResponse into a dictionary suitable for use as a JSON request body."""
|
|
6057
4581
|
body = {}
|
|
6058
4582
|
if self.next_page_token is not None:
|
|
6059
4583
|
body["next_page_token"] = self.next_page_token
|
|
@@ -6076,45 +4600,6 @@ class SearchRunsResponse:
|
|
|
6076
4600
|
return cls(next_page_token=d.get("next_page_token", None), runs=_repeated_dict(d, "runs", Run))
|
|
6077
4601
|
|
|
6078
4602
|
|
|
6079
|
-
@dataclass
|
|
6080
|
-
class SetExperimentTag:
|
|
6081
|
-
experiment_id: str
|
|
6082
|
-
"""ID of the experiment under which to log the tag. Must be provided."""
|
|
6083
|
-
|
|
6084
|
-
key: str
|
|
6085
|
-
"""Name of the tag. Keys up to 250 bytes in size are supported."""
|
|
6086
|
-
|
|
6087
|
-
value: str
|
|
6088
|
-
"""String value of the tag being logged. Values up to 64KB in size are supported."""
|
|
6089
|
-
|
|
6090
|
-
def as_dict(self) -> dict:
|
|
6091
|
-
"""Serializes the SetExperimentTag into a dictionary suitable for use as a JSON request body."""
|
|
6092
|
-
body = {}
|
|
6093
|
-
if self.experiment_id is not None:
|
|
6094
|
-
body["experiment_id"] = self.experiment_id
|
|
6095
|
-
if self.key is not None:
|
|
6096
|
-
body["key"] = self.key
|
|
6097
|
-
if self.value is not None:
|
|
6098
|
-
body["value"] = self.value
|
|
6099
|
-
return body
|
|
6100
|
-
|
|
6101
|
-
def as_shallow_dict(self) -> dict:
|
|
6102
|
-
"""Serializes the SetExperimentTag into a shallow dictionary of its immediate attributes."""
|
|
6103
|
-
body = {}
|
|
6104
|
-
if self.experiment_id is not None:
|
|
6105
|
-
body["experiment_id"] = self.experiment_id
|
|
6106
|
-
if self.key is not None:
|
|
6107
|
-
body["key"] = self.key
|
|
6108
|
-
if self.value is not None:
|
|
6109
|
-
body["value"] = self.value
|
|
6110
|
-
return body
|
|
6111
|
-
|
|
6112
|
-
@classmethod
|
|
6113
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetExperimentTag:
|
|
6114
|
-
"""Deserializes the SetExperimentTag from a dictionary."""
|
|
6115
|
-
return cls(experiment_id=d.get("experiment_id", None), key=d.get("key", None), value=d.get("value", None))
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
4603
|
@dataclass
|
|
6119
4604
|
class SetExperimentTagResponse:
|
|
6120
4605
|
def as_dict(self) -> dict:
|
|
@@ -6133,38 +4618,6 @@ class SetExperimentTagResponse:
|
|
|
6133
4618
|
return cls()
|
|
6134
4619
|
|
|
6135
4620
|
|
|
6136
|
-
@dataclass
|
|
6137
|
-
class SetLoggedModelTagsRequest:
|
|
6138
|
-
model_id: Optional[str] = None
|
|
6139
|
-
"""The ID of the logged model to set the tags on."""
|
|
6140
|
-
|
|
6141
|
-
tags: Optional[List[LoggedModelTag]] = None
|
|
6142
|
-
"""The tags to set on the logged model."""
|
|
6143
|
-
|
|
6144
|
-
def as_dict(self) -> dict:
|
|
6145
|
-
"""Serializes the SetLoggedModelTagsRequest into a dictionary suitable for use as a JSON request body."""
|
|
6146
|
-
body = {}
|
|
6147
|
-
if self.model_id is not None:
|
|
6148
|
-
body["model_id"] = self.model_id
|
|
6149
|
-
if self.tags:
|
|
6150
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
6151
|
-
return body
|
|
6152
|
-
|
|
6153
|
-
def as_shallow_dict(self) -> dict:
|
|
6154
|
-
"""Serializes the SetLoggedModelTagsRequest into a shallow dictionary of its immediate attributes."""
|
|
6155
|
-
body = {}
|
|
6156
|
-
if self.model_id is not None:
|
|
6157
|
-
body["model_id"] = self.model_id
|
|
6158
|
-
if self.tags:
|
|
6159
|
-
body["tags"] = self.tags
|
|
6160
|
-
return body
|
|
6161
|
-
|
|
6162
|
-
@classmethod
|
|
6163
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetLoggedModelTagsRequest:
|
|
6164
|
-
"""Deserializes the SetLoggedModelTagsRequest from a dictionary."""
|
|
6165
|
-
return cls(model_id=d.get("model_id", None), tags=_repeated_dict(d, "tags", LoggedModelTag))
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
4621
|
@dataclass
|
|
6169
4622
|
class SetLoggedModelTagsResponse:
|
|
6170
4623
|
def as_dict(self) -> dict:
|
|
@@ -6183,48 +4636,6 @@ class SetLoggedModelTagsResponse:
|
|
|
6183
4636
|
return cls()
|
|
6184
4637
|
|
|
6185
4638
|
|
|
6186
|
-
@dataclass
|
|
6187
|
-
class SetModelTagRequest:
|
|
6188
|
-
name: str
|
|
6189
|
-
"""Unique name of the model."""
|
|
6190
|
-
|
|
6191
|
-
key: str
|
|
6192
|
-
"""Name of the tag. Maximum size depends on storage backend. If a tag with this name already
|
|
6193
|
-
exists, its preexisting value will be replaced by the specified `value`. All storage backends
|
|
6194
|
-
are guaranteed to support key values up to 250 bytes in size."""
|
|
6195
|
-
|
|
6196
|
-
value: str
|
|
6197
|
-
"""String value of the tag being logged. Maximum size depends on storage backend. All storage
|
|
6198
|
-
backends are guaranteed to support key values up to 5000 bytes in size."""
|
|
6199
|
-
|
|
6200
|
-
def as_dict(self) -> dict:
|
|
6201
|
-
"""Serializes the SetModelTagRequest into a dictionary suitable for use as a JSON request body."""
|
|
6202
|
-
body = {}
|
|
6203
|
-
if self.key is not None:
|
|
6204
|
-
body["key"] = self.key
|
|
6205
|
-
if self.name is not None:
|
|
6206
|
-
body["name"] = self.name
|
|
6207
|
-
if self.value is not None:
|
|
6208
|
-
body["value"] = self.value
|
|
6209
|
-
return body
|
|
6210
|
-
|
|
6211
|
-
def as_shallow_dict(self) -> dict:
|
|
6212
|
-
"""Serializes the SetModelTagRequest into a shallow dictionary of its immediate attributes."""
|
|
6213
|
-
body = {}
|
|
6214
|
-
if self.key is not None:
|
|
6215
|
-
body["key"] = self.key
|
|
6216
|
-
if self.name is not None:
|
|
6217
|
-
body["name"] = self.name
|
|
6218
|
-
if self.value is not None:
|
|
6219
|
-
body["value"] = self.value
|
|
6220
|
-
return body
|
|
6221
|
-
|
|
6222
|
-
@classmethod
|
|
6223
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetModelTagRequest:
|
|
6224
|
-
"""Deserializes the SetModelTagRequest from a dictionary."""
|
|
6225
|
-
return cls(key=d.get("key", None), name=d.get("name", None), value=d.get("value", None))
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
4639
|
@dataclass
|
|
6229
4640
|
class SetModelTagResponse:
|
|
6230
4641
|
def as_dict(self) -> dict:
|
|
@@ -6243,57 +4654,6 @@ class SetModelTagResponse:
|
|
|
6243
4654
|
return cls()
|
|
6244
4655
|
|
|
6245
4656
|
|
|
6246
|
-
@dataclass
|
|
6247
|
-
class SetModelVersionTagRequest:
|
|
6248
|
-
name: str
|
|
6249
|
-
"""Unique name of the model."""
|
|
6250
|
-
|
|
6251
|
-
version: str
|
|
6252
|
-
"""Model version number."""
|
|
6253
|
-
|
|
6254
|
-
key: str
|
|
6255
|
-
"""Name of the tag. Maximum size depends on storage backend. If a tag with this name already
|
|
6256
|
-
exists, its preexisting value will be replaced by the specified `value`. All storage backends
|
|
6257
|
-
are guaranteed to support key values up to 250 bytes in size."""
|
|
6258
|
-
|
|
6259
|
-
value: str
|
|
6260
|
-
"""String value of the tag being logged. Maximum size depends on storage backend. All storage
|
|
6261
|
-
backends are guaranteed to support key values up to 5000 bytes in size."""
|
|
6262
|
-
|
|
6263
|
-
def as_dict(self) -> dict:
|
|
6264
|
-
"""Serializes the SetModelVersionTagRequest into a dictionary suitable for use as a JSON request body."""
|
|
6265
|
-
body = {}
|
|
6266
|
-
if self.key is not None:
|
|
6267
|
-
body["key"] = self.key
|
|
6268
|
-
if self.name is not None:
|
|
6269
|
-
body["name"] = self.name
|
|
6270
|
-
if self.value is not None:
|
|
6271
|
-
body["value"] = self.value
|
|
6272
|
-
if self.version is not None:
|
|
6273
|
-
body["version"] = self.version
|
|
6274
|
-
return body
|
|
6275
|
-
|
|
6276
|
-
def as_shallow_dict(self) -> dict:
|
|
6277
|
-
"""Serializes the SetModelVersionTagRequest into a shallow dictionary of its immediate attributes."""
|
|
6278
|
-
body = {}
|
|
6279
|
-
if self.key is not None:
|
|
6280
|
-
body["key"] = self.key
|
|
6281
|
-
if self.name is not None:
|
|
6282
|
-
body["name"] = self.name
|
|
6283
|
-
if self.value is not None:
|
|
6284
|
-
body["value"] = self.value
|
|
6285
|
-
if self.version is not None:
|
|
6286
|
-
body["version"] = self.version
|
|
6287
|
-
return body
|
|
6288
|
-
|
|
6289
|
-
@classmethod
|
|
6290
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetModelVersionTagRequest:
|
|
6291
|
-
"""Deserializes the SetModelVersionTagRequest from a dictionary."""
|
|
6292
|
-
return cls(
|
|
6293
|
-
key=d.get("key", None), name=d.get("name", None), value=d.get("value", None), version=d.get("version", None)
|
|
6294
|
-
)
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
4657
|
@dataclass
|
|
6298
4658
|
class SetModelVersionTagResponse:
|
|
6299
4659
|
def as_dict(self) -> dict:
|
|
@@ -6312,58 +4672,6 @@ class SetModelVersionTagResponse:
|
|
|
6312
4672
|
return cls()
|
|
6313
4673
|
|
|
6314
4674
|
|
|
6315
|
-
@dataclass
|
|
6316
|
-
class SetTag:
|
|
6317
|
-
key: str
|
|
6318
|
-
"""Name of the tag. Keys up to 250 bytes in size are supported."""
|
|
6319
|
-
|
|
6320
|
-
value: str
|
|
6321
|
-
"""String value of the tag being logged. Values up to 64KB in size are supported."""
|
|
6322
|
-
|
|
6323
|
-
run_id: Optional[str] = None
|
|
6324
|
-
"""ID of the run under which to log the tag. Must be provided."""
|
|
6325
|
-
|
|
6326
|
-
run_uuid: Optional[str] = None
|
|
6327
|
-
"""[Deprecated, use `run_id` instead] ID of the run under which to log the tag. This field will be
|
|
6328
|
-
removed in a future MLflow version."""
|
|
6329
|
-
|
|
6330
|
-
def as_dict(self) -> dict:
|
|
6331
|
-
"""Serializes the SetTag into a dictionary suitable for use as a JSON request body."""
|
|
6332
|
-
body = {}
|
|
6333
|
-
if self.key is not None:
|
|
6334
|
-
body["key"] = self.key
|
|
6335
|
-
if self.run_id is not None:
|
|
6336
|
-
body["run_id"] = self.run_id
|
|
6337
|
-
if self.run_uuid is not None:
|
|
6338
|
-
body["run_uuid"] = self.run_uuid
|
|
6339
|
-
if self.value is not None:
|
|
6340
|
-
body["value"] = self.value
|
|
6341
|
-
return body
|
|
6342
|
-
|
|
6343
|
-
def as_shallow_dict(self) -> dict:
|
|
6344
|
-
"""Serializes the SetTag into a shallow dictionary of its immediate attributes."""
|
|
6345
|
-
body = {}
|
|
6346
|
-
if self.key is not None:
|
|
6347
|
-
body["key"] = self.key
|
|
6348
|
-
if self.run_id is not None:
|
|
6349
|
-
body["run_id"] = self.run_id
|
|
6350
|
-
if self.run_uuid is not None:
|
|
6351
|
-
body["run_uuid"] = self.run_uuid
|
|
6352
|
-
if self.value is not None:
|
|
6353
|
-
body["value"] = self.value
|
|
6354
|
-
return body
|
|
6355
|
-
|
|
6356
|
-
@classmethod
|
|
6357
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetTag:
|
|
6358
|
-
"""Deserializes the SetTag from a dictionary."""
|
|
6359
|
-
return cls(
|
|
6360
|
-
key=d.get("key", None),
|
|
6361
|
-
run_id=d.get("run_id", None),
|
|
6362
|
-
run_uuid=d.get("run_uuid", None),
|
|
6363
|
-
value=d.get("value", None),
|
|
6364
|
-
)
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
4675
|
@dataclass
|
|
6368
4676
|
class SetTagResponse:
|
|
6369
4677
|
def as_dict(self) -> dict:
|
|
@@ -6382,23 +4690,6 @@ class SetTagResponse:
|
|
|
6382
4690
|
return cls()
|
|
6383
4691
|
|
|
6384
4692
|
|
|
6385
|
-
class Stage(Enum):
|
|
6386
|
-
"""Stage of the model version. Valid values are:
|
|
6387
|
-
|
|
6388
|
-
* `None`: The initial stage of a model version.
|
|
6389
|
-
|
|
6390
|
-
* `Staging`: Staging or pre-production stage.
|
|
6391
|
-
|
|
6392
|
-
* `Production`: Production stage.
|
|
6393
|
-
|
|
6394
|
-
* `Archived`: Archived stage."""
|
|
6395
|
-
|
|
6396
|
-
ARCHIVED = "Archived"
|
|
6397
|
-
NONE = "None"
|
|
6398
|
-
PRODUCTION = "Production"
|
|
6399
|
-
STAGING = "Staging"
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
4693
|
class Status(Enum):
|
|
6403
4694
|
"""The status of the model version. Valid values are: * `PENDING_REGISTRATION`: Request to register
|
|
6404
4695
|
a new model version is pending as server performs background tasks.
|
|
@@ -6413,9 +4704,7 @@ class Status(Enum):
|
|
|
6413
4704
|
|
|
6414
4705
|
|
|
6415
4706
|
@dataclass
|
|
6416
|
-
class
|
|
6417
|
-
"""Test webhook response object."""
|
|
6418
|
-
|
|
4707
|
+
class TestRegistryWebhookResponse:
|
|
6419
4708
|
body: Optional[str] = None
|
|
6420
4709
|
"""Body of the response from the webhook URL"""
|
|
6421
4710
|
|
|
@@ -6423,7 +4712,7 @@ class TestRegistryWebhook:
|
|
|
6423
4712
|
"""Status code returned by the webhook URL"""
|
|
6424
4713
|
|
|
6425
4714
|
def as_dict(self) -> dict:
|
|
6426
|
-
"""Serializes the
|
|
4715
|
+
"""Serializes the TestRegistryWebhookResponse into a dictionary suitable for use as a JSON request body."""
|
|
6427
4716
|
body = {}
|
|
6428
4717
|
if self.body is not None:
|
|
6429
4718
|
body["body"] = self.body
|
|
@@ -6432,7 +4721,7 @@ class TestRegistryWebhook:
|
|
|
6432
4721
|
return body
|
|
6433
4722
|
|
|
6434
4723
|
def as_shallow_dict(self) -> dict:
|
|
6435
|
-
"""Serializes the
|
|
4724
|
+
"""Serializes the TestRegistryWebhookResponse into a shallow dictionary of its immediate attributes."""
|
|
6436
4725
|
body = {}
|
|
6437
4726
|
if self.body is not None:
|
|
6438
4727
|
body["body"] = self.body
|
|
@@ -6440,151 +4729,27 @@ class TestRegistryWebhook:
|
|
|
6440
4729
|
body["status_code"] = self.status_code
|
|
6441
4730
|
return body
|
|
6442
4731
|
|
|
6443
|
-
@classmethod
|
|
6444
|
-
def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhook:
|
|
6445
|
-
"""Deserializes the TestRegistryWebhook from a dictionary."""
|
|
6446
|
-
return cls(body=d.get("body", None), status_code=d.get("status_code", None))
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
@dataclass
|
|
6450
|
-
class TestRegistryWebhookRequest:
|
|
6451
|
-
id: str
|
|
6452
|
-
"""Webhook ID"""
|
|
6453
|
-
|
|
6454
|
-
event: Optional[RegistryWebhookEvent] = None
|
|
6455
|
-
"""If `event` is specified, the test trigger uses the specified event. If `event` is not specified,
|
|
6456
|
-
the test trigger uses a randomly chosen event associated with the webhook."""
|
|
6457
|
-
|
|
6458
|
-
def as_dict(self) -> dict:
|
|
6459
|
-
"""Serializes the TestRegistryWebhookRequest into a dictionary suitable for use as a JSON request body."""
|
|
6460
|
-
body = {}
|
|
6461
|
-
if self.event is not None:
|
|
6462
|
-
body["event"] = self.event.value
|
|
6463
|
-
if self.id is not None:
|
|
6464
|
-
body["id"] = self.id
|
|
6465
|
-
return body
|
|
6466
|
-
|
|
6467
|
-
def as_shallow_dict(self) -> dict:
|
|
6468
|
-
"""Serializes the TestRegistryWebhookRequest into a shallow dictionary of its immediate attributes."""
|
|
6469
|
-
body = {}
|
|
6470
|
-
if self.event is not None:
|
|
6471
|
-
body["event"] = self.event
|
|
6472
|
-
if self.id is not None:
|
|
6473
|
-
body["id"] = self.id
|
|
6474
|
-
return body
|
|
6475
|
-
|
|
6476
|
-
@classmethod
|
|
6477
|
-
def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookRequest:
|
|
6478
|
-
"""Deserializes the TestRegistryWebhookRequest from a dictionary."""
|
|
6479
|
-
return cls(event=_enum(d, "event", RegistryWebhookEvent), id=d.get("id", None))
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
@dataclass
|
|
6483
|
-
class TestRegistryWebhookResponse:
|
|
6484
|
-
webhook: Optional[TestRegistryWebhook] = None
|
|
6485
|
-
"""Test webhook response object."""
|
|
6486
|
-
|
|
6487
|
-
def as_dict(self) -> dict:
|
|
6488
|
-
"""Serializes the TestRegistryWebhookResponse into a dictionary suitable for use as a JSON request body."""
|
|
6489
|
-
body = {}
|
|
6490
|
-
if self.webhook:
|
|
6491
|
-
body["webhook"] = self.webhook.as_dict()
|
|
6492
|
-
return body
|
|
6493
|
-
|
|
6494
|
-
def as_shallow_dict(self) -> dict:
|
|
6495
|
-
"""Serializes the TestRegistryWebhookResponse into a shallow dictionary of its immediate attributes."""
|
|
6496
|
-
body = {}
|
|
6497
|
-
if self.webhook:
|
|
6498
|
-
body["webhook"] = self.webhook
|
|
6499
|
-
return body
|
|
6500
|
-
|
|
6501
4732
|
@classmethod
|
|
6502
4733
|
def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookResponse:
|
|
6503
4734
|
"""Deserializes the TestRegistryWebhookResponse from a dictionary."""
|
|
6504
|
-
return cls(
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
@dataclass
|
|
6508
|
-
class TransitionModelVersionStageDatabricks:
|
|
6509
|
-
name: str
|
|
6510
|
-
"""Name of the model."""
|
|
6511
|
-
|
|
6512
|
-
version: str
|
|
6513
|
-
"""Version of the model."""
|
|
6514
|
-
|
|
6515
|
-
stage: Stage
|
|
6516
|
-
"""Target stage of the transition. Valid values are:
|
|
6517
|
-
|
|
6518
|
-
* `None`: The initial stage of a model version.
|
|
6519
|
-
|
|
6520
|
-
* `Staging`: Staging or pre-production stage.
|
|
6521
|
-
|
|
6522
|
-
* `Production`: Production stage.
|
|
6523
|
-
|
|
6524
|
-
* `Archived`: Archived stage."""
|
|
6525
|
-
|
|
6526
|
-
archive_existing_versions: bool
|
|
6527
|
-
"""Specifies whether to archive all current model versions in the target stage."""
|
|
6528
|
-
|
|
6529
|
-
comment: Optional[str] = None
|
|
6530
|
-
"""User-provided comment on the action."""
|
|
6531
|
-
|
|
6532
|
-
def as_dict(self) -> dict:
|
|
6533
|
-
"""Serializes the TransitionModelVersionStageDatabricks into a dictionary suitable for use as a JSON request body."""
|
|
6534
|
-
body = {}
|
|
6535
|
-
if self.archive_existing_versions is not None:
|
|
6536
|
-
body["archive_existing_versions"] = self.archive_existing_versions
|
|
6537
|
-
if self.comment is not None:
|
|
6538
|
-
body["comment"] = self.comment
|
|
6539
|
-
if self.name is not None:
|
|
6540
|
-
body["name"] = self.name
|
|
6541
|
-
if self.stage is not None:
|
|
6542
|
-
body["stage"] = self.stage.value
|
|
6543
|
-
if self.version is not None:
|
|
6544
|
-
body["version"] = self.version
|
|
6545
|
-
return body
|
|
6546
|
-
|
|
6547
|
-
def as_shallow_dict(self) -> dict:
|
|
6548
|
-
"""Serializes the TransitionModelVersionStageDatabricks into a shallow dictionary of its immediate attributes."""
|
|
6549
|
-
body = {}
|
|
6550
|
-
if self.archive_existing_versions is not None:
|
|
6551
|
-
body["archive_existing_versions"] = self.archive_existing_versions
|
|
6552
|
-
if self.comment is not None:
|
|
6553
|
-
body["comment"] = self.comment
|
|
6554
|
-
if self.name is not None:
|
|
6555
|
-
body["name"] = self.name
|
|
6556
|
-
if self.stage is not None:
|
|
6557
|
-
body["stage"] = self.stage
|
|
6558
|
-
if self.version is not None:
|
|
6559
|
-
body["version"] = self.version
|
|
6560
|
-
return body
|
|
6561
|
-
|
|
6562
|
-
@classmethod
|
|
6563
|
-
def from_dict(cls, d: Dict[str, Any]) -> TransitionModelVersionStageDatabricks:
|
|
6564
|
-
"""Deserializes the TransitionModelVersionStageDatabricks from a dictionary."""
|
|
6565
|
-
return cls(
|
|
6566
|
-
archive_existing_versions=d.get("archive_existing_versions", None),
|
|
6567
|
-
comment=d.get("comment", None),
|
|
6568
|
-
name=d.get("name", None),
|
|
6569
|
-
stage=_enum(d, "stage", Stage),
|
|
6570
|
-
version=d.get("version", None),
|
|
6571
|
-
)
|
|
4735
|
+
return cls(body=d.get("body", None), status_code=d.get("status_code", None))
|
|
6572
4736
|
|
|
6573
4737
|
|
|
6574
4738
|
@dataclass
|
|
6575
4739
|
class TransitionRequest:
|
|
6576
|
-
"""
|
|
4740
|
+
"""For activities, this contains the activity recorded for the action. For comments, this contains
|
|
4741
|
+
the comment details. For transition requests, this contains the transition request details."""
|
|
6577
4742
|
|
|
6578
4743
|
available_actions: Optional[List[ActivityAction]] = None
|
|
6579
4744
|
"""Array of actions on the activity allowed for the current viewer."""
|
|
6580
4745
|
|
|
6581
4746
|
comment: Optional[str] = None
|
|
6582
|
-
"""User-provided comment associated with the transition request."""
|
|
4747
|
+
"""User-provided comment associated with the activity, comment, or transition request."""
|
|
6583
4748
|
|
|
6584
4749
|
creation_timestamp: Optional[int] = None
|
|
6585
4750
|
"""Creation time of the object, as a Unix timestamp in milliseconds."""
|
|
6586
4751
|
|
|
6587
|
-
to_stage: Optional[
|
|
4752
|
+
to_stage: Optional[str] = None
|
|
6588
4753
|
"""Target stage of the transition (if the activity is stage transition related). Valid values are:
|
|
6589
4754
|
|
|
6590
4755
|
* `None`: The initial stage of a model version.
|
|
@@ -6608,7 +4773,7 @@ class TransitionRequest:
|
|
|
6608
4773
|
if self.creation_timestamp is not None:
|
|
6609
4774
|
body["creation_timestamp"] = self.creation_timestamp
|
|
6610
4775
|
if self.to_stage is not None:
|
|
6611
|
-
body["to_stage"] = self.to_stage
|
|
4776
|
+
body["to_stage"] = self.to_stage
|
|
6612
4777
|
if self.user_id is not None:
|
|
6613
4778
|
body["user_id"] = self.user_id
|
|
6614
4779
|
return body
|
|
@@ -6635,71 +4800,40 @@ class TransitionRequest:
|
|
|
6635
4800
|
available_actions=_repeated_enum(d, "available_actions", ActivityAction),
|
|
6636
4801
|
comment=d.get("comment", None),
|
|
6637
4802
|
creation_timestamp=d.get("creation_timestamp", None),
|
|
6638
|
-
to_stage=
|
|
4803
|
+
to_stage=d.get("to_stage", None),
|
|
6639
4804
|
user_id=d.get("user_id", None),
|
|
6640
4805
|
)
|
|
6641
4806
|
|
|
6642
4807
|
|
|
6643
4808
|
@dataclass
|
|
6644
4809
|
class TransitionStageResponse:
|
|
6645
|
-
|
|
4810
|
+
model_version_databricks: Optional[ModelVersionDatabricks] = None
|
|
4811
|
+
"""Updated model version"""
|
|
6646
4812
|
|
|
6647
4813
|
def as_dict(self) -> dict:
|
|
6648
4814
|
"""Serializes the TransitionStageResponse into a dictionary suitable for use as a JSON request body."""
|
|
6649
4815
|
body = {}
|
|
6650
|
-
if self.
|
|
6651
|
-
body["
|
|
4816
|
+
if self.model_version_databricks:
|
|
4817
|
+
body["model_version_databricks"] = self.model_version_databricks.as_dict()
|
|
6652
4818
|
return body
|
|
6653
4819
|
|
|
6654
4820
|
def as_shallow_dict(self) -> dict:
|
|
6655
4821
|
"""Serializes the TransitionStageResponse into a shallow dictionary of its immediate attributes."""
|
|
6656
4822
|
body = {}
|
|
6657
|
-
if self.
|
|
6658
|
-
body["
|
|
4823
|
+
if self.model_version_databricks:
|
|
4824
|
+
body["model_version_databricks"] = self.model_version_databricks
|
|
6659
4825
|
return body
|
|
6660
4826
|
|
|
6661
4827
|
@classmethod
|
|
6662
4828
|
def from_dict(cls, d: Dict[str, Any]) -> TransitionStageResponse:
|
|
6663
4829
|
"""Deserializes the TransitionStageResponse from a dictionary."""
|
|
6664
|
-
return cls(
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
@dataclass
|
|
6668
|
-
class UpdateComment:
|
|
6669
|
-
id: str
|
|
6670
|
-
"""Unique identifier of an activity"""
|
|
6671
|
-
|
|
6672
|
-
comment: str
|
|
6673
|
-
"""User-provided comment on the action."""
|
|
6674
|
-
|
|
6675
|
-
def as_dict(self) -> dict:
|
|
6676
|
-
"""Serializes the UpdateComment into a dictionary suitable for use as a JSON request body."""
|
|
6677
|
-
body = {}
|
|
6678
|
-
if self.comment is not None:
|
|
6679
|
-
body["comment"] = self.comment
|
|
6680
|
-
if self.id is not None:
|
|
6681
|
-
body["id"] = self.id
|
|
6682
|
-
return body
|
|
6683
|
-
|
|
6684
|
-
def as_shallow_dict(self) -> dict:
|
|
6685
|
-
"""Serializes the UpdateComment into a shallow dictionary of its immediate attributes."""
|
|
6686
|
-
body = {}
|
|
6687
|
-
if self.comment is not None:
|
|
6688
|
-
body["comment"] = self.comment
|
|
6689
|
-
if self.id is not None:
|
|
6690
|
-
body["id"] = self.id
|
|
6691
|
-
return body
|
|
6692
|
-
|
|
6693
|
-
@classmethod
|
|
6694
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateComment:
|
|
6695
|
-
"""Deserializes the UpdateComment from a dictionary."""
|
|
6696
|
-
return cls(comment=d.get("comment", None), id=d.get("id", None))
|
|
4830
|
+
return cls(model_version_databricks=_from_dict(d, "model_version_databricks", ModelVersionDatabricks))
|
|
6697
4831
|
|
|
6698
4832
|
|
|
6699
4833
|
@dataclass
|
|
6700
4834
|
class UpdateCommentResponse:
|
|
6701
4835
|
comment: Optional[CommentObject] = None
|
|
6702
|
-
"""
|
|
4836
|
+
"""Updated comment object"""
|
|
6703
4837
|
|
|
6704
4838
|
def as_dict(self) -> dict:
|
|
6705
4839
|
"""Serializes the UpdateCommentResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -6721,319 +4855,71 @@ class UpdateCommentResponse:
|
|
|
6721
4855
|
return cls(comment=_from_dict(d, "comment", CommentObject))
|
|
6722
4856
|
|
|
6723
4857
|
|
|
6724
|
-
@dataclass
|
|
6725
|
-
class
|
|
6726
|
-
experiment_id: str
|
|
6727
|
-
"""ID of the associated experiment."""
|
|
6728
|
-
|
|
6729
|
-
new_name: Optional[str] = None
|
|
6730
|
-
"""If provided, the experiment's name is changed to the new name. The new name must be unique."""
|
|
6731
|
-
|
|
6732
|
-
def as_dict(self) -> dict:
|
|
6733
|
-
"""Serializes the UpdateExperiment into a dictionary suitable for use as a JSON request body."""
|
|
6734
|
-
body = {}
|
|
6735
|
-
if self.experiment_id is not None:
|
|
6736
|
-
body["experiment_id"] = self.experiment_id
|
|
6737
|
-
if self.new_name is not None:
|
|
6738
|
-
body["new_name"] = self.new_name
|
|
6739
|
-
return body
|
|
6740
|
-
|
|
6741
|
-
def as_shallow_dict(self) -> dict:
|
|
6742
|
-
"""Serializes the UpdateExperiment into a shallow dictionary of its immediate attributes."""
|
|
6743
|
-
body = {}
|
|
6744
|
-
if self.experiment_id is not None:
|
|
6745
|
-
body["experiment_id"] = self.experiment_id
|
|
6746
|
-
if self.new_name is not None:
|
|
6747
|
-
body["new_name"] = self.new_name
|
|
6748
|
-
return body
|
|
6749
|
-
|
|
6750
|
-
@classmethod
|
|
6751
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateExperiment:
|
|
6752
|
-
"""Deserializes the UpdateExperiment from a dictionary."""
|
|
6753
|
-
return cls(experiment_id=d.get("experiment_id", None), new_name=d.get("new_name", None))
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
@dataclass
|
|
6757
|
-
class UpdateExperimentResponse:
|
|
6758
|
-
def as_dict(self) -> dict:
|
|
6759
|
-
"""Serializes the UpdateExperimentResponse into a dictionary suitable for use as a JSON request body."""
|
|
6760
|
-
body = {}
|
|
6761
|
-
return body
|
|
6762
|
-
|
|
6763
|
-
def as_shallow_dict(self) -> dict:
|
|
6764
|
-
"""Serializes the UpdateExperimentResponse into a shallow dictionary of its immediate attributes."""
|
|
6765
|
-
body = {}
|
|
6766
|
-
return body
|
|
6767
|
-
|
|
6768
|
-
@classmethod
|
|
6769
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateExperimentResponse:
|
|
6770
|
-
"""Deserializes the UpdateExperimentResponse from a dictionary."""
|
|
6771
|
-
return cls()
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
@dataclass
|
|
6775
|
-
class UpdateModelRequest:
|
|
6776
|
-
name: str
|
|
6777
|
-
"""Registered model unique name identifier."""
|
|
6778
|
-
|
|
6779
|
-
description: Optional[str] = None
|
|
6780
|
-
"""If provided, updates the description for this `registered_model`."""
|
|
6781
|
-
|
|
6782
|
-
def as_dict(self) -> dict:
|
|
6783
|
-
"""Serializes the UpdateModelRequest into a dictionary suitable for use as a JSON request body."""
|
|
6784
|
-
body = {}
|
|
6785
|
-
if self.description is not None:
|
|
6786
|
-
body["description"] = self.description
|
|
6787
|
-
if self.name is not None:
|
|
6788
|
-
body["name"] = self.name
|
|
6789
|
-
return body
|
|
6790
|
-
|
|
6791
|
-
def as_shallow_dict(self) -> dict:
|
|
6792
|
-
"""Serializes the UpdateModelRequest into a shallow dictionary of its immediate attributes."""
|
|
6793
|
-
body = {}
|
|
6794
|
-
if self.description is not None:
|
|
6795
|
-
body["description"] = self.description
|
|
6796
|
-
if self.name is not None:
|
|
6797
|
-
body["name"] = self.name
|
|
6798
|
-
return body
|
|
6799
|
-
|
|
6800
|
-
@classmethod
|
|
6801
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelRequest:
|
|
6802
|
-
"""Deserializes the UpdateModelRequest from a dictionary."""
|
|
6803
|
-
return cls(description=d.get("description", None), name=d.get("name", None))
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
@dataclass
|
|
6807
|
-
class UpdateModelResponse:
|
|
6808
|
-
def as_dict(self) -> dict:
|
|
6809
|
-
"""Serializes the UpdateModelResponse into a dictionary suitable for use as a JSON request body."""
|
|
6810
|
-
body = {}
|
|
6811
|
-
return body
|
|
6812
|
-
|
|
6813
|
-
def as_shallow_dict(self) -> dict:
|
|
6814
|
-
"""Serializes the UpdateModelResponse into a shallow dictionary of its immediate attributes."""
|
|
6815
|
-
body = {}
|
|
6816
|
-
return body
|
|
6817
|
-
|
|
6818
|
-
@classmethod
|
|
6819
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelResponse:
|
|
6820
|
-
"""Deserializes the UpdateModelResponse from a dictionary."""
|
|
6821
|
-
return cls()
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
@dataclass
|
|
6825
|
-
class UpdateModelVersionRequest:
|
|
6826
|
-
name: str
|
|
6827
|
-
"""Name of the registered model"""
|
|
6828
|
-
|
|
6829
|
-
version: str
|
|
6830
|
-
"""Model version number"""
|
|
6831
|
-
|
|
6832
|
-
description: Optional[str] = None
|
|
6833
|
-
"""If provided, updates the description for this `registered_model`."""
|
|
6834
|
-
|
|
6835
|
-
def as_dict(self) -> dict:
|
|
6836
|
-
"""Serializes the UpdateModelVersionRequest into a dictionary suitable for use as a JSON request body."""
|
|
6837
|
-
body = {}
|
|
6838
|
-
if self.description is not None:
|
|
6839
|
-
body["description"] = self.description
|
|
6840
|
-
if self.name is not None:
|
|
6841
|
-
body["name"] = self.name
|
|
6842
|
-
if self.version is not None:
|
|
6843
|
-
body["version"] = self.version
|
|
6844
|
-
return body
|
|
6845
|
-
|
|
6846
|
-
def as_shallow_dict(self) -> dict:
|
|
6847
|
-
"""Serializes the UpdateModelVersionRequest into a shallow dictionary of its immediate attributes."""
|
|
6848
|
-
body = {}
|
|
6849
|
-
if self.description is not None:
|
|
6850
|
-
body["description"] = self.description
|
|
6851
|
-
if self.name is not None:
|
|
6852
|
-
body["name"] = self.name
|
|
6853
|
-
if self.version is not None:
|
|
6854
|
-
body["version"] = self.version
|
|
6855
|
-
return body
|
|
6856
|
-
|
|
6857
|
-
@classmethod
|
|
6858
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelVersionRequest:
|
|
6859
|
-
"""Deserializes the UpdateModelVersionRequest from a dictionary."""
|
|
6860
|
-
return cls(description=d.get("description", None), name=d.get("name", None), version=d.get("version", None))
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
@dataclass
|
|
6864
|
-
class UpdateModelVersionResponse:
|
|
6865
|
-
def as_dict(self) -> dict:
|
|
6866
|
-
"""Serializes the UpdateModelVersionResponse into a dictionary suitable for use as a JSON request body."""
|
|
6867
|
-
body = {}
|
|
6868
|
-
return body
|
|
6869
|
-
|
|
6870
|
-
def as_shallow_dict(self) -> dict:
|
|
6871
|
-
"""Serializes the UpdateModelVersionResponse into a shallow dictionary of its immediate attributes."""
|
|
6872
|
-
body = {}
|
|
6873
|
-
return body
|
|
6874
|
-
|
|
6875
|
-
@classmethod
|
|
6876
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelVersionResponse:
|
|
6877
|
-
"""Deserializes the UpdateModelVersionResponse from a dictionary."""
|
|
6878
|
-
return cls()
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
@dataclass
|
|
6882
|
-
class UpdateRegistryWebhook:
|
|
6883
|
-
id: str
|
|
6884
|
-
"""Webhook ID"""
|
|
6885
|
-
|
|
6886
|
-
description: Optional[str] = None
|
|
6887
|
-
"""User-specified description for the webhook."""
|
|
6888
|
-
|
|
6889
|
-
events: Optional[List[RegistryWebhookEvent]] = None
|
|
6890
|
-
"""Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A new model version was
|
|
6891
|
-
created for the associated model.
|
|
6892
|
-
|
|
6893
|
-
* `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was changed.
|
|
6894
|
-
|
|
6895
|
-
* `TRANSITION_REQUEST_CREATED`: A user requested a model version’s stage be transitioned.
|
|
6896
|
-
|
|
6897
|
-
* `COMMENT_CREATED`: A user wrote a comment on a registered model.
|
|
6898
|
-
|
|
6899
|
-
* `REGISTERED_MODEL_CREATED`: A new registered model was created. This event type can only be
|
|
6900
|
-
specified for a registry-wide webhook, which can be created by not specifying a model name in
|
|
6901
|
-
the create request.
|
|
6902
|
-
|
|
6903
|
-
* `MODEL_VERSION_TAG_SET`: A user set a tag on the model version.
|
|
6904
|
-
|
|
6905
|
-
* `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was transitioned to staging.
|
|
6906
|
-
|
|
6907
|
-
* `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was transitioned to production.
|
|
6908
|
-
|
|
6909
|
-
* `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived.
|
|
6910
|
-
|
|
6911
|
-
* `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model version be transitioned to
|
|
6912
|
-
staging.
|
|
6913
|
-
|
|
6914
|
-
* `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model version be transitioned
|
|
6915
|
-
to production.
|
|
6916
|
-
|
|
6917
|
-
* `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model version be archived."""
|
|
6918
|
-
|
|
6919
|
-
http_url_spec: Optional[HttpUrlSpec] = None
|
|
6920
|
-
|
|
6921
|
-
job_spec: Optional[JobSpec] = None
|
|
6922
|
-
|
|
6923
|
-
status: Optional[RegistryWebhookStatus] = None
|
|
6924
|
-
"""Enable or disable triggering the webhook, or put the webhook into test mode. The default is
|
|
6925
|
-
`ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.
|
|
6926
|
-
|
|
6927
|
-
* `DISABLED`: Webhook is not triggered.
|
|
6928
|
-
|
|
6929
|
-
* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a
|
|
6930
|
-
real event."""
|
|
6931
|
-
|
|
4858
|
+
@dataclass
|
|
4859
|
+
class UpdateExperimentResponse:
|
|
6932
4860
|
def as_dict(self) -> dict:
|
|
6933
|
-
"""Serializes the
|
|
4861
|
+
"""Serializes the UpdateExperimentResponse into a dictionary suitable for use as a JSON request body."""
|
|
6934
4862
|
body = {}
|
|
6935
|
-
if self.description is not None:
|
|
6936
|
-
body["description"] = self.description
|
|
6937
|
-
if self.events:
|
|
6938
|
-
body["events"] = [v.value for v in self.events]
|
|
6939
|
-
if self.http_url_spec:
|
|
6940
|
-
body["http_url_spec"] = self.http_url_spec.as_dict()
|
|
6941
|
-
if self.id is not None:
|
|
6942
|
-
body["id"] = self.id
|
|
6943
|
-
if self.job_spec:
|
|
6944
|
-
body["job_spec"] = self.job_spec.as_dict()
|
|
6945
|
-
if self.status is not None:
|
|
6946
|
-
body["status"] = self.status.value
|
|
6947
4863
|
return body
|
|
6948
4864
|
|
|
6949
4865
|
def as_shallow_dict(self) -> dict:
|
|
6950
|
-
"""Serializes the
|
|
4866
|
+
"""Serializes the UpdateExperimentResponse into a shallow dictionary of its immediate attributes."""
|
|
6951
4867
|
body = {}
|
|
6952
|
-
if self.description is not None:
|
|
6953
|
-
body["description"] = self.description
|
|
6954
|
-
if self.events:
|
|
6955
|
-
body["events"] = self.events
|
|
6956
|
-
if self.http_url_spec:
|
|
6957
|
-
body["http_url_spec"] = self.http_url_spec
|
|
6958
|
-
if self.id is not None:
|
|
6959
|
-
body["id"] = self.id
|
|
6960
|
-
if self.job_spec:
|
|
6961
|
-
body["job_spec"] = self.job_spec
|
|
6962
|
-
if self.status is not None:
|
|
6963
|
-
body["status"] = self.status
|
|
6964
4868
|
return body
|
|
6965
4869
|
|
|
6966
4870
|
@classmethod
|
|
6967
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
6968
|
-
"""Deserializes the
|
|
6969
|
-
return cls(
|
|
6970
|
-
description=d.get("description", None),
|
|
6971
|
-
events=_repeated_enum(d, "events", RegistryWebhookEvent),
|
|
6972
|
-
http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpec),
|
|
6973
|
-
id=d.get("id", None),
|
|
6974
|
-
job_spec=_from_dict(d, "job_spec", JobSpec),
|
|
6975
|
-
status=_enum(d, "status", RegistryWebhookStatus),
|
|
6976
|
-
)
|
|
4871
|
+
def from_dict(cls, d: Dict[str, Any]) -> UpdateExperimentResponse:
|
|
4872
|
+
"""Deserializes the UpdateExperimentResponse from a dictionary."""
|
|
4873
|
+
return cls()
|
|
6977
4874
|
|
|
6978
4875
|
|
|
6979
4876
|
@dataclass
|
|
6980
|
-
class
|
|
6981
|
-
|
|
6982
|
-
"""Unix timestamp in milliseconds of when the run ended."""
|
|
4877
|
+
class UpdateModelResponse:
|
|
4878
|
+
registered_model: Optional[Model] = None
|
|
6983
4879
|
|
|
6984
|
-
|
|
6985
|
-
|
|
4880
|
+
def as_dict(self) -> dict:
|
|
4881
|
+
"""Serializes the UpdateModelResponse into a dictionary suitable for use as a JSON request body."""
|
|
4882
|
+
body = {}
|
|
4883
|
+
if self.registered_model:
|
|
4884
|
+
body["registered_model"] = self.registered_model.as_dict()
|
|
4885
|
+
return body
|
|
6986
4886
|
|
|
6987
|
-
|
|
6988
|
-
|
|
4887
|
+
def as_shallow_dict(self) -> dict:
|
|
4888
|
+
"""Serializes the UpdateModelResponse into a shallow dictionary of its immediate attributes."""
|
|
4889
|
+
body = {}
|
|
4890
|
+
if self.registered_model:
|
|
4891
|
+
body["registered_model"] = self.registered_model
|
|
4892
|
+
return body
|
|
6989
4893
|
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
4894
|
+
@classmethod
|
|
4895
|
+
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelResponse:
|
|
4896
|
+
"""Deserializes the UpdateModelResponse from a dictionary."""
|
|
4897
|
+
return cls(registered_model=_from_dict(d, "registered_model", Model))
|
|
6993
4898
|
|
|
6994
|
-
|
|
6995
|
-
|
|
4899
|
+
|
|
4900
|
+
@dataclass
|
|
4901
|
+
class UpdateModelVersionResponse:
|
|
4902
|
+
model_version: Optional[ModelVersion] = None
|
|
4903
|
+
"""Return new version number generated for this model in registry."""
|
|
6996
4904
|
|
|
6997
4905
|
def as_dict(self) -> dict:
|
|
6998
|
-
"""Serializes the
|
|
4906
|
+
"""Serializes the UpdateModelVersionResponse into a dictionary suitable for use as a JSON request body."""
|
|
6999
4907
|
body = {}
|
|
7000
|
-
if self.
|
|
7001
|
-
body["
|
|
7002
|
-
if self.run_id is not None:
|
|
7003
|
-
body["run_id"] = self.run_id
|
|
7004
|
-
if self.run_name is not None:
|
|
7005
|
-
body["run_name"] = self.run_name
|
|
7006
|
-
if self.run_uuid is not None:
|
|
7007
|
-
body["run_uuid"] = self.run_uuid
|
|
7008
|
-
if self.status is not None:
|
|
7009
|
-
body["status"] = self.status.value
|
|
4908
|
+
if self.model_version:
|
|
4909
|
+
body["model_version"] = self.model_version.as_dict()
|
|
7010
4910
|
return body
|
|
7011
4911
|
|
|
7012
4912
|
def as_shallow_dict(self) -> dict:
|
|
7013
|
-
"""Serializes the
|
|
4913
|
+
"""Serializes the UpdateModelVersionResponse into a shallow dictionary of its immediate attributes."""
|
|
7014
4914
|
body = {}
|
|
7015
|
-
if self.
|
|
7016
|
-
body["
|
|
7017
|
-
if self.run_id is not None:
|
|
7018
|
-
body["run_id"] = self.run_id
|
|
7019
|
-
if self.run_name is not None:
|
|
7020
|
-
body["run_name"] = self.run_name
|
|
7021
|
-
if self.run_uuid is not None:
|
|
7022
|
-
body["run_uuid"] = self.run_uuid
|
|
7023
|
-
if self.status is not None:
|
|
7024
|
-
body["status"] = self.status
|
|
4915
|
+
if self.model_version:
|
|
4916
|
+
body["model_version"] = self.model_version
|
|
7025
4917
|
return body
|
|
7026
4918
|
|
|
7027
4919
|
@classmethod
|
|
7028
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
7029
|
-
"""Deserializes the
|
|
7030
|
-
return cls(
|
|
7031
|
-
end_time=d.get("end_time", None),
|
|
7032
|
-
run_id=d.get("run_id", None),
|
|
7033
|
-
run_name=d.get("run_name", None),
|
|
7034
|
-
run_uuid=d.get("run_uuid", None),
|
|
7035
|
-
status=_enum(d, "status", UpdateRunStatus),
|
|
7036
|
-
)
|
|
4920
|
+
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelVersionResponse:
|
|
4921
|
+
"""Deserializes the UpdateModelVersionResponse from a dictionary."""
|
|
4922
|
+
return cls(model_version=_from_dict(d, "model_version", ModelVersion))
|
|
7037
4923
|
|
|
7038
4924
|
|
|
7039
4925
|
@dataclass
|
|
@@ -7073,20 +4959,26 @@ class UpdateRunStatus(Enum):
|
|
|
7073
4959
|
|
|
7074
4960
|
@dataclass
|
|
7075
4961
|
class UpdateWebhookResponse:
|
|
4962
|
+
webhook: Optional[RegistryWebhook] = None
|
|
4963
|
+
|
|
7076
4964
|
def as_dict(self) -> dict:
|
|
7077
4965
|
"""Serializes the UpdateWebhookResponse into a dictionary suitable for use as a JSON request body."""
|
|
7078
4966
|
body = {}
|
|
4967
|
+
if self.webhook:
|
|
4968
|
+
body["webhook"] = self.webhook.as_dict()
|
|
7079
4969
|
return body
|
|
7080
4970
|
|
|
7081
4971
|
def as_shallow_dict(self) -> dict:
|
|
7082
4972
|
"""Serializes the UpdateWebhookResponse into a shallow dictionary of its immediate attributes."""
|
|
7083
4973
|
body = {}
|
|
4974
|
+
if self.webhook:
|
|
4975
|
+
body["webhook"] = self.webhook
|
|
7084
4976
|
return body
|
|
7085
4977
|
|
|
7086
4978
|
@classmethod
|
|
7087
4979
|
def from_dict(cls, d: Dict[str, Any]) -> UpdateWebhookResponse:
|
|
7088
4980
|
"""Deserializes the UpdateWebhookResponse from a dictionary."""
|
|
7089
|
-
return cls()
|
|
4981
|
+
return cls(webhook=_from_dict(d, "webhook", RegistryWebhook))
|
|
7090
4982
|
|
|
7091
4983
|
|
|
7092
4984
|
class ViewType(Enum):
|
|
@@ -8380,7 +6272,7 @@ class FeatureStoreAPI:
|
|
|
8380
6272
|
"""Create an Online Feature Store.
|
|
8381
6273
|
|
|
8382
6274
|
:param online_store: :class:`OnlineStore`
|
|
8383
|
-
|
|
6275
|
+
Online store to create.
|
|
8384
6276
|
|
|
8385
6277
|
:returns: :class:`OnlineStore`
|
|
8386
6278
|
"""
|
|
@@ -8484,7 +6376,7 @@ class FeatureStoreAPI:
|
|
|
8484
6376
|
:param name: str
|
|
8485
6377
|
The name of the online store. This is the unique identifier for the online store.
|
|
8486
6378
|
:param online_store: :class:`OnlineStore`
|
|
8487
|
-
|
|
6379
|
+
Online store to update.
|
|
8488
6380
|
:param update_mask: str
|
|
8489
6381
|
The list of fields to update.
|
|
8490
6382
|
|
|
@@ -8728,6 +6620,179 @@ class ForecastingAPI:
|
|
|
8728
6620
|
return ForecastingExperiment.from_dict(res)
|
|
8729
6621
|
|
|
8730
6622
|
|
|
6623
|
+
class MaterializedFeaturesAPI:
|
|
6624
|
+
"""Materialized Features are columns in tables and views that can be directly used as features to train and
|
|
6625
|
+
serve ML models."""
|
|
6626
|
+
|
|
6627
|
+
def __init__(self, api_client):
|
|
6628
|
+
self._api = api_client
|
|
6629
|
+
|
|
6630
|
+
def create_feature_tag(self, table_name: str, feature_name: str, feature_tag: FeatureTag) -> FeatureTag:
|
|
6631
|
+
"""Creates a FeatureTag.
|
|
6632
|
+
|
|
6633
|
+
:param table_name: str
|
|
6634
|
+
:param feature_name: str
|
|
6635
|
+
:param feature_tag: :class:`FeatureTag`
|
|
6636
|
+
|
|
6637
|
+
:returns: :class:`FeatureTag`
|
|
6638
|
+
"""
|
|
6639
|
+
body = feature_tag.as_dict()
|
|
6640
|
+
headers = {
|
|
6641
|
+
"Accept": "application/json",
|
|
6642
|
+
"Content-Type": "application/json",
|
|
6643
|
+
}
|
|
6644
|
+
|
|
6645
|
+
res = self._api.do(
|
|
6646
|
+
"POST",
|
|
6647
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags",
|
|
6648
|
+
body=body,
|
|
6649
|
+
headers=headers,
|
|
6650
|
+
)
|
|
6651
|
+
return FeatureTag.from_dict(res)
|
|
6652
|
+
|
|
6653
|
+
def delete_feature_tag(self, table_name: str, feature_name: str, key: str):
|
|
6654
|
+
"""Deletes a FeatureTag.
|
|
6655
|
+
|
|
6656
|
+
:param table_name: str
|
|
6657
|
+
The name of the feature table.
|
|
6658
|
+
:param feature_name: str
|
|
6659
|
+
The name of the feature within the feature table.
|
|
6660
|
+
:param key: str
|
|
6661
|
+
The key of the tag to delete.
|
|
6662
|
+
|
|
6663
|
+
|
|
6664
|
+
"""
|
|
6665
|
+
|
|
6666
|
+
headers = {
|
|
6667
|
+
"Accept": "application/json",
|
|
6668
|
+
}
|
|
6669
|
+
|
|
6670
|
+
self._api.do(
|
|
6671
|
+
"DELETE",
|
|
6672
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags/{key}",
|
|
6673
|
+
headers=headers,
|
|
6674
|
+
)
|
|
6675
|
+
|
|
6676
|
+
def get_feature_lineage(self, table_name: str, feature_name: str) -> FeatureLineage:
|
|
6677
|
+
"""Get Feature Lineage.
|
|
6678
|
+
|
|
6679
|
+
:param table_name: str
|
|
6680
|
+
The full name of the feature table in Unity Catalog.
|
|
6681
|
+
:param feature_name: str
|
|
6682
|
+
The name of the feature.
|
|
6683
|
+
|
|
6684
|
+
:returns: :class:`FeatureLineage`
|
|
6685
|
+
"""
|
|
6686
|
+
|
|
6687
|
+
headers = {
|
|
6688
|
+
"Accept": "application/json",
|
|
6689
|
+
}
|
|
6690
|
+
|
|
6691
|
+
res = self._api.do(
|
|
6692
|
+
"GET",
|
|
6693
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/lineage",
|
|
6694
|
+
headers=headers,
|
|
6695
|
+
)
|
|
6696
|
+
return FeatureLineage.from_dict(res)
|
|
6697
|
+
|
|
6698
|
+
def get_feature_tag(self, table_name: str, feature_name: str, key: str) -> FeatureTag:
|
|
6699
|
+
"""Gets a FeatureTag.
|
|
6700
|
+
|
|
6701
|
+
:param table_name: str
|
|
6702
|
+
:param feature_name: str
|
|
6703
|
+
:param key: str
|
|
6704
|
+
|
|
6705
|
+
:returns: :class:`FeatureTag`
|
|
6706
|
+
"""
|
|
6707
|
+
|
|
6708
|
+
headers = {
|
|
6709
|
+
"Accept": "application/json",
|
|
6710
|
+
}
|
|
6711
|
+
|
|
6712
|
+
res = self._api.do(
|
|
6713
|
+
"GET",
|
|
6714
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags/{key}",
|
|
6715
|
+
headers=headers,
|
|
6716
|
+
)
|
|
6717
|
+
return FeatureTag.from_dict(res)
|
|
6718
|
+
|
|
6719
|
+
def list_feature_tags(
|
|
6720
|
+
self, table_name: str, feature_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
|
|
6721
|
+
) -> Iterator[FeatureTag]:
|
|
6722
|
+
"""Lists FeatureTags.
|
|
6723
|
+
|
|
6724
|
+
:param table_name: str
|
|
6725
|
+
:param feature_name: str
|
|
6726
|
+
:param page_size: int (optional)
|
|
6727
|
+
The maximum number of results to return.
|
|
6728
|
+
:param page_token: str (optional)
|
|
6729
|
+
Pagination token to go to the next page based on a previous query.
|
|
6730
|
+
|
|
6731
|
+
:returns: Iterator over :class:`FeatureTag`
|
|
6732
|
+
"""
|
|
6733
|
+
|
|
6734
|
+
query = {}
|
|
6735
|
+
if page_size is not None:
|
|
6736
|
+
query["page_size"] = page_size
|
|
6737
|
+
if page_token is not None:
|
|
6738
|
+
query["page_token"] = page_token
|
|
6739
|
+
headers = {
|
|
6740
|
+
"Accept": "application/json",
|
|
6741
|
+
}
|
|
6742
|
+
|
|
6743
|
+
while True:
|
|
6744
|
+
json = self._api.do(
|
|
6745
|
+
"GET",
|
|
6746
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags",
|
|
6747
|
+
query=query,
|
|
6748
|
+
headers=headers,
|
|
6749
|
+
)
|
|
6750
|
+
if "feature_tags" in json:
|
|
6751
|
+
for v in json["feature_tags"]:
|
|
6752
|
+
yield FeatureTag.from_dict(v)
|
|
6753
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
6754
|
+
return
|
|
6755
|
+
query["page_token"] = json["next_page_token"]
|
|
6756
|
+
|
|
6757
|
+
def update_feature_tag(
|
|
6758
|
+
self,
|
|
6759
|
+
table_name: str,
|
|
6760
|
+
feature_name: str,
|
|
6761
|
+
key: str,
|
|
6762
|
+
feature_tag: FeatureTag,
|
|
6763
|
+
*,
|
|
6764
|
+
update_mask: Optional[str] = None,
|
|
6765
|
+
) -> FeatureTag:
|
|
6766
|
+
"""Updates a FeatureTag.
|
|
6767
|
+
|
|
6768
|
+
:param table_name: str
|
|
6769
|
+
:param feature_name: str
|
|
6770
|
+
:param key: str
|
|
6771
|
+
:param feature_tag: :class:`FeatureTag`
|
|
6772
|
+
:param update_mask: str (optional)
|
|
6773
|
+
The list of fields to update.
|
|
6774
|
+
|
|
6775
|
+
:returns: :class:`FeatureTag`
|
|
6776
|
+
"""
|
|
6777
|
+
body = feature_tag.as_dict()
|
|
6778
|
+
query = {}
|
|
6779
|
+
if update_mask is not None:
|
|
6780
|
+
query["update_mask"] = update_mask
|
|
6781
|
+
headers = {
|
|
6782
|
+
"Accept": "application/json",
|
|
6783
|
+
"Content-Type": "application/json",
|
|
6784
|
+
}
|
|
6785
|
+
|
|
6786
|
+
res = self._api.do(
|
|
6787
|
+
"PATCH",
|
|
6788
|
+
f"/api/2.0/feature-store/feature-tables/{table_name}/features/{feature_name}/tags/{key}",
|
|
6789
|
+
query=query,
|
|
6790
|
+
body=body,
|
|
6791
|
+
headers=headers,
|
|
6792
|
+
)
|
|
6793
|
+
return FeatureTag.from_dict(res)
|
|
6794
|
+
|
|
6795
|
+
|
|
8731
6796
|
class ModelRegistryAPI:
|
|
8732
6797
|
"""Note: This API reference documents APIs for the Workspace Model Registry. Databricks recommends using
|
|
8733
6798
|
[Models in Unity Catalog](/api/workspace/registeredmodels) instead. Models in Unity Catalog provides
|
|
@@ -8741,7 +6806,7 @@ class ModelRegistryAPI:
|
|
|
8741
6806
|
self._api = api_client
|
|
8742
6807
|
|
|
8743
6808
|
def approve_transition_request(
|
|
8744
|
-
self, name: str, version: str, stage:
|
|
6809
|
+
self, name: str, version: str, stage: str, archive_existing_versions: bool, *, comment: Optional[str] = None
|
|
8745
6810
|
) -> ApproveTransitionRequestResponse:
|
|
8746
6811
|
"""Approves a model version stage transition request.
|
|
8747
6812
|
|
|
@@ -8749,7 +6814,7 @@ class ModelRegistryAPI:
|
|
|
8749
6814
|
Name of the model.
|
|
8750
6815
|
:param version: str
|
|
8751
6816
|
Version of the model.
|
|
8752
|
-
:param stage:
|
|
6817
|
+
:param stage: str
|
|
8753
6818
|
Target stage of the transition. Valid values are:
|
|
8754
6819
|
|
|
8755
6820
|
* `None`: The initial stage of a model version.
|
|
@@ -8774,7 +6839,7 @@ class ModelRegistryAPI:
|
|
|
8774
6839
|
if name is not None:
|
|
8775
6840
|
body["name"] = name
|
|
8776
6841
|
if stage is not None:
|
|
8777
|
-
body["stage"] = stage
|
|
6842
|
+
body["stage"] = stage
|
|
8778
6843
|
if version is not None:
|
|
8779
6844
|
body["version"] = version
|
|
8780
6845
|
headers = {
|
|
@@ -8816,9 +6881,8 @@ class ModelRegistryAPI:
|
|
|
8816
6881
|
def create_model(
|
|
8817
6882
|
self, name: str, *, description: Optional[str] = None, tags: Optional[List[ModelTag]] = None
|
|
8818
6883
|
) -> CreateModelResponse:
|
|
8819
|
-
"""Creates a new registered model with the name specified in the request body.
|
|
8820
|
-
|
|
8821
|
-
Throws `RESOURCE_ALREADY_EXISTS` if a registered model with the given name exists.
|
|
6884
|
+
"""Creates a new registered model with the name specified in the request body. Throws
|
|
6885
|
+
`RESOURCE_ALREADY_EXISTS` if a registered model with the given name exists.
|
|
8822
6886
|
|
|
8823
6887
|
:param name: str
|
|
8824
6888
|
Register models under this name
|
|
@@ -8895,7 +6959,7 @@ class ModelRegistryAPI:
|
|
|
8895
6959
|
return CreateModelVersionResponse.from_dict(res)
|
|
8896
6960
|
|
|
8897
6961
|
def create_transition_request(
|
|
8898
|
-
self, name: str, version: str, stage:
|
|
6962
|
+
self, name: str, version: str, stage: str, *, comment: Optional[str] = None
|
|
8899
6963
|
) -> CreateTransitionRequestResponse:
|
|
8900
6964
|
"""Creates a model version stage transition request.
|
|
8901
6965
|
|
|
@@ -8903,7 +6967,7 @@ class ModelRegistryAPI:
|
|
|
8903
6967
|
Name of the model.
|
|
8904
6968
|
:param version: str
|
|
8905
6969
|
Version of the model.
|
|
8906
|
-
:param stage:
|
|
6970
|
+
:param stage: str
|
|
8907
6971
|
Target stage of the transition. Valid values are:
|
|
8908
6972
|
|
|
8909
6973
|
* `None`: The initial stage of a model version.
|
|
@@ -8924,7 +6988,7 @@ class ModelRegistryAPI:
|
|
|
8924
6988
|
if name is not None:
|
|
8925
6989
|
body["name"] = name
|
|
8926
6990
|
if stage is not None:
|
|
8927
|
-
body["stage"] = stage
|
|
6991
|
+
body["stage"] = stage
|
|
8928
6992
|
if version is not None:
|
|
8929
6993
|
body["version"] = version
|
|
8930
6994
|
headers = {
|
|
@@ -8945,9 +7009,7 @@ class ModelRegistryAPI:
|
|
|
8945
7009
|
model_name: Optional[str] = None,
|
|
8946
7010
|
status: Optional[RegistryWebhookStatus] = None,
|
|
8947
7011
|
) -> CreateWebhookResponse:
|
|
8948
|
-
"""**NOTE
|
|
8949
|
-
|
|
8950
|
-
Creates a registry webhook.
|
|
7012
|
+
"""**NOTE:** This endpoint is in Public Preview. Creates a registry webhook.
|
|
8951
7013
|
|
|
8952
7014
|
:param events: List[:class:`RegistryWebhookEvent`]
|
|
8953
7015
|
Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A new model version was
|
|
@@ -8981,7 +7043,9 @@ class ModelRegistryAPI:
|
|
|
8981
7043
|
:param description: str (optional)
|
|
8982
7044
|
User-specified description for the webhook.
|
|
8983
7045
|
:param http_url_spec: :class:`HttpUrlSpec` (optional)
|
|
7046
|
+
External HTTPS URL called on event trigger (by using a POST request).
|
|
8984
7047
|
:param job_spec: :class:`JobSpec` (optional)
|
|
7048
|
+
ID of the job that the webhook runs.
|
|
8985
7049
|
:param model_name: str (optional)
|
|
8986
7050
|
If model name is not specified, a registry-wide webhook is created that listens for the specified
|
|
8987
7051
|
events across all versions of all registered models.
|
|
@@ -9126,21 +7190,15 @@ class ModelRegistryAPI:
|
|
|
9126
7190
|
self._api.do("DELETE", "/api/2.0/mlflow/model-versions/delete-tag", query=query, headers=headers)
|
|
9127
7191
|
|
|
9128
7192
|
def delete_transition_request(
|
|
9129
|
-
self,
|
|
9130
|
-
|
|
9131
|
-
version: str,
|
|
9132
|
-
stage: DeleteTransitionRequestStage,
|
|
9133
|
-
creator: str,
|
|
9134
|
-
*,
|
|
9135
|
-
comment: Optional[str] = None,
|
|
9136
|
-
):
|
|
7193
|
+
self, name: str, version: str, stage: str, creator: str, *, comment: Optional[str] = None
|
|
7194
|
+
) -> DeleteTransitionRequestResponse:
|
|
9137
7195
|
"""Cancels a model version stage transition request.
|
|
9138
7196
|
|
|
9139
7197
|
:param name: str
|
|
9140
7198
|
Name of the model.
|
|
9141
7199
|
:param version: str
|
|
9142
7200
|
Version of the model.
|
|
9143
|
-
:param stage:
|
|
7201
|
+
:param stage: str
|
|
9144
7202
|
Target stage of the transition request. Valid values are:
|
|
9145
7203
|
|
|
9146
7204
|
* `None`: The initial stage of a model version.
|
|
@@ -9156,7 +7214,7 @@ class ModelRegistryAPI:
|
|
|
9156
7214
|
:param comment: str (optional)
|
|
9157
7215
|
User-provided comment on the action.
|
|
9158
7216
|
|
|
9159
|
-
|
|
7217
|
+
:returns: :class:`DeleteTransitionRequestResponse`
|
|
9160
7218
|
"""
|
|
9161
7219
|
|
|
9162
7220
|
query = {}
|
|
@@ -9167,21 +7225,20 @@ class ModelRegistryAPI:
|
|
|
9167
7225
|
if name is not None:
|
|
9168
7226
|
query["name"] = name
|
|
9169
7227
|
if stage is not None:
|
|
9170
|
-
query["stage"] = stage
|
|
7228
|
+
query["stage"] = stage
|
|
9171
7229
|
if version is not None:
|
|
9172
7230
|
query["version"] = version
|
|
9173
7231
|
headers = {
|
|
9174
7232
|
"Accept": "application/json",
|
|
9175
7233
|
}
|
|
9176
7234
|
|
|
9177
|
-
self._api.do("DELETE", "/api/2.0/mlflow/transition-requests/delete", query=query, headers=headers)
|
|
7235
|
+
res = self._api.do("DELETE", "/api/2.0/mlflow/transition-requests/delete", query=query, headers=headers)
|
|
7236
|
+
return DeleteTransitionRequestResponse.from_dict(res)
|
|
9178
7237
|
|
|
9179
|
-
def delete_webhook(self,
|
|
9180
|
-
"""**NOTE:** This endpoint is in Public Preview.
|
|
7238
|
+
def delete_webhook(self, id: str):
|
|
7239
|
+
"""**NOTE:** This endpoint is in Public Preview. Deletes a registry webhook.
|
|
9181
7240
|
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
:param id: str (optional)
|
|
7241
|
+
:param id: str
|
|
9185
7242
|
Webhook ID required to delete a registry webhook.
|
|
9186
7243
|
|
|
9187
7244
|
|
|
@@ -9357,7 +7414,7 @@ class ModelRegistryAPI:
|
|
|
9357
7414
|
"""Gets a list of all open stage transition requests for the model version.
|
|
9358
7415
|
|
|
9359
7416
|
:param name: str
|
|
9360
|
-
Name of the model.
|
|
7417
|
+
Name of the registered model.
|
|
9361
7418
|
:param version: str
|
|
9362
7419
|
Version of the model.
|
|
9363
7420
|
|
|
@@ -9381,19 +7438,48 @@ class ModelRegistryAPI:
|
|
|
9381
7438
|
self,
|
|
9382
7439
|
*,
|
|
9383
7440
|
events: Optional[List[RegistryWebhookEvent]] = None,
|
|
7441
|
+
max_results: Optional[int] = None,
|
|
9384
7442
|
model_name: Optional[str] = None,
|
|
9385
7443
|
page_token: Optional[str] = None,
|
|
9386
7444
|
) -> Iterator[RegistryWebhook]:
|
|
9387
|
-
"""**NOTE:** This endpoint is in Public Preview.
|
|
9388
|
-
|
|
9389
|
-
Lists all registry webhooks.
|
|
7445
|
+
"""**NOTE:** This endpoint is in Public Preview. Lists all registry webhooks.
|
|
9390
7446
|
|
|
9391
7447
|
:param events: List[:class:`RegistryWebhookEvent`] (optional)
|
|
7448
|
+
Events that trigger the webhook. * `MODEL_VERSION_CREATED`: A new model version was created for the
|
|
7449
|
+
associated model.
|
|
7450
|
+
|
|
7451
|
+
* `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was changed.
|
|
7452
|
+
|
|
7453
|
+
* `TRANSITION_REQUEST_CREATED`: A user requested a model version’s stage be transitioned.
|
|
7454
|
+
|
|
7455
|
+
* `COMMENT_CREATED`: A user wrote a comment on a registered model.
|
|
7456
|
+
|
|
7457
|
+
* `REGISTERED_MODEL_CREATED`: A new registered model was created. This event type can only be
|
|
7458
|
+
specified for a registry-wide webhook, which can be created by not specifying a model name in the
|
|
7459
|
+
create request.
|
|
7460
|
+
|
|
7461
|
+
* `MODEL_VERSION_TAG_SET`: A user set a tag on the model version.
|
|
7462
|
+
|
|
7463
|
+
* `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was transitioned to staging.
|
|
7464
|
+
|
|
7465
|
+
* `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was transitioned to production.
|
|
7466
|
+
|
|
7467
|
+
* `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived.
|
|
7468
|
+
|
|
7469
|
+
* `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model version be transitioned to
|
|
7470
|
+
staging.
|
|
7471
|
+
|
|
7472
|
+
* `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model version be transitioned to
|
|
7473
|
+
production.
|
|
7474
|
+
|
|
7475
|
+
* `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model version be archived.
|
|
7476
|
+
|
|
9392
7477
|
If `events` is specified, any webhook with one or more of the specified trigger events is included
|
|
9393
7478
|
in the output. If `events` is not specified, webhooks of all event types are included in the output.
|
|
7479
|
+
:param max_results: int (optional)
|
|
9394
7480
|
:param model_name: str (optional)
|
|
9395
|
-
If not specified, all webhooks associated with the specified events are
|
|
9396
|
-
associated model.
|
|
7481
|
+
Registered model name If not specified, all webhooks associated with the specified events are
|
|
7482
|
+
listed, regardless of their associated model.
|
|
9397
7483
|
:param page_token: str (optional)
|
|
9398
7484
|
Token indicating the page of artifact results to fetch
|
|
9399
7485
|
|
|
@@ -9403,6 +7489,8 @@ class ModelRegistryAPI:
|
|
|
9403
7489
|
query = {}
|
|
9404
7490
|
if events is not None:
|
|
9405
7491
|
query["events"] = [v.value for v in events]
|
|
7492
|
+
if max_results is not None:
|
|
7493
|
+
query["max_results"] = max_results
|
|
9406
7494
|
if model_name is not None:
|
|
9407
7495
|
query["model_name"] = model_name
|
|
9408
7496
|
if page_token is not None:
|
|
@@ -9421,7 +7509,7 @@ class ModelRegistryAPI:
|
|
|
9421
7509
|
query["page_token"] = json["next_page_token"]
|
|
9422
7510
|
|
|
9423
7511
|
def reject_transition_request(
|
|
9424
|
-
self, name: str, version: str, stage:
|
|
7512
|
+
self, name: str, version: str, stage: str, *, comment: Optional[str] = None
|
|
9425
7513
|
) -> RejectTransitionRequestResponse:
|
|
9426
7514
|
"""Rejects a model version stage transition request.
|
|
9427
7515
|
|
|
@@ -9429,7 +7517,7 @@ class ModelRegistryAPI:
|
|
|
9429
7517
|
Name of the model.
|
|
9430
7518
|
:param version: str
|
|
9431
7519
|
Version of the model.
|
|
9432
|
-
:param stage:
|
|
7520
|
+
:param stage: str
|
|
9433
7521
|
Target stage of the transition. Valid values are:
|
|
9434
7522
|
|
|
9435
7523
|
* `None`: The initial stage of a model version.
|
|
@@ -9450,7 +7538,7 @@ class ModelRegistryAPI:
|
|
|
9450
7538
|
if name is not None:
|
|
9451
7539
|
body["name"] = name
|
|
9452
7540
|
if stage is not None:
|
|
9453
|
-
body["stage"] = stage
|
|
7541
|
+
body["stage"] = stage
|
|
9454
7542
|
if version is not None:
|
|
9455
7543
|
body["version"] = version
|
|
9456
7544
|
headers = {
|
|
@@ -9672,9 +7760,7 @@ class ModelRegistryAPI:
|
|
|
9672
7760
|
def test_registry_webhook(
|
|
9673
7761
|
self, id: str, *, event: Optional[RegistryWebhookEvent] = None
|
|
9674
7762
|
) -> TestRegistryWebhookResponse:
|
|
9675
|
-
"""**NOTE:** This endpoint is in Public Preview.
|
|
9676
|
-
|
|
9677
|
-
Tests a registry webhook.
|
|
7763
|
+
"""**NOTE:** This endpoint is in Public Preview. Tests a registry webhook.
|
|
9678
7764
|
|
|
9679
7765
|
:param id: str
|
|
9680
7766
|
Webhook ID
|
|
@@ -9698,10 +7784,10 @@ class ModelRegistryAPI:
|
|
|
9698
7784
|
return TestRegistryWebhookResponse.from_dict(res)
|
|
9699
7785
|
|
|
9700
7786
|
def transition_stage(
|
|
9701
|
-
self, name: str, version: str, stage:
|
|
7787
|
+
self, name: str, version: str, stage: str, archive_existing_versions: bool, *, comment: Optional[str] = None
|
|
9702
7788
|
) -> TransitionStageResponse:
|
|
9703
7789
|
"""Transition a model version's stage. This is a Databricks workspace version of the [MLflow endpoint]
|
|
9704
|
-
that also accepts a comment associated with the transition to be recorded.
|
|
7790
|
+
that also accepts a comment associated with the transition to be recorded.
|
|
9705
7791
|
|
|
9706
7792
|
[MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#transition-modelversion-stage
|
|
9707
7793
|
|
|
@@ -9709,7 +7795,7 @@ class ModelRegistryAPI:
|
|
|
9709
7795
|
Name of the model.
|
|
9710
7796
|
:param version: str
|
|
9711
7797
|
Version of the model.
|
|
9712
|
-
:param stage:
|
|
7798
|
+
:param stage: str
|
|
9713
7799
|
Target stage of the transition. Valid values are:
|
|
9714
7800
|
|
|
9715
7801
|
* `None`: The initial stage of a model version.
|
|
@@ -9734,7 +7820,7 @@ class ModelRegistryAPI:
|
|
|
9734
7820
|
if name is not None:
|
|
9735
7821
|
body["name"] = name
|
|
9736
7822
|
if stage is not None:
|
|
9737
|
-
body["stage"] = stage
|
|
7823
|
+
body["stage"] = stage
|
|
9738
7824
|
if version is not None:
|
|
9739
7825
|
body["version"] = version
|
|
9740
7826
|
headers = {
|
|
@@ -9770,7 +7856,7 @@ class ModelRegistryAPI:
|
|
|
9770
7856
|
res = self._api.do("PATCH", "/api/2.0/mlflow/comments/update", body=body, headers=headers)
|
|
9771
7857
|
return UpdateCommentResponse.from_dict(res)
|
|
9772
7858
|
|
|
9773
|
-
def update_model(self, name: str, *, description: Optional[str] = None):
|
|
7859
|
+
def update_model(self, name: str, *, description: Optional[str] = None) -> UpdateModelResponse:
|
|
9774
7860
|
"""Updates a registered model.
|
|
9775
7861
|
|
|
9776
7862
|
:param name: str
|
|
@@ -9778,7 +7864,7 @@ class ModelRegistryAPI:
|
|
|
9778
7864
|
:param description: str (optional)
|
|
9779
7865
|
If provided, updates the description for this `registered_model`.
|
|
9780
7866
|
|
|
9781
|
-
|
|
7867
|
+
:returns: :class:`UpdateModelResponse`
|
|
9782
7868
|
"""
|
|
9783
7869
|
body = {}
|
|
9784
7870
|
if description is not None:
|
|
@@ -9790,9 +7876,12 @@ class ModelRegistryAPI:
|
|
|
9790
7876
|
"Content-Type": "application/json",
|
|
9791
7877
|
}
|
|
9792
7878
|
|
|
9793
|
-
self._api.do("PATCH", "/api/2.0/mlflow/registered-models/update", body=body, headers=headers)
|
|
7879
|
+
res = self._api.do("PATCH", "/api/2.0/mlflow/registered-models/update", body=body, headers=headers)
|
|
7880
|
+
return UpdateModelResponse.from_dict(res)
|
|
9794
7881
|
|
|
9795
|
-
def update_model_version(
|
|
7882
|
+
def update_model_version(
|
|
7883
|
+
self, name: str, version: str, *, description: Optional[str] = None
|
|
7884
|
+
) -> UpdateModelVersionResponse:
|
|
9796
7885
|
"""Updates the model version.
|
|
9797
7886
|
|
|
9798
7887
|
:param name: str
|
|
@@ -9802,7 +7891,7 @@ class ModelRegistryAPI:
|
|
|
9802
7891
|
:param description: str (optional)
|
|
9803
7892
|
If provided, updates the description for this `registered_model`.
|
|
9804
7893
|
|
|
9805
|
-
|
|
7894
|
+
:returns: :class:`UpdateModelVersionResponse`
|
|
9806
7895
|
"""
|
|
9807
7896
|
body = {}
|
|
9808
7897
|
if description is not None:
|
|
@@ -9816,7 +7905,8 @@ class ModelRegistryAPI:
|
|
|
9816
7905
|
"Content-Type": "application/json",
|
|
9817
7906
|
}
|
|
9818
7907
|
|
|
9819
|
-
self._api.do("PATCH", "/api/2.0/mlflow/model-versions/update", body=body, headers=headers)
|
|
7908
|
+
res = self._api.do("PATCH", "/api/2.0/mlflow/model-versions/update", body=body, headers=headers)
|
|
7909
|
+
return UpdateModelVersionResponse.from_dict(res)
|
|
9820
7910
|
|
|
9821
7911
|
def update_permissions(
|
|
9822
7912
|
self,
|
|
@@ -9855,10 +7945,8 @@ class ModelRegistryAPI:
|
|
|
9855
7945
|
http_url_spec: Optional[HttpUrlSpec] = None,
|
|
9856
7946
|
job_spec: Optional[JobSpec] = None,
|
|
9857
7947
|
status: Optional[RegistryWebhookStatus] = None,
|
|
9858
|
-
):
|
|
9859
|
-
"""**NOTE:** This endpoint is in Public Preview.
|
|
9860
|
-
|
|
9861
|
-
Updates a registry webhook.
|
|
7948
|
+
) -> UpdateWebhookResponse:
|
|
7949
|
+
"""**NOTE:** This endpoint is in Public Preview. Updates a registry webhook.
|
|
9862
7950
|
|
|
9863
7951
|
:param id: str
|
|
9864
7952
|
Webhook ID
|
|
@@ -9896,15 +7984,8 @@ class ModelRegistryAPI:
|
|
|
9896
7984
|
:param http_url_spec: :class:`HttpUrlSpec` (optional)
|
|
9897
7985
|
:param job_spec: :class:`JobSpec` (optional)
|
|
9898
7986
|
:param status: :class:`RegistryWebhookStatus` (optional)
|
|
9899
|
-
Enable or disable triggering the webhook, or put the webhook into test mode. The default is
|
|
9900
|
-
`ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.
|
|
9901
|
-
|
|
9902
|
-
* `DISABLED`: Webhook is not triggered.
|
|
9903
|
-
|
|
9904
|
-
* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a real
|
|
9905
|
-
event.
|
|
9906
|
-
|
|
9907
7987
|
|
|
7988
|
+
:returns: :class:`UpdateWebhookResponse`
|
|
9908
7989
|
"""
|
|
9909
7990
|
body = {}
|
|
9910
7991
|
if description is not None:
|
|
@@ -9924,4 +8005,5 @@ class ModelRegistryAPI:
|
|
|
9924
8005
|
"Content-Type": "application/json",
|
|
9925
8006
|
}
|
|
9926
8007
|
|
|
9927
|
-
self._api.do("PATCH", "/api/2.0/mlflow/registry-webhooks/update", body=body, headers=headers)
|
|
8008
|
+
res = self._api.do("PATCH", "/api/2.0/mlflow/registry-webhooks/update", body=body, headers=headers)
|
|
8009
|
+
return UpdateWebhookResponse.from_dict(res)
|