databricks-sdk 0.58.0__py3-none-any.whl → 0.60.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 +18 -10
- databricks/sdk/credentials_provider.py +2 -2
- databricks/sdk/mixins/files.py +43 -15
- databricks/sdk/mixins/open_ai_client.py +28 -7
- databricks/sdk/oidc.py +6 -2
- databricks/sdk/service/{aibuilder.py → agentbricks.py} +5 -132
- databricks/sdk/service/apps.py +52 -46
- databricks/sdk/service/billing.py +9 -200
- databricks/sdk/service/catalog.py +5501 -7697
- databricks/sdk/service/cleanrooms.py +24 -54
- databricks/sdk/service/compute.py +456 -2515
- databricks/sdk/service/dashboards.py +1 -177
- databricks/sdk/service/database.py +34 -53
- databricks/sdk/service/files.py +2 -218
- databricks/sdk/service/iam.py +16 -295
- databricks/sdk/service/jobs.py +108 -1171
- databricks/sdk/service/marketplace.py +0 -573
- databricks/sdk/service/ml.py +76 -2445
- databricks/sdk/service/oauth2.py +122 -237
- databricks/sdk/service/pipelines.py +180 -752
- databricks/sdk/service/provisioning.py +0 -603
- databricks/sdk/service/serving.py +5 -577
- databricks/sdk/service/settings.py +192 -1560
- databricks/sdk/service/sharing.py +5 -470
- databricks/sdk/service/sql.py +117 -1704
- databricks/sdk/service/vectorsearch.py +0 -391
- databricks/sdk/service/workspace.py +250 -721
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/RECORD +34 -34
- {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/top_level.txt +0 -0
databricks/sdk/service/ml.py
CHANGED
|
@@ -174,75 +174,6 @@ class ActivityType(Enum):
|
|
|
174
174
|
SYSTEM_TRANSITION = "SYSTEM_TRANSITION"
|
|
175
175
|
|
|
176
176
|
|
|
177
|
-
@dataclass
|
|
178
|
-
class ApproveTransitionRequest:
|
|
179
|
-
"""Details required to identify and approve a model version stage transition request."""
|
|
180
|
-
|
|
181
|
-
name: str
|
|
182
|
-
"""Name of the model."""
|
|
183
|
-
|
|
184
|
-
version: str
|
|
185
|
-
"""Version of the model."""
|
|
186
|
-
|
|
187
|
-
stage: str
|
|
188
|
-
"""Target stage of the transition. Valid values are:
|
|
189
|
-
|
|
190
|
-
* `None`: The initial stage of a model version.
|
|
191
|
-
|
|
192
|
-
* `Staging`: Staging or pre-production stage.
|
|
193
|
-
|
|
194
|
-
* `Production`: Production stage.
|
|
195
|
-
|
|
196
|
-
* `Archived`: Archived stage."""
|
|
197
|
-
|
|
198
|
-
archive_existing_versions: bool
|
|
199
|
-
"""Specifies whether to archive all current model versions in the target stage."""
|
|
200
|
-
|
|
201
|
-
comment: Optional[str] = None
|
|
202
|
-
"""User-provided comment on the action."""
|
|
203
|
-
|
|
204
|
-
def as_dict(self) -> dict:
|
|
205
|
-
"""Serializes the ApproveTransitionRequest into a dictionary suitable for use as a JSON request body."""
|
|
206
|
-
body = {}
|
|
207
|
-
if self.archive_existing_versions is not None:
|
|
208
|
-
body["archive_existing_versions"] = self.archive_existing_versions
|
|
209
|
-
if self.comment is not None:
|
|
210
|
-
body["comment"] = self.comment
|
|
211
|
-
if self.name is not None:
|
|
212
|
-
body["name"] = self.name
|
|
213
|
-
if self.stage is not None:
|
|
214
|
-
body["stage"] = self.stage
|
|
215
|
-
if self.version is not None:
|
|
216
|
-
body["version"] = self.version
|
|
217
|
-
return body
|
|
218
|
-
|
|
219
|
-
def as_shallow_dict(self) -> dict:
|
|
220
|
-
"""Serializes the ApproveTransitionRequest into a shallow dictionary of its immediate attributes."""
|
|
221
|
-
body = {}
|
|
222
|
-
if self.archive_existing_versions is not None:
|
|
223
|
-
body["archive_existing_versions"] = self.archive_existing_versions
|
|
224
|
-
if self.comment is not None:
|
|
225
|
-
body["comment"] = self.comment
|
|
226
|
-
if self.name is not None:
|
|
227
|
-
body["name"] = self.name
|
|
228
|
-
if self.stage is not None:
|
|
229
|
-
body["stage"] = self.stage
|
|
230
|
-
if self.version is not None:
|
|
231
|
-
body["version"] = self.version
|
|
232
|
-
return body
|
|
233
|
-
|
|
234
|
-
@classmethod
|
|
235
|
-
def from_dict(cls, d: Dict[str, Any]) -> ApproveTransitionRequest:
|
|
236
|
-
"""Deserializes the ApproveTransitionRequest from a dictionary."""
|
|
237
|
-
return cls(
|
|
238
|
-
archive_existing_versions=d.get("archive_existing_versions", None),
|
|
239
|
-
comment=d.get("comment", None),
|
|
240
|
-
name=d.get("name", None),
|
|
241
|
-
stage=d.get("stage", None),
|
|
242
|
-
version=d.get("version", None),
|
|
243
|
-
)
|
|
244
|
-
|
|
245
|
-
|
|
246
177
|
@dataclass
|
|
247
178
|
class ApproveTransitionRequestResponse:
|
|
248
179
|
activity: Optional[Activity] = None
|
|
@@ -358,47 +289,6 @@ class CommentObject:
|
|
|
358
289
|
)
|
|
359
290
|
|
|
360
291
|
|
|
361
|
-
@dataclass
|
|
362
|
-
class CreateComment:
|
|
363
|
-
"""Details required to create a comment on a model version."""
|
|
364
|
-
|
|
365
|
-
name: str
|
|
366
|
-
"""Name of the model."""
|
|
367
|
-
|
|
368
|
-
version: str
|
|
369
|
-
"""Version of the model."""
|
|
370
|
-
|
|
371
|
-
comment: str
|
|
372
|
-
"""User-provided comment on the action."""
|
|
373
|
-
|
|
374
|
-
def as_dict(self) -> dict:
|
|
375
|
-
"""Serializes the CreateComment into a dictionary suitable for use as a JSON request body."""
|
|
376
|
-
body = {}
|
|
377
|
-
if self.comment is not None:
|
|
378
|
-
body["comment"] = self.comment
|
|
379
|
-
if self.name is not None:
|
|
380
|
-
body["name"] = self.name
|
|
381
|
-
if self.version is not None:
|
|
382
|
-
body["version"] = self.version
|
|
383
|
-
return body
|
|
384
|
-
|
|
385
|
-
def as_shallow_dict(self) -> dict:
|
|
386
|
-
"""Serializes the CreateComment into a shallow dictionary of its immediate attributes."""
|
|
387
|
-
body = {}
|
|
388
|
-
if self.comment is not None:
|
|
389
|
-
body["comment"] = self.comment
|
|
390
|
-
if self.name is not None:
|
|
391
|
-
body["name"] = self.name
|
|
392
|
-
if self.version is not None:
|
|
393
|
-
body["version"] = self.version
|
|
394
|
-
return body
|
|
395
|
-
|
|
396
|
-
@classmethod
|
|
397
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateComment:
|
|
398
|
-
"""Deserializes the CreateComment from a dictionary."""
|
|
399
|
-
return cls(comment=d.get("comment", None), name=d.get("name", None), version=d.get("version", None))
|
|
400
|
-
|
|
401
|
-
|
|
402
292
|
@dataclass
|
|
403
293
|
class CreateCommentResponse:
|
|
404
294
|
comment: Optional[CommentObject] = None
|
|
@@ -424,53 +314,6 @@ class CreateCommentResponse:
|
|
|
424
314
|
return cls(comment=_from_dict(d, "comment", CommentObject))
|
|
425
315
|
|
|
426
316
|
|
|
427
|
-
@dataclass
|
|
428
|
-
class CreateExperiment:
|
|
429
|
-
name: str
|
|
430
|
-
"""Experiment name."""
|
|
431
|
-
|
|
432
|
-
artifact_location: Optional[str] = None
|
|
433
|
-
"""Location where all artifacts for the experiment are stored. If not provided, the remote server
|
|
434
|
-
will select an appropriate default."""
|
|
435
|
-
|
|
436
|
-
tags: Optional[List[ExperimentTag]] = None
|
|
437
|
-
"""A collection of tags to set on the experiment. Maximum tag size and number of tags per request
|
|
438
|
-
depends on the storage backend. All storage backends are guaranteed to support tag keys up to
|
|
439
|
-
250 bytes in size and tag values up to 5000 bytes in size. All storage backends are also
|
|
440
|
-
guaranteed to support up to 20 tags per request."""
|
|
441
|
-
|
|
442
|
-
def as_dict(self) -> dict:
|
|
443
|
-
"""Serializes the CreateExperiment into a dictionary suitable for use as a JSON request body."""
|
|
444
|
-
body = {}
|
|
445
|
-
if self.artifact_location is not None:
|
|
446
|
-
body["artifact_location"] = self.artifact_location
|
|
447
|
-
if self.name is not None:
|
|
448
|
-
body["name"] = self.name
|
|
449
|
-
if self.tags:
|
|
450
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
451
|
-
return body
|
|
452
|
-
|
|
453
|
-
def as_shallow_dict(self) -> dict:
|
|
454
|
-
"""Serializes the CreateExperiment into a shallow dictionary of its immediate attributes."""
|
|
455
|
-
body = {}
|
|
456
|
-
if self.artifact_location is not None:
|
|
457
|
-
body["artifact_location"] = self.artifact_location
|
|
458
|
-
if self.name is not None:
|
|
459
|
-
body["name"] = self.name
|
|
460
|
-
if self.tags:
|
|
461
|
-
body["tags"] = self.tags
|
|
462
|
-
return body
|
|
463
|
-
|
|
464
|
-
@classmethod
|
|
465
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateExperiment:
|
|
466
|
-
"""Deserializes the CreateExperiment from a dictionary."""
|
|
467
|
-
return cls(
|
|
468
|
-
artifact_location=d.get("artifact_location", None),
|
|
469
|
-
name=d.get("name", None),
|
|
470
|
-
tags=_repeated_dict(d, "tags", ExperimentTag),
|
|
471
|
-
)
|
|
472
|
-
|
|
473
|
-
|
|
474
317
|
@dataclass
|
|
475
318
|
class CreateExperimentResponse:
|
|
476
319
|
experiment_id: Optional[str] = None
|
|
@@ -496,177 +339,6 @@ class CreateExperimentResponse:
|
|
|
496
339
|
return cls(experiment_id=d.get("experiment_id", None))
|
|
497
340
|
|
|
498
341
|
|
|
499
|
-
@dataclass
|
|
500
|
-
class CreateForecastingExperimentRequest:
|
|
501
|
-
train_data_path: str
|
|
502
|
-
"""The fully qualified path of a Unity Catalog table, formatted as
|
|
503
|
-
catalog_name.schema_name.table_name, used as training data for the forecasting model."""
|
|
504
|
-
|
|
505
|
-
target_column: str
|
|
506
|
-
"""The column in the input training table used as the prediction target for model training. The
|
|
507
|
-
values in this column are used as the ground truth for model training."""
|
|
508
|
-
|
|
509
|
-
time_column: str
|
|
510
|
-
"""The column in the input training table that represents each row's timestamp."""
|
|
511
|
-
|
|
512
|
-
forecast_granularity: str
|
|
513
|
-
"""The time interval between consecutive rows in the time series data. Possible values include: '1
|
|
514
|
-
second', '1 minute', '5 minutes', '10 minutes', '15 minutes', '30 minutes', 'Hourly', 'Daily',
|
|
515
|
-
'Weekly', 'Monthly', 'Quarterly', 'Yearly'."""
|
|
516
|
-
|
|
517
|
-
forecast_horizon: int
|
|
518
|
-
"""The number of time steps into the future to make predictions, calculated as a multiple of
|
|
519
|
-
forecast_granularity. This value represents how far ahead the model should forecast."""
|
|
520
|
-
|
|
521
|
-
custom_weights_column: Optional[str] = None
|
|
522
|
-
"""The column in the training table used to customize weights for each time series."""
|
|
523
|
-
|
|
524
|
-
experiment_path: Optional[str] = None
|
|
525
|
-
"""The path in the workspace to store the created experiment."""
|
|
526
|
-
|
|
527
|
-
future_feature_data_path: Optional[str] = None
|
|
528
|
-
"""The fully qualified path of a Unity Catalog table, formatted as
|
|
529
|
-
catalog_name.schema_name.table_name, used to store future feature data for predictions."""
|
|
530
|
-
|
|
531
|
-
holiday_regions: Optional[List[str]] = None
|
|
532
|
-
"""The region code(s) to automatically add holiday features. Currently supports only one region."""
|
|
533
|
-
|
|
534
|
-
include_features: Optional[List[str]] = None
|
|
535
|
-
"""Specifies the list of feature columns to include in model training. These columns must exist in
|
|
536
|
-
the training data and be of type string, numerical, or boolean. If not specified, no additional
|
|
537
|
-
features will be included. Note: Certain columns are automatically handled: - Automatically
|
|
538
|
-
excluded: split_column, target_column, custom_weights_column. - Automatically included:
|
|
539
|
-
time_column."""
|
|
540
|
-
|
|
541
|
-
max_runtime: Optional[int] = None
|
|
542
|
-
"""The maximum duration for the experiment in minutes. The experiment stops automatically if it
|
|
543
|
-
exceeds this limit."""
|
|
544
|
-
|
|
545
|
-
prediction_data_path: Optional[str] = None
|
|
546
|
-
"""The fully qualified path of a Unity Catalog table, formatted as
|
|
547
|
-
catalog_name.schema_name.table_name, used to store predictions."""
|
|
548
|
-
|
|
549
|
-
primary_metric: Optional[str] = None
|
|
550
|
-
"""The evaluation metric used to optimize the forecasting model."""
|
|
551
|
-
|
|
552
|
-
register_to: Optional[str] = None
|
|
553
|
-
"""The fully qualified path of a Unity Catalog model, formatted as
|
|
554
|
-
catalog_name.schema_name.model_name, used to store the best model."""
|
|
555
|
-
|
|
556
|
-
split_column: Optional[str] = None
|
|
557
|
-
"""// The column in the training table used for custom data splits. Values must be 'train',
|
|
558
|
-
'validate', or 'test'."""
|
|
559
|
-
|
|
560
|
-
timeseries_identifier_columns: Optional[List[str]] = None
|
|
561
|
-
"""The column in the training table used to group the dataset for predicting individual time
|
|
562
|
-
series."""
|
|
563
|
-
|
|
564
|
-
training_frameworks: Optional[List[str]] = None
|
|
565
|
-
"""List of frameworks to include for model tuning. Possible values are 'Prophet', 'ARIMA',
|
|
566
|
-
'DeepAR'. An empty list includes all supported frameworks."""
|
|
567
|
-
|
|
568
|
-
def as_dict(self) -> dict:
|
|
569
|
-
"""Serializes the CreateForecastingExperimentRequest into a dictionary suitable for use as a JSON request body."""
|
|
570
|
-
body = {}
|
|
571
|
-
if self.custom_weights_column is not None:
|
|
572
|
-
body["custom_weights_column"] = self.custom_weights_column
|
|
573
|
-
if self.experiment_path is not None:
|
|
574
|
-
body["experiment_path"] = self.experiment_path
|
|
575
|
-
if self.forecast_granularity is not None:
|
|
576
|
-
body["forecast_granularity"] = self.forecast_granularity
|
|
577
|
-
if self.forecast_horizon is not None:
|
|
578
|
-
body["forecast_horizon"] = self.forecast_horizon
|
|
579
|
-
if self.future_feature_data_path is not None:
|
|
580
|
-
body["future_feature_data_path"] = self.future_feature_data_path
|
|
581
|
-
if self.holiday_regions:
|
|
582
|
-
body["holiday_regions"] = [v for v in self.holiday_regions]
|
|
583
|
-
if self.include_features:
|
|
584
|
-
body["include_features"] = [v for v in self.include_features]
|
|
585
|
-
if self.max_runtime is not None:
|
|
586
|
-
body["max_runtime"] = self.max_runtime
|
|
587
|
-
if self.prediction_data_path is not None:
|
|
588
|
-
body["prediction_data_path"] = self.prediction_data_path
|
|
589
|
-
if self.primary_metric is not None:
|
|
590
|
-
body["primary_metric"] = self.primary_metric
|
|
591
|
-
if self.register_to is not None:
|
|
592
|
-
body["register_to"] = self.register_to
|
|
593
|
-
if self.split_column is not None:
|
|
594
|
-
body["split_column"] = self.split_column
|
|
595
|
-
if self.target_column is not None:
|
|
596
|
-
body["target_column"] = self.target_column
|
|
597
|
-
if self.time_column is not None:
|
|
598
|
-
body["time_column"] = self.time_column
|
|
599
|
-
if self.timeseries_identifier_columns:
|
|
600
|
-
body["timeseries_identifier_columns"] = [v for v in self.timeseries_identifier_columns]
|
|
601
|
-
if self.train_data_path is not None:
|
|
602
|
-
body["train_data_path"] = self.train_data_path
|
|
603
|
-
if self.training_frameworks:
|
|
604
|
-
body["training_frameworks"] = [v for v in self.training_frameworks]
|
|
605
|
-
return body
|
|
606
|
-
|
|
607
|
-
def as_shallow_dict(self) -> dict:
|
|
608
|
-
"""Serializes the CreateForecastingExperimentRequest into a shallow dictionary of its immediate attributes."""
|
|
609
|
-
body = {}
|
|
610
|
-
if self.custom_weights_column is not None:
|
|
611
|
-
body["custom_weights_column"] = self.custom_weights_column
|
|
612
|
-
if self.experiment_path is not None:
|
|
613
|
-
body["experiment_path"] = self.experiment_path
|
|
614
|
-
if self.forecast_granularity is not None:
|
|
615
|
-
body["forecast_granularity"] = self.forecast_granularity
|
|
616
|
-
if self.forecast_horizon is not None:
|
|
617
|
-
body["forecast_horizon"] = self.forecast_horizon
|
|
618
|
-
if self.future_feature_data_path is not None:
|
|
619
|
-
body["future_feature_data_path"] = self.future_feature_data_path
|
|
620
|
-
if self.holiday_regions:
|
|
621
|
-
body["holiday_regions"] = self.holiday_regions
|
|
622
|
-
if self.include_features:
|
|
623
|
-
body["include_features"] = self.include_features
|
|
624
|
-
if self.max_runtime is not None:
|
|
625
|
-
body["max_runtime"] = self.max_runtime
|
|
626
|
-
if self.prediction_data_path is not None:
|
|
627
|
-
body["prediction_data_path"] = self.prediction_data_path
|
|
628
|
-
if self.primary_metric is not None:
|
|
629
|
-
body["primary_metric"] = self.primary_metric
|
|
630
|
-
if self.register_to is not None:
|
|
631
|
-
body["register_to"] = self.register_to
|
|
632
|
-
if self.split_column is not None:
|
|
633
|
-
body["split_column"] = self.split_column
|
|
634
|
-
if self.target_column is not None:
|
|
635
|
-
body["target_column"] = self.target_column
|
|
636
|
-
if self.time_column is not None:
|
|
637
|
-
body["time_column"] = self.time_column
|
|
638
|
-
if self.timeseries_identifier_columns:
|
|
639
|
-
body["timeseries_identifier_columns"] = self.timeseries_identifier_columns
|
|
640
|
-
if self.train_data_path is not None:
|
|
641
|
-
body["train_data_path"] = self.train_data_path
|
|
642
|
-
if self.training_frameworks:
|
|
643
|
-
body["training_frameworks"] = self.training_frameworks
|
|
644
|
-
return body
|
|
645
|
-
|
|
646
|
-
@classmethod
|
|
647
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateForecastingExperimentRequest:
|
|
648
|
-
"""Deserializes the CreateForecastingExperimentRequest from a dictionary."""
|
|
649
|
-
return cls(
|
|
650
|
-
custom_weights_column=d.get("custom_weights_column", None),
|
|
651
|
-
experiment_path=d.get("experiment_path", None),
|
|
652
|
-
forecast_granularity=d.get("forecast_granularity", None),
|
|
653
|
-
forecast_horizon=d.get("forecast_horizon", None),
|
|
654
|
-
future_feature_data_path=d.get("future_feature_data_path", None),
|
|
655
|
-
holiday_regions=d.get("holiday_regions", None),
|
|
656
|
-
include_features=d.get("include_features", None),
|
|
657
|
-
max_runtime=d.get("max_runtime", None),
|
|
658
|
-
prediction_data_path=d.get("prediction_data_path", None),
|
|
659
|
-
primary_metric=d.get("primary_metric", None),
|
|
660
|
-
register_to=d.get("register_to", None),
|
|
661
|
-
split_column=d.get("split_column", None),
|
|
662
|
-
target_column=d.get("target_column", None),
|
|
663
|
-
time_column=d.get("time_column", None),
|
|
664
|
-
timeseries_identifier_columns=d.get("timeseries_identifier_columns", None),
|
|
665
|
-
train_data_path=d.get("train_data_path", None),
|
|
666
|
-
training_frameworks=d.get("training_frameworks", None),
|
|
667
|
-
)
|
|
668
|
-
|
|
669
|
-
|
|
670
342
|
@dataclass
|
|
671
343
|
class CreateForecastingExperimentResponse:
|
|
672
344
|
experiment_id: Optional[str] = None
|
|
@@ -692,73 +364,6 @@ class CreateForecastingExperimentResponse:
|
|
|
692
364
|
return cls(experiment_id=d.get("experiment_id", None))
|
|
693
365
|
|
|
694
366
|
|
|
695
|
-
@dataclass
|
|
696
|
-
class CreateLoggedModelRequest:
|
|
697
|
-
experiment_id: str
|
|
698
|
-
"""The ID of the experiment that owns the model."""
|
|
699
|
-
|
|
700
|
-
model_type: Optional[str] = None
|
|
701
|
-
"""The type of the model, such as ``"Agent"``, ``"Classifier"``, ``"LLM"``."""
|
|
702
|
-
|
|
703
|
-
name: Optional[str] = None
|
|
704
|
-
"""The name of the model (optional). If not specified one will be generated."""
|
|
705
|
-
|
|
706
|
-
params: Optional[List[LoggedModelParameter]] = None
|
|
707
|
-
"""Parameters attached to the model."""
|
|
708
|
-
|
|
709
|
-
source_run_id: Optional[str] = None
|
|
710
|
-
"""The ID of the run that created the model."""
|
|
711
|
-
|
|
712
|
-
tags: Optional[List[LoggedModelTag]] = None
|
|
713
|
-
"""Tags attached to the model."""
|
|
714
|
-
|
|
715
|
-
def as_dict(self) -> dict:
|
|
716
|
-
"""Serializes the CreateLoggedModelRequest into a dictionary suitable for use as a JSON request body."""
|
|
717
|
-
body = {}
|
|
718
|
-
if self.experiment_id is not None:
|
|
719
|
-
body["experiment_id"] = self.experiment_id
|
|
720
|
-
if self.model_type is not None:
|
|
721
|
-
body["model_type"] = self.model_type
|
|
722
|
-
if self.name is not None:
|
|
723
|
-
body["name"] = self.name
|
|
724
|
-
if self.params:
|
|
725
|
-
body["params"] = [v.as_dict() for v in self.params]
|
|
726
|
-
if self.source_run_id is not None:
|
|
727
|
-
body["source_run_id"] = self.source_run_id
|
|
728
|
-
if self.tags:
|
|
729
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
730
|
-
return body
|
|
731
|
-
|
|
732
|
-
def as_shallow_dict(self) -> dict:
|
|
733
|
-
"""Serializes the CreateLoggedModelRequest into a shallow dictionary of its immediate attributes."""
|
|
734
|
-
body = {}
|
|
735
|
-
if self.experiment_id is not None:
|
|
736
|
-
body["experiment_id"] = self.experiment_id
|
|
737
|
-
if self.model_type is not None:
|
|
738
|
-
body["model_type"] = self.model_type
|
|
739
|
-
if self.name is not None:
|
|
740
|
-
body["name"] = self.name
|
|
741
|
-
if self.params:
|
|
742
|
-
body["params"] = self.params
|
|
743
|
-
if self.source_run_id is not None:
|
|
744
|
-
body["source_run_id"] = self.source_run_id
|
|
745
|
-
if self.tags:
|
|
746
|
-
body["tags"] = self.tags
|
|
747
|
-
return body
|
|
748
|
-
|
|
749
|
-
@classmethod
|
|
750
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateLoggedModelRequest:
|
|
751
|
-
"""Deserializes the CreateLoggedModelRequest from a dictionary."""
|
|
752
|
-
return cls(
|
|
753
|
-
experiment_id=d.get("experiment_id", None),
|
|
754
|
-
model_type=d.get("model_type", None),
|
|
755
|
-
name=d.get("name", None),
|
|
756
|
-
params=_repeated_dict(d, "params", LoggedModelParameter),
|
|
757
|
-
source_run_id=d.get("source_run_id", None),
|
|
758
|
-
tags=_repeated_dict(d, "tags", LoggedModelTag),
|
|
759
|
-
)
|
|
760
|
-
|
|
761
|
-
|
|
762
367
|
@dataclass
|
|
763
368
|
class CreateLoggedModelResponse:
|
|
764
369
|
model: Optional[LoggedModel] = None
|
|
@@ -784,47 +389,6 @@ class CreateLoggedModelResponse:
|
|
|
784
389
|
return cls(model=_from_dict(d, "model", LoggedModel))
|
|
785
390
|
|
|
786
391
|
|
|
787
|
-
@dataclass
|
|
788
|
-
class CreateModelRequest:
|
|
789
|
-
name: str
|
|
790
|
-
"""Register models under this name"""
|
|
791
|
-
|
|
792
|
-
description: Optional[str] = None
|
|
793
|
-
"""Optional description for registered model."""
|
|
794
|
-
|
|
795
|
-
tags: Optional[List[ModelTag]] = None
|
|
796
|
-
"""Additional metadata for registered model."""
|
|
797
|
-
|
|
798
|
-
def as_dict(self) -> dict:
|
|
799
|
-
"""Serializes the CreateModelRequest into a dictionary suitable for use as a JSON request body."""
|
|
800
|
-
body = {}
|
|
801
|
-
if self.description is not None:
|
|
802
|
-
body["description"] = self.description
|
|
803
|
-
if self.name is not None:
|
|
804
|
-
body["name"] = self.name
|
|
805
|
-
if self.tags:
|
|
806
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
807
|
-
return body
|
|
808
|
-
|
|
809
|
-
def as_shallow_dict(self) -> dict:
|
|
810
|
-
"""Serializes the CreateModelRequest into a shallow dictionary of its immediate attributes."""
|
|
811
|
-
body = {}
|
|
812
|
-
if self.description is not None:
|
|
813
|
-
body["description"] = self.description
|
|
814
|
-
if self.name is not None:
|
|
815
|
-
body["name"] = self.name
|
|
816
|
-
if self.tags:
|
|
817
|
-
body["tags"] = self.tags
|
|
818
|
-
return body
|
|
819
|
-
|
|
820
|
-
@classmethod
|
|
821
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateModelRequest:
|
|
822
|
-
"""Deserializes the CreateModelRequest from a dictionary."""
|
|
823
|
-
return cls(
|
|
824
|
-
description=d.get("description", None), name=d.get("name", None), tags=_repeated_dict(d, "tags", ModelTag)
|
|
825
|
-
)
|
|
826
|
-
|
|
827
|
-
|
|
828
392
|
@dataclass
|
|
829
393
|
class CreateModelResponse:
|
|
830
394
|
registered_model: Optional[Model] = None
|
|
@@ -850,276 +414,44 @@ class CreateModelResponse:
|
|
|
850
414
|
|
|
851
415
|
|
|
852
416
|
@dataclass
|
|
853
|
-
class
|
|
854
|
-
|
|
855
|
-
"""
|
|
417
|
+
class CreateModelVersionResponse:
|
|
418
|
+
model_version: Optional[ModelVersion] = None
|
|
419
|
+
"""Return new version number generated for this model in registry."""
|
|
856
420
|
|
|
857
|
-
|
|
858
|
-
|
|
421
|
+
def as_dict(self) -> dict:
|
|
422
|
+
"""Serializes the CreateModelVersionResponse into a dictionary suitable for use as a JSON request body."""
|
|
423
|
+
body = {}
|
|
424
|
+
if self.model_version:
|
|
425
|
+
body["model_version"] = self.model_version.as_dict()
|
|
426
|
+
return body
|
|
859
427
|
|
|
860
|
-
|
|
861
|
-
|
|
428
|
+
def as_shallow_dict(self) -> dict:
|
|
429
|
+
"""Serializes the CreateModelVersionResponse into a shallow dictionary of its immediate attributes."""
|
|
430
|
+
body = {}
|
|
431
|
+
if self.model_version:
|
|
432
|
+
body["model_version"] = self.model_version
|
|
433
|
+
return body
|
|
862
434
|
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
435
|
+
@classmethod
|
|
436
|
+
def from_dict(cls, d: Dict[str, Any]) -> CreateModelVersionResponse:
|
|
437
|
+
"""Deserializes the CreateModelVersionResponse from a dictionary."""
|
|
438
|
+
return cls(model_version=_from_dict(d, "model_version", ModelVersion))
|
|
866
439
|
|
|
867
|
-
run_link: Optional[str] = None
|
|
868
|
-
"""MLflow run link - this is the exact link of the run that generated this model version,
|
|
869
|
-
potentially hosted at another instance of MLflow."""
|
|
870
440
|
|
|
871
|
-
|
|
872
|
-
|
|
441
|
+
@dataclass
|
|
442
|
+
class CreateRunResponse:
|
|
443
|
+
run: Optional[Run] = None
|
|
444
|
+
"""The newly created run."""
|
|
873
445
|
|
|
874
446
|
def as_dict(self) -> dict:
|
|
875
|
-
"""Serializes the
|
|
447
|
+
"""Serializes the CreateRunResponse into a dictionary suitable for use as a JSON request body."""
|
|
876
448
|
body = {}
|
|
877
|
-
if self.
|
|
878
|
-
body["
|
|
879
|
-
if self.name is not None:
|
|
880
|
-
body["name"] = self.name
|
|
881
|
-
if self.run_id is not None:
|
|
882
|
-
body["run_id"] = self.run_id
|
|
883
|
-
if self.run_link is not None:
|
|
884
|
-
body["run_link"] = self.run_link
|
|
885
|
-
if self.source is not None:
|
|
886
|
-
body["source"] = self.source
|
|
887
|
-
if self.tags:
|
|
888
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
449
|
+
if self.run:
|
|
450
|
+
body["run"] = self.run.as_dict()
|
|
889
451
|
return body
|
|
890
452
|
|
|
891
453
|
def as_shallow_dict(self) -> dict:
|
|
892
|
-
"""Serializes the
|
|
893
|
-
body = {}
|
|
894
|
-
if self.description is not None:
|
|
895
|
-
body["description"] = self.description
|
|
896
|
-
if self.name is not None:
|
|
897
|
-
body["name"] = self.name
|
|
898
|
-
if self.run_id is not None:
|
|
899
|
-
body["run_id"] = self.run_id
|
|
900
|
-
if self.run_link is not None:
|
|
901
|
-
body["run_link"] = self.run_link
|
|
902
|
-
if self.source is not None:
|
|
903
|
-
body["source"] = self.source
|
|
904
|
-
if self.tags:
|
|
905
|
-
body["tags"] = self.tags
|
|
906
|
-
return body
|
|
907
|
-
|
|
908
|
-
@classmethod
|
|
909
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateModelVersionRequest:
|
|
910
|
-
"""Deserializes the CreateModelVersionRequest from a dictionary."""
|
|
911
|
-
return cls(
|
|
912
|
-
description=d.get("description", None),
|
|
913
|
-
name=d.get("name", None),
|
|
914
|
-
run_id=d.get("run_id", None),
|
|
915
|
-
run_link=d.get("run_link", None),
|
|
916
|
-
source=d.get("source", None),
|
|
917
|
-
tags=_repeated_dict(d, "tags", ModelVersionTag),
|
|
918
|
-
)
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
@dataclass
|
|
922
|
-
class CreateModelVersionResponse:
|
|
923
|
-
model_version: Optional[ModelVersion] = None
|
|
924
|
-
"""Return new version number generated for this model in registry."""
|
|
925
|
-
|
|
926
|
-
def as_dict(self) -> dict:
|
|
927
|
-
"""Serializes the CreateModelVersionResponse into a dictionary suitable for use as a JSON request body."""
|
|
928
|
-
body = {}
|
|
929
|
-
if self.model_version:
|
|
930
|
-
body["model_version"] = self.model_version.as_dict()
|
|
931
|
-
return body
|
|
932
|
-
|
|
933
|
-
def as_shallow_dict(self) -> dict:
|
|
934
|
-
"""Serializes the CreateModelVersionResponse into a shallow dictionary of its immediate attributes."""
|
|
935
|
-
body = {}
|
|
936
|
-
if self.model_version:
|
|
937
|
-
body["model_version"] = self.model_version
|
|
938
|
-
return body
|
|
939
|
-
|
|
940
|
-
@classmethod
|
|
941
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateModelVersionResponse:
|
|
942
|
-
"""Deserializes the CreateModelVersionResponse from a dictionary."""
|
|
943
|
-
return cls(model_version=_from_dict(d, "model_version", ModelVersion))
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
@dataclass
|
|
947
|
-
class CreateRegistryWebhook:
|
|
948
|
-
"""Details required to create a registry webhook."""
|
|
949
|
-
|
|
950
|
-
events: List[RegistryWebhookEvent]
|
|
951
|
-
"""Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A new model version was
|
|
952
|
-
created for the associated model.
|
|
953
|
-
|
|
954
|
-
* `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was changed.
|
|
955
|
-
|
|
956
|
-
* `TRANSITION_REQUEST_CREATED`: A user requested a model version’s stage be transitioned.
|
|
957
|
-
|
|
958
|
-
* `COMMENT_CREATED`: A user wrote a comment on a registered model.
|
|
959
|
-
|
|
960
|
-
* `REGISTERED_MODEL_CREATED`: A new registered model was created. This event type can only be
|
|
961
|
-
specified for a registry-wide webhook, which can be created by not specifying a model name in
|
|
962
|
-
the create request.
|
|
963
|
-
|
|
964
|
-
* `MODEL_VERSION_TAG_SET`: A user set a tag on the model version.
|
|
965
|
-
|
|
966
|
-
* `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was transitioned to staging.
|
|
967
|
-
|
|
968
|
-
* `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was transitioned to production.
|
|
969
|
-
|
|
970
|
-
* `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived.
|
|
971
|
-
|
|
972
|
-
* `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model version be transitioned to
|
|
973
|
-
staging.
|
|
974
|
-
|
|
975
|
-
* `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model version be transitioned
|
|
976
|
-
to production.
|
|
977
|
-
|
|
978
|
-
* `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model version be archived."""
|
|
979
|
-
|
|
980
|
-
description: Optional[str] = None
|
|
981
|
-
"""User-specified description for the webhook."""
|
|
982
|
-
|
|
983
|
-
http_url_spec: Optional[HttpUrlSpec] = None
|
|
984
|
-
"""External HTTPS URL called on event trigger (by using a POST request)."""
|
|
985
|
-
|
|
986
|
-
job_spec: Optional[JobSpec] = None
|
|
987
|
-
"""ID of the job that the webhook runs."""
|
|
988
|
-
|
|
989
|
-
model_name: Optional[str] = None
|
|
990
|
-
"""If model name is not specified, a registry-wide webhook is created that listens for the
|
|
991
|
-
specified events across all versions of all registered models."""
|
|
992
|
-
|
|
993
|
-
status: Optional[RegistryWebhookStatus] = None
|
|
994
|
-
"""Enable or disable triggering the webhook, or put the webhook into test mode. The default is
|
|
995
|
-
`ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.
|
|
996
|
-
|
|
997
|
-
* `DISABLED`: Webhook is not triggered.
|
|
998
|
-
|
|
999
|
-
* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a
|
|
1000
|
-
real event."""
|
|
1001
|
-
|
|
1002
|
-
def as_dict(self) -> dict:
|
|
1003
|
-
"""Serializes the CreateRegistryWebhook into a dictionary suitable for use as a JSON request body."""
|
|
1004
|
-
body = {}
|
|
1005
|
-
if self.description is not None:
|
|
1006
|
-
body["description"] = self.description
|
|
1007
|
-
if self.events:
|
|
1008
|
-
body["events"] = [v.value for v in self.events]
|
|
1009
|
-
if self.http_url_spec:
|
|
1010
|
-
body["http_url_spec"] = self.http_url_spec.as_dict()
|
|
1011
|
-
if self.job_spec:
|
|
1012
|
-
body["job_spec"] = self.job_spec.as_dict()
|
|
1013
|
-
if self.model_name is not None:
|
|
1014
|
-
body["model_name"] = self.model_name
|
|
1015
|
-
if self.status is not None:
|
|
1016
|
-
body["status"] = self.status.value
|
|
1017
|
-
return body
|
|
1018
|
-
|
|
1019
|
-
def as_shallow_dict(self) -> dict:
|
|
1020
|
-
"""Serializes the CreateRegistryWebhook into a shallow dictionary of its immediate attributes."""
|
|
1021
|
-
body = {}
|
|
1022
|
-
if self.description is not None:
|
|
1023
|
-
body["description"] = self.description
|
|
1024
|
-
if self.events:
|
|
1025
|
-
body["events"] = self.events
|
|
1026
|
-
if self.http_url_spec:
|
|
1027
|
-
body["http_url_spec"] = self.http_url_spec
|
|
1028
|
-
if self.job_spec:
|
|
1029
|
-
body["job_spec"] = self.job_spec
|
|
1030
|
-
if self.model_name is not None:
|
|
1031
|
-
body["model_name"] = self.model_name
|
|
1032
|
-
if self.status is not None:
|
|
1033
|
-
body["status"] = self.status
|
|
1034
|
-
return body
|
|
1035
|
-
|
|
1036
|
-
@classmethod
|
|
1037
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateRegistryWebhook:
|
|
1038
|
-
"""Deserializes the CreateRegistryWebhook from a dictionary."""
|
|
1039
|
-
return cls(
|
|
1040
|
-
description=d.get("description", None),
|
|
1041
|
-
events=_repeated_enum(d, "events", RegistryWebhookEvent),
|
|
1042
|
-
http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpec),
|
|
1043
|
-
job_spec=_from_dict(d, "job_spec", JobSpec),
|
|
1044
|
-
model_name=d.get("model_name", None),
|
|
1045
|
-
status=_enum(d, "status", RegistryWebhookStatus),
|
|
1046
|
-
)
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
@dataclass
|
|
1050
|
-
class CreateRun:
|
|
1051
|
-
experiment_id: Optional[str] = None
|
|
1052
|
-
"""ID of the associated experiment."""
|
|
1053
|
-
|
|
1054
|
-
run_name: Optional[str] = None
|
|
1055
|
-
"""The name of the run."""
|
|
1056
|
-
|
|
1057
|
-
start_time: Optional[int] = None
|
|
1058
|
-
"""Unix timestamp in milliseconds of when the run started."""
|
|
1059
|
-
|
|
1060
|
-
tags: Optional[List[RunTag]] = None
|
|
1061
|
-
"""Additional metadata for run."""
|
|
1062
|
-
|
|
1063
|
-
user_id: Optional[str] = None
|
|
1064
|
-
"""ID of the user executing the run. This field is deprecated as of MLflow 1.0, and will be removed
|
|
1065
|
-
in a future MLflow release. Use 'mlflow.user' tag instead."""
|
|
1066
|
-
|
|
1067
|
-
def as_dict(self) -> dict:
|
|
1068
|
-
"""Serializes the CreateRun into a dictionary suitable for use as a JSON request body."""
|
|
1069
|
-
body = {}
|
|
1070
|
-
if self.experiment_id is not None:
|
|
1071
|
-
body["experiment_id"] = self.experiment_id
|
|
1072
|
-
if self.run_name is not None:
|
|
1073
|
-
body["run_name"] = self.run_name
|
|
1074
|
-
if self.start_time is not None:
|
|
1075
|
-
body["start_time"] = self.start_time
|
|
1076
|
-
if self.tags:
|
|
1077
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
1078
|
-
if self.user_id is not None:
|
|
1079
|
-
body["user_id"] = self.user_id
|
|
1080
|
-
return body
|
|
1081
|
-
|
|
1082
|
-
def as_shallow_dict(self) -> dict:
|
|
1083
|
-
"""Serializes the CreateRun into a shallow dictionary of its immediate attributes."""
|
|
1084
|
-
body = {}
|
|
1085
|
-
if self.experiment_id is not None:
|
|
1086
|
-
body["experiment_id"] = self.experiment_id
|
|
1087
|
-
if self.run_name is not None:
|
|
1088
|
-
body["run_name"] = self.run_name
|
|
1089
|
-
if self.start_time is not None:
|
|
1090
|
-
body["start_time"] = self.start_time
|
|
1091
|
-
if self.tags:
|
|
1092
|
-
body["tags"] = self.tags
|
|
1093
|
-
if self.user_id is not None:
|
|
1094
|
-
body["user_id"] = self.user_id
|
|
1095
|
-
return body
|
|
1096
|
-
|
|
1097
|
-
@classmethod
|
|
1098
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateRun:
|
|
1099
|
-
"""Deserializes the CreateRun from a dictionary."""
|
|
1100
|
-
return cls(
|
|
1101
|
-
experiment_id=d.get("experiment_id", None),
|
|
1102
|
-
run_name=d.get("run_name", None),
|
|
1103
|
-
start_time=d.get("start_time", None),
|
|
1104
|
-
tags=_repeated_dict(d, "tags", RunTag),
|
|
1105
|
-
user_id=d.get("user_id", None),
|
|
1106
|
-
)
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
@dataclass
|
|
1110
|
-
class CreateRunResponse:
|
|
1111
|
-
run: Optional[Run] = None
|
|
1112
|
-
"""The newly created run."""
|
|
1113
|
-
|
|
1114
|
-
def as_dict(self) -> dict:
|
|
1115
|
-
"""Serializes the CreateRunResponse into a dictionary suitable for use as a JSON request body."""
|
|
1116
|
-
body = {}
|
|
1117
|
-
if self.run:
|
|
1118
|
-
body["run"] = self.run.as_dict()
|
|
1119
|
-
return body
|
|
1120
|
-
|
|
1121
|
-
def as_shallow_dict(self) -> dict:
|
|
1122
|
-
"""Serializes the CreateRunResponse into a shallow dictionary of its immediate attributes."""
|
|
454
|
+
"""Serializes the CreateRunResponse into a shallow dictionary of its immediate attributes."""
|
|
1123
455
|
body = {}
|
|
1124
456
|
if self.run:
|
|
1125
457
|
body["run"] = self.run
|
|
@@ -1131,67 +463,6 @@ class CreateRunResponse:
|
|
|
1131
463
|
return cls(run=_from_dict(d, "run", Run))
|
|
1132
464
|
|
|
1133
465
|
|
|
1134
|
-
@dataclass
|
|
1135
|
-
class CreateTransitionRequest:
|
|
1136
|
-
"""Details required to create a model version stage transition request."""
|
|
1137
|
-
|
|
1138
|
-
name: str
|
|
1139
|
-
"""Name of the model."""
|
|
1140
|
-
|
|
1141
|
-
version: str
|
|
1142
|
-
"""Version of the model."""
|
|
1143
|
-
|
|
1144
|
-
stage: str
|
|
1145
|
-
"""Target stage of the transition. Valid values are:
|
|
1146
|
-
|
|
1147
|
-
* `None`: The initial stage of a model version.
|
|
1148
|
-
|
|
1149
|
-
* `Staging`: Staging or pre-production stage.
|
|
1150
|
-
|
|
1151
|
-
* `Production`: Production stage.
|
|
1152
|
-
|
|
1153
|
-
* `Archived`: Archived stage."""
|
|
1154
|
-
|
|
1155
|
-
comment: Optional[str] = None
|
|
1156
|
-
"""User-provided comment on the action."""
|
|
1157
|
-
|
|
1158
|
-
def as_dict(self) -> dict:
|
|
1159
|
-
"""Serializes the CreateTransitionRequest into a dictionary suitable for use as a JSON request body."""
|
|
1160
|
-
body = {}
|
|
1161
|
-
if self.comment is not None:
|
|
1162
|
-
body["comment"] = self.comment
|
|
1163
|
-
if self.name is not None:
|
|
1164
|
-
body["name"] = self.name
|
|
1165
|
-
if self.stage is not None:
|
|
1166
|
-
body["stage"] = self.stage
|
|
1167
|
-
if self.version is not None:
|
|
1168
|
-
body["version"] = self.version
|
|
1169
|
-
return body
|
|
1170
|
-
|
|
1171
|
-
def as_shallow_dict(self) -> dict:
|
|
1172
|
-
"""Serializes the CreateTransitionRequest into a shallow dictionary of its immediate attributes."""
|
|
1173
|
-
body = {}
|
|
1174
|
-
if self.comment is not None:
|
|
1175
|
-
body["comment"] = self.comment
|
|
1176
|
-
if self.name is not None:
|
|
1177
|
-
body["name"] = self.name
|
|
1178
|
-
if self.stage is not None:
|
|
1179
|
-
body["stage"] = self.stage
|
|
1180
|
-
if self.version is not None:
|
|
1181
|
-
body["version"] = self.version
|
|
1182
|
-
return body
|
|
1183
|
-
|
|
1184
|
-
@classmethod
|
|
1185
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateTransitionRequest:
|
|
1186
|
-
"""Deserializes the CreateTransitionRequest from a dictionary."""
|
|
1187
|
-
return cls(
|
|
1188
|
-
comment=d.get("comment", None),
|
|
1189
|
-
name=d.get("name", None),
|
|
1190
|
-
stage=d.get("stage", None),
|
|
1191
|
-
version=d.get("version", None),
|
|
1192
|
-
)
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
466
|
@dataclass
|
|
1196
467
|
class CreateTransitionRequestResponse:
|
|
1197
468
|
request: Optional[TransitionRequest] = None
|
|
@@ -1367,31 +638,6 @@ class DeleteCommentResponse:
|
|
|
1367
638
|
return cls()
|
|
1368
639
|
|
|
1369
640
|
|
|
1370
|
-
@dataclass
|
|
1371
|
-
class DeleteExperiment:
|
|
1372
|
-
experiment_id: str
|
|
1373
|
-
"""ID of the associated experiment."""
|
|
1374
|
-
|
|
1375
|
-
def as_dict(self) -> dict:
|
|
1376
|
-
"""Serializes the DeleteExperiment into a dictionary suitable for use as a JSON request body."""
|
|
1377
|
-
body = {}
|
|
1378
|
-
if self.experiment_id is not None:
|
|
1379
|
-
body["experiment_id"] = self.experiment_id
|
|
1380
|
-
return body
|
|
1381
|
-
|
|
1382
|
-
def as_shallow_dict(self) -> dict:
|
|
1383
|
-
"""Serializes the DeleteExperiment into a shallow dictionary of its immediate attributes."""
|
|
1384
|
-
body = {}
|
|
1385
|
-
if self.experiment_id is not None:
|
|
1386
|
-
body["experiment_id"] = self.experiment_id
|
|
1387
|
-
return body
|
|
1388
|
-
|
|
1389
|
-
@classmethod
|
|
1390
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteExperiment:
|
|
1391
|
-
"""Deserializes the DeleteExperiment from a dictionary."""
|
|
1392
|
-
return cls(experiment_id=d.get("experiment_id", None))
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
641
|
@dataclass
|
|
1396
642
|
class DeleteExperimentResponse:
|
|
1397
643
|
def as_dict(self) -> dict:
|
|
@@ -1518,31 +764,6 @@ class DeleteModelVersionTagResponse:
|
|
|
1518
764
|
return cls()
|
|
1519
765
|
|
|
1520
766
|
|
|
1521
|
-
@dataclass
|
|
1522
|
-
class DeleteRun:
|
|
1523
|
-
run_id: str
|
|
1524
|
-
"""ID of the run to delete."""
|
|
1525
|
-
|
|
1526
|
-
def as_dict(self) -> dict:
|
|
1527
|
-
"""Serializes the DeleteRun into a dictionary suitable for use as a JSON request body."""
|
|
1528
|
-
body = {}
|
|
1529
|
-
if self.run_id is not None:
|
|
1530
|
-
body["run_id"] = self.run_id
|
|
1531
|
-
return body
|
|
1532
|
-
|
|
1533
|
-
def as_shallow_dict(self) -> dict:
|
|
1534
|
-
"""Serializes the DeleteRun into a shallow dictionary of its immediate attributes."""
|
|
1535
|
-
body = {}
|
|
1536
|
-
if self.run_id is not None:
|
|
1537
|
-
body["run_id"] = self.run_id
|
|
1538
|
-
return body
|
|
1539
|
-
|
|
1540
|
-
@classmethod
|
|
1541
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteRun:
|
|
1542
|
-
"""Deserializes the DeleteRun from a dictionary."""
|
|
1543
|
-
return cls(run_id=d.get("run_id", None))
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
767
|
@dataclass
|
|
1547
768
|
class DeleteRunResponse:
|
|
1548
769
|
def as_dict(self) -> dict:
|
|
@@ -1561,51 +782,6 @@ class DeleteRunResponse:
|
|
|
1561
782
|
return cls()
|
|
1562
783
|
|
|
1563
784
|
|
|
1564
|
-
@dataclass
|
|
1565
|
-
class DeleteRuns:
|
|
1566
|
-
experiment_id: str
|
|
1567
|
-
"""The ID of the experiment containing the runs to delete."""
|
|
1568
|
-
|
|
1569
|
-
max_timestamp_millis: int
|
|
1570
|
-
"""The maximum creation timestamp in milliseconds since the UNIX epoch for deleting runs. Only runs
|
|
1571
|
-
created prior to or at this timestamp are deleted."""
|
|
1572
|
-
|
|
1573
|
-
max_runs: Optional[int] = None
|
|
1574
|
-
"""An optional positive integer indicating the maximum number of runs to delete. The maximum
|
|
1575
|
-
allowed value for max_runs is 10000."""
|
|
1576
|
-
|
|
1577
|
-
def as_dict(self) -> dict:
|
|
1578
|
-
"""Serializes the DeleteRuns into a dictionary suitable for use as a JSON request body."""
|
|
1579
|
-
body = {}
|
|
1580
|
-
if self.experiment_id is not None:
|
|
1581
|
-
body["experiment_id"] = self.experiment_id
|
|
1582
|
-
if self.max_runs is not None:
|
|
1583
|
-
body["max_runs"] = self.max_runs
|
|
1584
|
-
if self.max_timestamp_millis is not None:
|
|
1585
|
-
body["max_timestamp_millis"] = self.max_timestamp_millis
|
|
1586
|
-
return body
|
|
1587
|
-
|
|
1588
|
-
def as_shallow_dict(self) -> dict:
|
|
1589
|
-
"""Serializes the DeleteRuns into a shallow dictionary of its immediate attributes."""
|
|
1590
|
-
body = {}
|
|
1591
|
-
if self.experiment_id is not None:
|
|
1592
|
-
body["experiment_id"] = self.experiment_id
|
|
1593
|
-
if self.max_runs is not None:
|
|
1594
|
-
body["max_runs"] = self.max_runs
|
|
1595
|
-
if self.max_timestamp_millis is not None:
|
|
1596
|
-
body["max_timestamp_millis"] = self.max_timestamp_millis
|
|
1597
|
-
return body
|
|
1598
|
-
|
|
1599
|
-
@classmethod
|
|
1600
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteRuns:
|
|
1601
|
-
"""Deserializes the DeleteRuns from a dictionary."""
|
|
1602
|
-
return cls(
|
|
1603
|
-
experiment_id=d.get("experiment_id", None),
|
|
1604
|
-
max_runs=d.get("max_runs", None),
|
|
1605
|
-
max_timestamp_millis=d.get("max_timestamp_millis", None),
|
|
1606
|
-
)
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
785
|
@dataclass
|
|
1610
786
|
class DeleteRunsResponse:
|
|
1611
787
|
runs_deleted: Optional[int] = None
|
|
@@ -1631,38 +807,6 @@ class DeleteRunsResponse:
|
|
|
1631
807
|
return cls(runs_deleted=d.get("runs_deleted", None))
|
|
1632
808
|
|
|
1633
809
|
|
|
1634
|
-
@dataclass
|
|
1635
|
-
class DeleteTag:
|
|
1636
|
-
run_id: str
|
|
1637
|
-
"""ID of the run that the tag was logged under. Must be provided."""
|
|
1638
|
-
|
|
1639
|
-
key: str
|
|
1640
|
-
"""Name of the tag. Maximum size is 255 bytes. Must be provided."""
|
|
1641
|
-
|
|
1642
|
-
def as_dict(self) -> dict:
|
|
1643
|
-
"""Serializes the DeleteTag into a dictionary suitable for use as a JSON request body."""
|
|
1644
|
-
body = {}
|
|
1645
|
-
if self.key is not None:
|
|
1646
|
-
body["key"] = self.key
|
|
1647
|
-
if self.run_id is not None:
|
|
1648
|
-
body["run_id"] = self.run_id
|
|
1649
|
-
return body
|
|
1650
|
-
|
|
1651
|
-
def as_shallow_dict(self) -> dict:
|
|
1652
|
-
"""Serializes the DeleteTag into a shallow dictionary of its immediate attributes."""
|
|
1653
|
-
body = {}
|
|
1654
|
-
if self.key is not None:
|
|
1655
|
-
body["key"] = self.key
|
|
1656
|
-
if self.run_id is not None:
|
|
1657
|
-
body["run_id"] = self.run_id
|
|
1658
|
-
return body
|
|
1659
|
-
|
|
1660
|
-
@classmethod
|
|
1661
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteTag:
|
|
1662
|
-
"""Deserializes the DeleteTag from a dictionary."""
|
|
1663
|
-
return cls(key=d.get("key", None), run_id=d.get("run_id", None))
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
810
|
@dataclass
|
|
1667
811
|
class DeleteTagResponse:
|
|
1668
812
|
def as_dict(self) -> dict:
|
|
@@ -2032,40 +1176,6 @@ class ExperimentPermissionsDescription:
|
|
|
2032
1176
|
)
|
|
2033
1177
|
|
|
2034
1178
|
|
|
2035
|
-
@dataclass
|
|
2036
|
-
class ExperimentPermissionsRequest:
|
|
2037
|
-
access_control_list: Optional[List[ExperimentAccessControlRequest]] = None
|
|
2038
|
-
|
|
2039
|
-
experiment_id: Optional[str] = None
|
|
2040
|
-
"""The experiment for which to get or manage permissions."""
|
|
2041
|
-
|
|
2042
|
-
def as_dict(self) -> dict:
|
|
2043
|
-
"""Serializes the ExperimentPermissionsRequest into a dictionary suitable for use as a JSON request body."""
|
|
2044
|
-
body = {}
|
|
2045
|
-
if self.access_control_list:
|
|
2046
|
-
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
2047
|
-
if self.experiment_id is not None:
|
|
2048
|
-
body["experiment_id"] = self.experiment_id
|
|
2049
|
-
return body
|
|
2050
|
-
|
|
2051
|
-
def as_shallow_dict(self) -> dict:
|
|
2052
|
-
"""Serializes the ExperimentPermissionsRequest into a shallow dictionary of its immediate attributes."""
|
|
2053
|
-
body = {}
|
|
2054
|
-
if self.access_control_list:
|
|
2055
|
-
body["access_control_list"] = self.access_control_list
|
|
2056
|
-
if self.experiment_id is not None:
|
|
2057
|
-
body["experiment_id"] = self.experiment_id
|
|
2058
|
-
return body
|
|
2059
|
-
|
|
2060
|
-
@classmethod
|
|
2061
|
-
def from_dict(cls, d: Dict[str, Any]) -> ExperimentPermissionsRequest:
|
|
2062
|
-
"""Deserializes the ExperimentPermissionsRequest from a dictionary."""
|
|
2063
|
-
return cls(
|
|
2064
|
-
access_control_list=_repeated_dict(d, "access_control_list", ExperimentAccessControlRequest),
|
|
2065
|
-
experiment_id=d.get("experiment_id", None),
|
|
2066
|
-
)
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
1179
|
@dataclass
|
|
2070
1180
|
class ExperimentTag:
|
|
2071
1181
|
"""A tag for an experiment."""
|
|
@@ -2367,46 +1477,13 @@ class FileInfo:
|
|
|
2367
1477
|
if self.is_dir is not None:
|
|
2368
1478
|
body["is_dir"] = self.is_dir
|
|
2369
1479
|
if self.path is not None:
|
|
2370
|
-
body["path"] = self.path
|
|
2371
|
-
return body
|
|
2372
|
-
|
|
2373
|
-
@classmethod
|
|
2374
|
-
def from_dict(cls, d: Dict[str, Any]) -> FileInfo:
|
|
2375
|
-
"""Deserializes the FileInfo from a dictionary."""
|
|
2376
|
-
return cls(file_size=d.get("file_size", None), is_dir=d.get("is_dir", None), path=d.get("path", None))
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
@dataclass
|
|
2380
|
-
class FinalizeLoggedModelRequest:
|
|
2381
|
-
status: LoggedModelStatus
|
|
2382
|
-
"""Whether or not the model is ready for use. ``"LOGGED_MODEL_UPLOAD_FAILED"`` indicates that
|
|
2383
|
-
something went wrong when logging the model weights / agent code."""
|
|
2384
|
-
|
|
2385
|
-
model_id: Optional[str] = None
|
|
2386
|
-
"""The ID of the logged model to finalize."""
|
|
2387
|
-
|
|
2388
|
-
def as_dict(self) -> dict:
|
|
2389
|
-
"""Serializes the FinalizeLoggedModelRequest into a dictionary suitable for use as a JSON request body."""
|
|
2390
|
-
body = {}
|
|
2391
|
-
if self.model_id is not None:
|
|
2392
|
-
body["model_id"] = self.model_id
|
|
2393
|
-
if self.status is not None:
|
|
2394
|
-
body["status"] = self.status.value
|
|
2395
|
-
return body
|
|
2396
|
-
|
|
2397
|
-
def as_shallow_dict(self) -> dict:
|
|
2398
|
-
"""Serializes the FinalizeLoggedModelRequest into a shallow dictionary of its immediate attributes."""
|
|
2399
|
-
body = {}
|
|
2400
|
-
if self.model_id is not None:
|
|
2401
|
-
body["model_id"] = self.model_id
|
|
2402
|
-
if self.status is not None:
|
|
2403
|
-
body["status"] = self.status
|
|
1480
|
+
body["path"] = self.path
|
|
2404
1481
|
return body
|
|
2405
1482
|
|
|
2406
1483
|
@classmethod
|
|
2407
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2408
|
-
"""Deserializes the
|
|
2409
|
-
return cls(
|
|
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))
|
|
2410
1487
|
|
|
2411
1488
|
|
|
2412
1489
|
@dataclass
|
|
@@ -2563,38 +1640,6 @@ class GetExperimentResponse:
|
|
|
2563
1640
|
return cls(experiment=_from_dict(d, "experiment", Experiment))
|
|
2564
1641
|
|
|
2565
1642
|
|
|
2566
|
-
@dataclass
|
|
2567
|
-
class GetLatestVersionsRequest:
|
|
2568
|
-
name: str
|
|
2569
|
-
"""Registered model unique name identifier."""
|
|
2570
|
-
|
|
2571
|
-
stages: Optional[List[str]] = None
|
|
2572
|
-
"""List of stages."""
|
|
2573
|
-
|
|
2574
|
-
def as_dict(self) -> dict:
|
|
2575
|
-
"""Serializes the GetLatestVersionsRequest into a dictionary suitable for use as a JSON request body."""
|
|
2576
|
-
body = {}
|
|
2577
|
-
if self.name is not None:
|
|
2578
|
-
body["name"] = self.name
|
|
2579
|
-
if self.stages:
|
|
2580
|
-
body["stages"] = [v for v in self.stages]
|
|
2581
|
-
return body
|
|
2582
|
-
|
|
2583
|
-
def as_shallow_dict(self) -> dict:
|
|
2584
|
-
"""Serializes the GetLatestVersionsRequest into a shallow dictionary of its immediate attributes."""
|
|
2585
|
-
body = {}
|
|
2586
|
-
if self.name is not None:
|
|
2587
|
-
body["name"] = self.name
|
|
2588
|
-
if self.stages:
|
|
2589
|
-
body["stages"] = self.stages
|
|
2590
|
-
return body
|
|
2591
|
-
|
|
2592
|
-
@classmethod
|
|
2593
|
-
def from_dict(cls, d: Dict[str, Any]) -> GetLatestVersionsRequest:
|
|
2594
|
-
"""Deserializes the GetLatestVersionsRequest from a dictionary."""
|
|
2595
|
-
return cls(name=d.get("name", None), stages=d.get("stages", None))
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
1643
|
@dataclass
|
|
2599
1644
|
class GetLatestVersionsResponse:
|
|
2600
1645
|
model_versions: Optional[List[ModelVersion]] = None
|
|
@@ -3250,60 +2295,6 @@ class ListTransitionRequestsResponse:
|
|
|
3250
2295
|
return cls(requests=_repeated_dict(d, "requests", Activity))
|
|
3251
2296
|
|
|
3252
2297
|
|
|
3253
|
-
@dataclass
|
|
3254
|
-
class LogBatch:
|
|
3255
|
-
metrics: Optional[List[Metric]] = None
|
|
3256
|
-
"""Metrics to log. A single request can contain up to 1000 metrics, and up to 1000 metrics, params,
|
|
3257
|
-
and tags in total."""
|
|
3258
|
-
|
|
3259
|
-
params: Optional[List[Param]] = None
|
|
3260
|
-
"""Params to log. A single request can contain up to 100 params, and up to 1000 metrics, params,
|
|
3261
|
-
and tags in total."""
|
|
3262
|
-
|
|
3263
|
-
run_id: Optional[str] = None
|
|
3264
|
-
"""ID of the run to log under"""
|
|
3265
|
-
|
|
3266
|
-
tags: Optional[List[RunTag]] = None
|
|
3267
|
-
"""Tags to log. A single request can contain up to 100 tags, and up to 1000 metrics, params, and
|
|
3268
|
-
tags in total."""
|
|
3269
|
-
|
|
3270
|
-
def as_dict(self) -> dict:
|
|
3271
|
-
"""Serializes the LogBatch into a dictionary suitable for use as a JSON request body."""
|
|
3272
|
-
body = {}
|
|
3273
|
-
if self.metrics:
|
|
3274
|
-
body["metrics"] = [v.as_dict() for v in self.metrics]
|
|
3275
|
-
if self.params:
|
|
3276
|
-
body["params"] = [v.as_dict() for v in self.params]
|
|
3277
|
-
if self.run_id is not None:
|
|
3278
|
-
body["run_id"] = self.run_id
|
|
3279
|
-
if self.tags:
|
|
3280
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
3281
|
-
return body
|
|
3282
|
-
|
|
3283
|
-
def as_shallow_dict(self) -> dict:
|
|
3284
|
-
"""Serializes the LogBatch into a shallow dictionary of its immediate attributes."""
|
|
3285
|
-
body = {}
|
|
3286
|
-
if self.metrics:
|
|
3287
|
-
body["metrics"] = self.metrics
|
|
3288
|
-
if self.params:
|
|
3289
|
-
body["params"] = self.params
|
|
3290
|
-
if self.run_id is not None:
|
|
3291
|
-
body["run_id"] = self.run_id
|
|
3292
|
-
if self.tags:
|
|
3293
|
-
body["tags"] = self.tags
|
|
3294
|
-
return body
|
|
3295
|
-
|
|
3296
|
-
@classmethod
|
|
3297
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogBatch:
|
|
3298
|
-
"""Deserializes the LogBatch from a dictionary."""
|
|
3299
|
-
return cls(
|
|
3300
|
-
metrics=_repeated_dict(d, "metrics", Metric),
|
|
3301
|
-
params=_repeated_dict(d, "params", Param),
|
|
3302
|
-
run_id=d.get("run_id", None),
|
|
3303
|
-
tags=_repeated_dict(d, "tags", RunTag),
|
|
3304
|
-
)
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
2298
|
@dataclass
|
|
3308
2299
|
class LogBatchResponse:
|
|
3309
2300
|
def as_dict(self) -> dict:
|
|
@@ -3322,49 +2313,6 @@ class LogBatchResponse:
|
|
|
3322
2313
|
return cls()
|
|
3323
2314
|
|
|
3324
2315
|
|
|
3325
|
-
@dataclass
|
|
3326
|
-
class LogInputs:
|
|
3327
|
-
run_id: str
|
|
3328
|
-
"""ID of the run to log under"""
|
|
3329
|
-
|
|
3330
|
-
datasets: Optional[List[DatasetInput]] = None
|
|
3331
|
-
"""Dataset inputs"""
|
|
3332
|
-
|
|
3333
|
-
models: Optional[List[ModelInput]] = None
|
|
3334
|
-
"""Model inputs"""
|
|
3335
|
-
|
|
3336
|
-
def as_dict(self) -> dict:
|
|
3337
|
-
"""Serializes the LogInputs into a dictionary suitable for use as a JSON request body."""
|
|
3338
|
-
body = {}
|
|
3339
|
-
if self.datasets:
|
|
3340
|
-
body["datasets"] = [v.as_dict() for v in self.datasets]
|
|
3341
|
-
if self.models:
|
|
3342
|
-
body["models"] = [v.as_dict() for v in self.models]
|
|
3343
|
-
if self.run_id is not None:
|
|
3344
|
-
body["run_id"] = self.run_id
|
|
3345
|
-
return body
|
|
3346
|
-
|
|
3347
|
-
def as_shallow_dict(self) -> dict:
|
|
3348
|
-
"""Serializes the LogInputs into a shallow dictionary of its immediate attributes."""
|
|
3349
|
-
body = {}
|
|
3350
|
-
if self.datasets:
|
|
3351
|
-
body["datasets"] = self.datasets
|
|
3352
|
-
if self.models:
|
|
3353
|
-
body["models"] = self.models
|
|
3354
|
-
if self.run_id is not None:
|
|
3355
|
-
body["run_id"] = self.run_id
|
|
3356
|
-
return body
|
|
3357
|
-
|
|
3358
|
-
@classmethod
|
|
3359
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogInputs:
|
|
3360
|
-
"""Deserializes the LogInputs from a dictionary."""
|
|
3361
|
-
return cls(
|
|
3362
|
-
datasets=_repeated_dict(d, "datasets", DatasetInput),
|
|
3363
|
-
models=_repeated_dict(d, "models", ModelInput),
|
|
3364
|
-
run_id=d.get("run_id", None),
|
|
3365
|
-
)
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
2316
|
@dataclass
|
|
3369
2317
|
class LogInputsResponse:
|
|
3370
2318
|
def as_dict(self) -> dict:
|
|
@@ -3383,38 +2331,6 @@ class LogInputsResponse:
|
|
|
3383
2331
|
return cls()
|
|
3384
2332
|
|
|
3385
2333
|
|
|
3386
|
-
@dataclass
|
|
3387
|
-
class LogLoggedModelParamsRequest:
|
|
3388
|
-
model_id: Optional[str] = None
|
|
3389
|
-
"""The ID of the logged model to log params for."""
|
|
3390
|
-
|
|
3391
|
-
params: Optional[List[LoggedModelParameter]] = None
|
|
3392
|
-
"""Parameters to attach to the model."""
|
|
3393
|
-
|
|
3394
|
-
def as_dict(self) -> dict:
|
|
3395
|
-
"""Serializes the LogLoggedModelParamsRequest into a dictionary suitable for use as a JSON request body."""
|
|
3396
|
-
body = {}
|
|
3397
|
-
if self.model_id is not None:
|
|
3398
|
-
body["model_id"] = self.model_id
|
|
3399
|
-
if self.params:
|
|
3400
|
-
body["params"] = [v.as_dict() for v in self.params]
|
|
3401
|
-
return body
|
|
3402
|
-
|
|
3403
|
-
def as_shallow_dict(self) -> dict:
|
|
3404
|
-
"""Serializes the LogLoggedModelParamsRequest into a shallow dictionary of its immediate attributes."""
|
|
3405
|
-
body = {}
|
|
3406
|
-
if self.model_id is not None:
|
|
3407
|
-
body["model_id"] = self.model_id
|
|
3408
|
-
if self.params:
|
|
3409
|
-
body["params"] = self.params
|
|
3410
|
-
return body
|
|
3411
|
-
|
|
3412
|
-
@classmethod
|
|
3413
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogLoggedModelParamsRequest:
|
|
3414
|
-
"""Deserializes the LogLoggedModelParamsRequest from a dictionary."""
|
|
3415
|
-
return cls(model_id=d.get("model_id", None), params=_repeated_dict(d, "params", LoggedModelParameter))
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
2334
|
@dataclass
|
|
3419
2335
|
class LogLoggedModelParamsRequestResponse:
|
|
3420
2336
|
def as_dict(self) -> dict:
|
|
@@ -3433,100 +2349,6 @@ class LogLoggedModelParamsRequestResponse:
|
|
|
3433
2349
|
return cls()
|
|
3434
2350
|
|
|
3435
2351
|
|
|
3436
|
-
@dataclass
|
|
3437
|
-
class LogMetric:
|
|
3438
|
-
key: str
|
|
3439
|
-
"""Name of the metric."""
|
|
3440
|
-
|
|
3441
|
-
value: float
|
|
3442
|
-
"""Double value of the metric being logged."""
|
|
3443
|
-
|
|
3444
|
-
timestamp: int
|
|
3445
|
-
"""Unix timestamp in milliseconds at the time metric was logged."""
|
|
3446
|
-
|
|
3447
|
-
dataset_digest: Optional[str] = None
|
|
3448
|
-
"""Dataset digest of the dataset associated with the metric, e.g. an md5 hash of the dataset that
|
|
3449
|
-
uniquely identifies it within datasets of the same name."""
|
|
3450
|
-
|
|
3451
|
-
dataset_name: Optional[str] = None
|
|
3452
|
-
"""The name of the dataset associated with the metric. E.g. “my.uc.table@2”
|
|
3453
|
-
“nyc-taxi-dataset”, “fantastic-elk-3”"""
|
|
3454
|
-
|
|
3455
|
-
model_id: Optional[str] = None
|
|
3456
|
-
"""ID of the logged model associated with the metric, if applicable"""
|
|
3457
|
-
|
|
3458
|
-
run_id: Optional[str] = None
|
|
3459
|
-
"""ID of the run under which to log the metric. Must be provided."""
|
|
3460
|
-
|
|
3461
|
-
run_uuid: Optional[str] = None
|
|
3462
|
-
"""[Deprecated, use `run_id` instead] ID of the run under which to log the metric. This field will
|
|
3463
|
-
be removed in a future MLflow version."""
|
|
3464
|
-
|
|
3465
|
-
step: Optional[int] = None
|
|
3466
|
-
"""Step at which to log the metric"""
|
|
3467
|
-
|
|
3468
|
-
def as_dict(self) -> dict:
|
|
3469
|
-
"""Serializes the LogMetric into a dictionary suitable for use as a JSON request body."""
|
|
3470
|
-
body = {}
|
|
3471
|
-
if self.dataset_digest is not None:
|
|
3472
|
-
body["dataset_digest"] = self.dataset_digest
|
|
3473
|
-
if self.dataset_name is not None:
|
|
3474
|
-
body["dataset_name"] = self.dataset_name
|
|
3475
|
-
if self.key is not None:
|
|
3476
|
-
body["key"] = self.key
|
|
3477
|
-
if self.model_id is not None:
|
|
3478
|
-
body["model_id"] = self.model_id
|
|
3479
|
-
if self.run_id is not None:
|
|
3480
|
-
body["run_id"] = self.run_id
|
|
3481
|
-
if self.run_uuid is not None:
|
|
3482
|
-
body["run_uuid"] = self.run_uuid
|
|
3483
|
-
if self.step is not None:
|
|
3484
|
-
body["step"] = self.step
|
|
3485
|
-
if self.timestamp is not None:
|
|
3486
|
-
body["timestamp"] = self.timestamp
|
|
3487
|
-
if self.value is not None:
|
|
3488
|
-
body["value"] = self.value
|
|
3489
|
-
return body
|
|
3490
|
-
|
|
3491
|
-
def as_shallow_dict(self) -> dict:
|
|
3492
|
-
"""Serializes the LogMetric into a shallow dictionary of its immediate attributes."""
|
|
3493
|
-
body = {}
|
|
3494
|
-
if self.dataset_digest is not None:
|
|
3495
|
-
body["dataset_digest"] = self.dataset_digest
|
|
3496
|
-
if self.dataset_name is not None:
|
|
3497
|
-
body["dataset_name"] = self.dataset_name
|
|
3498
|
-
if self.key is not None:
|
|
3499
|
-
body["key"] = self.key
|
|
3500
|
-
if self.model_id is not None:
|
|
3501
|
-
body["model_id"] = self.model_id
|
|
3502
|
-
if self.run_id is not None:
|
|
3503
|
-
body["run_id"] = self.run_id
|
|
3504
|
-
if self.run_uuid is not None:
|
|
3505
|
-
body["run_uuid"] = self.run_uuid
|
|
3506
|
-
if self.step is not None:
|
|
3507
|
-
body["step"] = self.step
|
|
3508
|
-
if self.timestamp is not None:
|
|
3509
|
-
body["timestamp"] = self.timestamp
|
|
3510
|
-
if self.value is not None:
|
|
3511
|
-
body["value"] = self.value
|
|
3512
|
-
return body
|
|
3513
|
-
|
|
3514
|
-
@classmethod
|
|
3515
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogMetric:
|
|
3516
|
-
"""Deserializes the LogMetric from a dictionary."""
|
|
3517
|
-
return cls(
|
|
3518
|
-
dataset_digest=d.get("dataset_digest", None),
|
|
3519
|
-
dataset_name=d.get("dataset_name", None),
|
|
3520
|
-
key=d.get("key", None),
|
|
3521
|
-
model_id=d.get("model_id", None),
|
|
3522
|
-
run_id=d.get("run_id", None),
|
|
3523
|
-
run_uuid=d.get("run_uuid", None),
|
|
3524
|
-
step=d.get("step", None),
|
|
3525
|
-
timestamp=d.get("timestamp", None),
|
|
3526
|
-
value=d.get("value", None),
|
|
3527
|
-
)
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
2352
|
@dataclass
|
|
3531
2353
|
class LogMetricResponse:
|
|
3532
2354
|
def as_dict(self) -> dict:
|
|
@@ -3535,166 +2357,50 @@ class LogMetricResponse:
|
|
|
3535
2357
|
return body
|
|
3536
2358
|
|
|
3537
2359
|
def as_shallow_dict(self) -> dict:
|
|
3538
|
-
"""Serializes the LogMetricResponse into a shallow dictionary of its immediate attributes."""
|
|
3539
|
-
body = {}
|
|
3540
|
-
return body
|
|
3541
|
-
|
|
3542
|
-
@classmethod
|
|
3543
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogMetricResponse:
|
|
3544
|
-
"""Deserializes the LogMetricResponse from a dictionary."""
|
|
3545
|
-
return cls()
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
@dataclass
|
|
3549
|
-
class LogModel:
|
|
3550
|
-
model_json: Optional[str] = None
|
|
3551
|
-
"""MLmodel file in json format."""
|
|
3552
|
-
|
|
3553
|
-
run_id: Optional[str] = None
|
|
3554
|
-
"""ID of the run to log under"""
|
|
3555
|
-
|
|
3556
|
-
def as_dict(self) -> dict:
|
|
3557
|
-
"""Serializes the LogModel into a dictionary suitable for use as a JSON request body."""
|
|
3558
|
-
body = {}
|
|
3559
|
-
if self.model_json is not None:
|
|
3560
|
-
body["model_json"] = self.model_json
|
|
3561
|
-
if self.run_id is not None:
|
|
3562
|
-
body["run_id"] = self.run_id
|
|
3563
|
-
return body
|
|
3564
|
-
|
|
3565
|
-
def as_shallow_dict(self) -> dict:
|
|
3566
|
-
"""Serializes the LogModel into a shallow dictionary of its immediate attributes."""
|
|
3567
|
-
body = {}
|
|
3568
|
-
if self.model_json is not None:
|
|
3569
|
-
body["model_json"] = self.model_json
|
|
3570
|
-
if self.run_id is not None:
|
|
3571
|
-
body["run_id"] = self.run_id
|
|
3572
|
-
return body
|
|
3573
|
-
|
|
3574
|
-
@classmethod
|
|
3575
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogModel:
|
|
3576
|
-
"""Deserializes the LogModel from a dictionary."""
|
|
3577
|
-
return cls(model_json=d.get("model_json", None), run_id=d.get("run_id", None))
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
@dataclass
|
|
3581
|
-
class LogModelResponse:
|
|
3582
|
-
def as_dict(self) -> dict:
|
|
3583
|
-
"""Serializes the LogModelResponse into a dictionary suitable for use as a JSON request body."""
|
|
3584
|
-
body = {}
|
|
3585
|
-
return body
|
|
3586
|
-
|
|
3587
|
-
def as_shallow_dict(self) -> dict:
|
|
3588
|
-
"""Serializes the LogModelResponse into a shallow dictionary of its immediate attributes."""
|
|
3589
|
-
body = {}
|
|
3590
|
-
return body
|
|
3591
|
-
|
|
3592
|
-
@classmethod
|
|
3593
|
-
def from_dict(cls, d: Dict[str, Any]) -> LogModelResponse:
|
|
3594
|
-
"""Deserializes the LogModelResponse from a dictionary."""
|
|
3595
|
-
return cls()
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
@dataclass
|
|
3599
|
-
class LogOutputsRequest:
|
|
3600
|
-
run_id: str
|
|
3601
|
-
"""The ID of the Run from which to log outputs."""
|
|
3602
|
-
|
|
3603
|
-
models: Optional[List[ModelOutput]] = None
|
|
3604
|
-
"""The model outputs from the Run."""
|
|
3605
|
-
|
|
3606
|
-
def as_dict(self) -> dict:
|
|
3607
|
-
"""Serializes the LogOutputsRequest into a dictionary suitable for use as a JSON request body."""
|
|
3608
|
-
body = {}
|
|
3609
|
-
if self.models:
|
|
3610
|
-
body["models"] = [v.as_dict() for v in self.models]
|
|
3611
|
-
if self.run_id is not None:
|
|
3612
|
-
body["run_id"] = self.run_id
|
|
3613
|
-
return body
|
|
3614
|
-
|
|
3615
|
-
def as_shallow_dict(self) -> dict:
|
|
3616
|
-
"""Serializes the LogOutputsRequest into a shallow dictionary of its immediate attributes."""
|
|
3617
|
-
body = {}
|
|
3618
|
-
if self.models:
|
|
3619
|
-
body["models"] = self.models
|
|
3620
|
-
if self.run_id is not None:
|
|
3621
|
-
body["run_id"] = self.run_id
|
|
2360
|
+
"""Serializes the LogMetricResponse into a shallow dictionary of its immediate attributes."""
|
|
2361
|
+
body = {}
|
|
3622
2362
|
return body
|
|
3623
2363
|
|
|
3624
2364
|
@classmethod
|
|
3625
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
3626
|
-
"""Deserializes the
|
|
3627
|
-
return cls(
|
|
2365
|
+
def from_dict(cls, d: Dict[str, Any]) -> LogMetricResponse:
|
|
2366
|
+
"""Deserializes the LogMetricResponse from a dictionary."""
|
|
2367
|
+
return cls()
|
|
3628
2368
|
|
|
3629
2369
|
|
|
3630
2370
|
@dataclass
|
|
3631
|
-
class
|
|
2371
|
+
class LogModelResponse:
|
|
3632
2372
|
def as_dict(self) -> dict:
|
|
3633
|
-
"""Serializes the
|
|
2373
|
+
"""Serializes the LogModelResponse into a dictionary suitable for use as a JSON request body."""
|
|
3634
2374
|
body = {}
|
|
3635
2375
|
return body
|
|
3636
2376
|
|
|
3637
2377
|
def as_shallow_dict(self) -> dict:
|
|
3638
|
-
"""Serializes the
|
|
2378
|
+
"""Serializes the LogModelResponse into a shallow dictionary of its immediate attributes."""
|
|
3639
2379
|
body = {}
|
|
3640
2380
|
return body
|
|
3641
2381
|
|
|
3642
2382
|
@classmethod
|
|
3643
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
3644
|
-
"""Deserializes the
|
|
2383
|
+
def from_dict(cls, d: Dict[str, Any]) -> LogModelResponse:
|
|
2384
|
+
"""Deserializes the LogModelResponse from a dictionary."""
|
|
3645
2385
|
return cls()
|
|
3646
2386
|
|
|
3647
2387
|
|
|
3648
2388
|
@dataclass
|
|
3649
|
-
class
|
|
3650
|
-
key: str
|
|
3651
|
-
"""Name of the param. Maximum size is 255 bytes."""
|
|
3652
|
-
|
|
3653
|
-
value: str
|
|
3654
|
-
"""String value of the param being logged. Maximum size is 500 bytes."""
|
|
3655
|
-
|
|
3656
|
-
run_id: Optional[str] = None
|
|
3657
|
-
"""ID of the run under which to log the param. Must be provided."""
|
|
3658
|
-
|
|
3659
|
-
run_uuid: Optional[str] = None
|
|
3660
|
-
"""[Deprecated, use `run_id` instead] ID of the run under which to log the param. This field will
|
|
3661
|
-
be removed in a future MLflow version."""
|
|
3662
|
-
|
|
2389
|
+
class LogOutputsResponse:
|
|
3663
2390
|
def as_dict(self) -> dict:
|
|
3664
|
-
"""Serializes the
|
|
2391
|
+
"""Serializes the LogOutputsResponse into a dictionary suitable for use as a JSON request body."""
|
|
3665
2392
|
body = {}
|
|
3666
|
-
if self.key is not None:
|
|
3667
|
-
body["key"] = self.key
|
|
3668
|
-
if self.run_id is not None:
|
|
3669
|
-
body["run_id"] = self.run_id
|
|
3670
|
-
if self.run_uuid is not None:
|
|
3671
|
-
body["run_uuid"] = self.run_uuid
|
|
3672
|
-
if self.value is not None:
|
|
3673
|
-
body["value"] = self.value
|
|
3674
2393
|
return body
|
|
3675
2394
|
|
|
3676
2395
|
def as_shallow_dict(self) -> dict:
|
|
3677
|
-
"""Serializes the
|
|
2396
|
+
"""Serializes the LogOutputsResponse into a shallow dictionary of its immediate attributes."""
|
|
3678
2397
|
body = {}
|
|
3679
|
-
if self.key is not None:
|
|
3680
|
-
body["key"] = self.key
|
|
3681
|
-
if self.run_id is not None:
|
|
3682
|
-
body["run_id"] = self.run_id
|
|
3683
|
-
if self.run_uuid is not None:
|
|
3684
|
-
body["run_uuid"] = self.run_uuid
|
|
3685
|
-
if self.value is not None:
|
|
3686
|
-
body["value"] = self.value
|
|
3687
2398
|
return body
|
|
3688
2399
|
|
|
3689
2400
|
@classmethod
|
|
3690
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
3691
|
-
"""Deserializes the
|
|
3692
|
-
return cls(
|
|
3693
|
-
key=d.get("key", None),
|
|
3694
|
-
run_id=d.get("run_id", None),
|
|
3695
|
-
run_uuid=d.get("run_uuid", None),
|
|
3696
|
-
value=d.get("value", None),
|
|
3697
|
-
)
|
|
2401
|
+
def from_dict(cls, d: Dict[str, Any]) -> LogOutputsResponse:
|
|
2402
|
+
"""Deserializes the LogOutputsResponse from a dictionary."""
|
|
2403
|
+
return cls()
|
|
3698
2404
|
|
|
3699
2405
|
|
|
3700
2406
|
@dataclass
|
|
@@ -4671,6 +3377,9 @@ class OnlineStore:
|
|
|
4671
3377
|
creator: Optional[str] = None
|
|
4672
3378
|
"""The email of the creator of the online store."""
|
|
4673
3379
|
|
|
3380
|
+
read_replica_count: Optional[int] = None
|
|
3381
|
+
"""The number of read replicas for the online store. Defaults to 0."""
|
|
3382
|
+
|
|
4674
3383
|
state: Optional[OnlineStoreState] = None
|
|
4675
3384
|
"""The current state of the online store."""
|
|
4676
3385
|
|
|
@@ -4685,6 +3394,8 @@ class OnlineStore:
|
|
|
4685
3394
|
body["creator"] = self.creator
|
|
4686
3395
|
if self.name is not None:
|
|
4687
3396
|
body["name"] = self.name
|
|
3397
|
+
if self.read_replica_count is not None:
|
|
3398
|
+
body["read_replica_count"] = self.read_replica_count
|
|
4688
3399
|
if self.state is not None:
|
|
4689
3400
|
body["state"] = self.state.value
|
|
4690
3401
|
return body
|
|
@@ -4700,6 +3411,8 @@ class OnlineStore:
|
|
|
4700
3411
|
body["creator"] = self.creator
|
|
4701
3412
|
if self.name is not None:
|
|
4702
3413
|
body["name"] = self.name
|
|
3414
|
+
if self.read_replica_count is not None:
|
|
3415
|
+
body["read_replica_count"] = self.read_replica_count
|
|
4703
3416
|
if self.state is not None:
|
|
4704
3417
|
body["state"] = self.state
|
|
4705
3418
|
return body
|
|
@@ -4712,6 +3425,7 @@ class OnlineStore:
|
|
|
4712
3425
|
creation_time=d.get("creation_time", None),
|
|
4713
3426
|
creator=d.get("creator", None),
|
|
4714
3427
|
name=d.get("name", None),
|
|
3428
|
+
read_replica_count=d.get("read_replica_count", None),
|
|
4715
3429
|
state=_enum(d, "state", OnlineStoreState),
|
|
4716
3430
|
)
|
|
4717
3431
|
|
|
@@ -4823,40 +3537,6 @@ class PublishSpecPublishMode(Enum):
|
|
|
4823
3537
|
TRIGGERED = "TRIGGERED"
|
|
4824
3538
|
|
|
4825
3539
|
|
|
4826
|
-
@dataclass
|
|
4827
|
-
class PublishTableRequest:
|
|
4828
|
-
publish_spec: PublishSpec
|
|
4829
|
-
"""The specification for publishing the online table from the source table."""
|
|
4830
|
-
|
|
4831
|
-
source_table_name: Optional[str] = None
|
|
4832
|
-
"""The full three-part (catalog, schema, table) name of the source table."""
|
|
4833
|
-
|
|
4834
|
-
def as_dict(self) -> dict:
|
|
4835
|
-
"""Serializes the PublishTableRequest into a dictionary suitable for use as a JSON request body."""
|
|
4836
|
-
body = {}
|
|
4837
|
-
if self.publish_spec:
|
|
4838
|
-
body["publish_spec"] = self.publish_spec.as_dict()
|
|
4839
|
-
if self.source_table_name is not None:
|
|
4840
|
-
body["source_table_name"] = self.source_table_name
|
|
4841
|
-
return body
|
|
4842
|
-
|
|
4843
|
-
def as_shallow_dict(self) -> dict:
|
|
4844
|
-
"""Serializes the PublishTableRequest into a shallow dictionary of its immediate attributes."""
|
|
4845
|
-
body = {}
|
|
4846
|
-
if self.publish_spec:
|
|
4847
|
-
body["publish_spec"] = self.publish_spec
|
|
4848
|
-
if self.source_table_name is not None:
|
|
4849
|
-
body["source_table_name"] = self.source_table_name
|
|
4850
|
-
return body
|
|
4851
|
-
|
|
4852
|
-
@classmethod
|
|
4853
|
-
def from_dict(cls, d: Dict[str, Any]) -> PublishTableRequest:
|
|
4854
|
-
"""Deserializes the PublishTableRequest from a dictionary."""
|
|
4855
|
-
return cls(
|
|
4856
|
-
publish_spec=_from_dict(d, "publish_spec", PublishSpec), source_table_name=d.get("source_table_name", None)
|
|
4857
|
-
)
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
3540
|
@dataclass
|
|
4861
3541
|
class PublishTableResponse:
|
|
4862
3542
|
online_table_name: Optional[str] = None
|
|
@@ -5121,40 +3801,6 @@ class RegisteredModelPermissionsDescription:
|
|
|
5121
3801
|
)
|
|
5122
3802
|
|
|
5123
3803
|
|
|
5124
|
-
@dataclass
|
|
5125
|
-
class RegisteredModelPermissionsRequest:
|
|
5126
|
-
access_control_list: Optional[List[RegisteredModelAccessControlRequest]] = None
|
|
5127
|
-
|
|
5128
|
-
registered_model_id: Optional[str] = None
|
|
5129
|
-
"""The registered model for which to get or manage permissions."""
|
|
5130
|
-
|
|
5131
|
-
def as_dict(self) -> dict:
|
|
5132
|
-
"""Serializes the RegisteredModelPermissionsRequest into a dictionary suitable for use as a JSON request body."""
|
|
5133
|
-
body = {}
|
|
5134
|
-
if self.access_control_list:
|
|
5135
|
-
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
5136
|
-
if self.registered_model_id is not None:
|
|
5137
|
-
body["registered_model_id"] = self.registered_model_id
|
|
5138
|
-
return body
|
|
5139
|
-
|
|
5140
|
-
def as_shallow_dict(self) -> dict:
|
|
5141
|
-
"""Serializes the RegisteredModelPermissionsRequest into a shallow dictionary of its immediate attributes."""
|
|
5142
|
-
body = {}
|
|
5143
|
-
if self.access_control_list:
|
|
5144
|
-
body["access_control_list"] = self.access_control_list
|
|
5145
|
-
if self.registered_model_id is not None:
|
|
5146
|
-
body["registered_model_id"] = self.registered_model_id
|
|
5147
|
-
return body
|
|
5148
|
-
|
|
5149
|
-
@classmethod
|
|
5150
|
-
def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelPermissionsRequest:
|
|
5151
|
-
"""Deserializes the RegisteredModelPermissionsRequest from a dictionary."""
|
|
5152
|
-
return cls(
|
|
5153
|
-
access_control_list=_repeated_dict(d, "access_control_list", RegisteredModelAccessControlRequest),
|
|
5154
|
-
registered_model_id=d.get("registered_model_id", None),
|
|
5155
|
-
)
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
3804
|
class RegistryEmailSubscriptionType(Enum):
|
|
5159
3805
|
""".. note:: Experimental: This entity may change or be removed in a future release without
|
|
5160
3806
|
warning. Email subscription types for registry notifications: - `ALL_EVENTS`: Subscribed to all
|
|
@@ -5312,67 +3958,6 @@ class RegistryWebhookStatus(Enum):
|
|
|
5312
3958
|
TEST_MODE = "TEST_MODE"
|
|
5313
3959
|
|
|
5314
3960
|
|
|
5315
|
-
@dataclass
|
|
5316
|
-
class RejectTransitionRequest:
|
|
5317
|
-
"""Details required to identify and reject a model version stage transition request."""
|
|
5318
|
-
|
|
5319
|
-
name: str
|
|
5320
|
-
"""Name of the model."""
|
|
5321
|
-
|
|
5322
|
-
version: str
|
|
5323
|
-
"""Version of the model."""
|
|
5324
|
-
|
|
5325
|
-
stage: str
|
|
5326
|
-
"""Target stage of the transition. Valid values are:
|
|
5327
|
-
|
|
5328
|
-
* `None`: The initial stage of a model version.
|
|
5329
|
-
|
|
5330
|
-
* `Staging`: Staging or pre-production stage.
|
|
5331
|
-
|
|
5332
|
-
* `Production`: Production stage.
|
|
5333
|
-
|
|
5334
|
-
* `Archived`: Archived stage."""
|
|
5335
|
-
|
|
5336
|
-
comment: Optional[str] = None
|
|
5337
|
-
"""User-provided comment on the action."""
|
|
5338
|
-
|
|
5339
|
-
def as_dict(self) -> dict:
|
|
5340
|
-
"""Serializes the RejectTransitionRequest into a dictionary suitable for use as a JSON request body."""
|
|
5341
|
-
body = {}
|
|
5342
|
-
if self.comment is not None:
|
|
5343
|
-
body["comment"] = self.comment
|
|
5344
|
-
if self.name is not None:
|
|
5345
|
-
body["name"] = self.name
|
|
5346
|
-
if self.stage is not None:
|
|
5347
|
-
body["stage"] = self.stage
|
|
5348
|
-
if self.version is not None:
|
|
5349
|
-
body["version"] = self.version
|
|
5350
|
-
return body
|
|
5351
|
-
|
|
5352
|
-
def as_shallow_dict(self) -> dict:
|
|
5353
|
-
"""Serializes the RejectTransitionRequest into a shallow dictionary of its immediate attributes."""
|
|
5354
|
-
body = {}
|
|
5355
|
-
if self.comment is not None:
|
|
5356
|
-
body["comment"] = self.comment
|
|
5357
|
-
if self.name is not None:
|
|
5358
|
-
body["name"] = self.name
|
|
5359
|
-
if self.stage is not None:
|
|
5360
|
-
body["stage"] = self.stage
|
|
5361
|
-
if self.version is not None:
|
|
5362
|
-
body["version"] = self.version
|
|
5363
|
-
return body
|
|
5364
|
-
|
|
5365
|
-
@classmethod
|
|
5366
|
-
def from_dict(cls, d: Dict[str, Any]) -> RejectTransitionRequest:
|
|
5367
|
-
"""Deserializes the RejectTransitionRequest from a dictionary."""
|
|
5368
|
-
return cls(
|
|
5369
|
-
comment=d.get("comment", None),
|
|
5370
|
-
name=d.get("name", None),
|
|
5371
|
-
stage=d.get("stage", None),
|
|
5372
|
-
version=d.get("version", None),
|
|
5373
|
-
)
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
3961
|
@dataclass
|
|
5377
3962
|
class RejectTransitionRequestResponse:
|
|
5378
3963
|
activity: Optional[Activity] = None
|
|
@@ -5398,38 +3983,6 @@ class RejectTransitionRequestResponse:
|
|
|
5398
3983
|
return cls(activity=_from_dict(d, "activity", Activity))
|
|
5399
3984
|
|
|
5400
3985
|
|
|
5401
|
-
@dataclass
|
|
5402
|
-
class RenameModelRequest:
|
|
5403
|
-
name: str
|
|
5404
|
-
"""Registered model unique name identifier."""
|
|
5405
|
-
|
|
5406
|
-
new_name: Optional[str] = None
|
|
5407
|
-
"""If provided, updates the name for this `registered_model`."""
|
|
5408
|
-
|
|
5409
|
-
def as_dict(self) -> dict:
|
|
5410
|
-
"""Serializes the RenameModelRequest into a dictionary suitable for use as a JSON request body."""
|
|
5411
|
-
body = {}
|
|
5412
|
-
if self.name is not None:
|
|
5413
|
-
body["name"] = self.name
|
|
5414
|
-
if self.new_name is not None:
|
|
5415
|
-
body["new_name"] = self.new_name
|
|
5416
|
-
return body
|
|
5417
|
-
|
|
5418
|
-
def as_shallow_dict(self) -> dict:
|
|
5419
|
-
"""Serializes the RenameModelRequest into a shallow dictionary of its immediate attributes."""
|
|
5420
|
-
body = {}
|
|
5421
|
-
if self.name is not None:
|
|
5422
|
-
body["name"] = self.name
|
|
5423
|
-
if self.new_name is not None:
|
|
5424
|
-
body["new_name"] = self.new_name
|
|
5425
|
-
return body
|
|
5426
|
-
|
|
5427
|
-
@classmethod
|
|
5428
|
-
def from_dict(cls, d: Dict[str, Any]) -> RenameModelRequest:
|
|
5429
|
-
"""Deserializes the RenameModelRequest from a dictionary."""
|
|
5430
|
-
return cls(name=d.get("name", None), new_name=d.get("new_name", None))
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
3986
|
@dataclass
|
|
5434
3987
|
class RenameModelResponse:
|
|
5435
3988
|
registered_model: Optional[Model] = None
|
|
@@ -5454,31 +4007,6 @@ class RenameModelResponse:
|
|
|
5454
4007
|
return cls(registered_model=_from_dict(d, "registered_model", Model))
|
|
5455
4008
|
|
|
5456
4009
|
|
|
5457
|
-
@dataclass
|
|
5458
|
-
class RestoreExperiment:
|
|
5459
|
-
experiment_id: str
|
|
5460
|
-
"""ID of the associated experiment."""
|
|
5461
|
-
|
|
5462
|
-
def as_dict(self) -> dict:
|
|
5463
|
-
"""Serializes the RestoreExperiment into a dictionary suitable for use as a JSON request body."""
|
|
5464
|
-
body = {}
|
|
5465
|
-
if self.experiment_id is not None:
|
|
5466
|
-
body["experiment_id"] = self.experiment_id
|
|
5467
|
-
return body
|
|
5468
|
-
|
|
5469
|
-
def as_shallow_dict(self) -> dict:
|
|
5470
|
-
"""Serializes the RestoreExperiment into a shallow dictionary of its immediate attributes."""
|
|
5471
|
-
body = {}
|
|
5472
|
-
if self.experiment_id is not None:
|
|
5473
|
-
body["experiment_id"] = self.experiment_id
|
|
5474
|
-
return body
|
|
5475
|
-
|
|
5476
|
-
@classmethod
|
|
5477
|
-
def from_dict(cls, d: Dict[str, Any]) -> RestoreExperiment:
|
|
5478
|
-
"""Deserializes the RestoreExperiment from a dictionary."""
|
|
5479
|
-
return cls(experiment_id=d.get("experiment_id", None))
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
4010
|
@dataclass
|
|
5483
4011
|
class RestoreExperimentResponse:
|
|
5484
4012
|
def as_dict(self) -> dict:
|
|
@@ -5497,31 +4025,6 @@ class RestoreExperimentResponse:
|
|
|
5497
4025
|
return cls()
|
|
5498
4026
|
|
|
5499
4027
|
|
|
5500
|
-
@dataclass
|
|
5501
|
-
class RestoreRun:
|
|
5502
|
-
run_id: str
|
|
5503
|
-
"""ID of the run to restore."""
|
|
5504
|
-
|
|
5505
|
-
def as_dict(self) -> dict:
|
|
5506
|
-
"""Serializes the RestoreRun into a dictionary suitable for use as a JSON request body."""
|
|
5507
|
-
body = {}
|
|
5508
|
-
if self.run_id is not None:
|
|
5509
|
-
body["run_id"] = self.run_id
|
|
5510
|
-
return body
|
|
5511
|
-
|
|
5512
|
-
def as_shallow_dict(self) -> dict:
|
|
5513
|
-
"""Serializes the RestoreRun into a shallow dictionary of its immediate attributes."""
|
|
5514
|
-
body = {}
|
|
5515
|
-
if self.run_id is not None:
|
|
5516
|
-
body["run_id"] = self.run_id
|
|
5517
|
-
return body
|
|
5518
|
-
|
|
5519
|
-
@classmethod
|
|
5520
|
-
def from_dict(cls, d: Dict[str, Any]) -> RestoreRun:
|
|
5521
|
-
"""Deserializes the RestoreRun from a dictionary."""
|
|
5522
|
-
return cls(run_id=d.get("run_id", None))
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
4028
|
@dataclass
|
|
5526
4029
|
class RestoreRunResponse:
|
|
5527
4030
|
def as_dict(self) -> dict:
|
|
@@ -5540,51 +4043,6 @@ class RestoreRunResponse:
|
|
|
5540
4043
|
return cls()
|
|
5541
4044
|
|
|
5542
4045
|
|
|
5543
|
-
@dataclass
|
|
5544
|
-
class RestoreRuns:
|
|
5545
|
-
experiment_id: str
|
|
5546
|
-
"""The ID of the experiment containing the runs to restore."""
|
|
5547
|
-
|
|
5548
|
-
min_timestamp_millis: int
|
|
5549
|
-
"""The minimum deletion timestamp in milliseconds since the UNIX epoch for restoring runs. Only
|
|
5550
|
-
runs deleted no earlier than this timestamp are restored."""
|
|
5551
|
-
|
|
5552
|
-
max_runs: Optional[int] = None
|
|
5553
|
-
"""An optional positive integer indicating the maximum number of runs to restore. The maximum
|
|
5554
|
-
allowed value for max_runs is 10000."""
|
|
5555
|
-
|
|
5556
|
-
def as_dict(self) -> dict:
|
|
5557
|
-
"""Serializes the RestoreRuns into a dictionary suitable for use as a JSON request body."""
|
|
5558
|
-
body = {}
|
|
5559
|
-
if self.experiment_id is not None:
|
|
5560
|
-
body["experiment_id"] = self.experiment_id
|
|
5561
|
-
if self.max_runs is not None:
|
|
5562
|
-
body["max_runs"] = self.max_runs
|
|
5563
|
-
if self.min_timestamp_millis is not None:
|
|
5564
|
-
body["min_timestamp_millis"] = self.min_timestamp_millis
|
|
5565
|
-
return body
|
|
5566
|
-
|
|
5567
|
-
def as_shallow_dict(self) -> dict:
|
|
5568
|
-
"""Serializes the RestoreRuns into a shallow dictionary of its immediate attributes."""
|
|
5569
|
-
body = {}
|
|
5570
|
-
if self.experiment_id is not None:
|
|
5571
|
-
body["experiment_id"] = self.experiment_id
|
|
5572
|
-
if self.max_runs is not None:
|
|
5573
|
-
body["max_runs"] = self.max_runs
|
|
5574
|
-
if self.min_timestamp_millis is not None:
|
|
5575
|
-
body["min_timestamp_millis"] = self.min_timestamp_millis
|
|
5576
|
-
return body
|
|
5577
|
-
|
|
5578
|
-
@classmethod
|
|
5579
|
-
def from_dict(cls, d: Dict[str, Any]) -> RestoreRuns:
|
|
5580
|
-
"""Deserializes the RestoreRuns from a dictionary."""
|
|
5581
|
-
return cls(
|
|
5582
|
-
experiment_id=d.get("experiment_id", None),
|
|
5583
|
-
max_runs=d.get("max_runs", None),
|
|
5584
|
-
min_timestamp_millis=d.get("min_timestamp_millis", None),
|
|
5585
|
-
)
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
4046
|
@dataclass
|
|
5589
4047
|
class RestoreRunsResponse:
|
|
5590
4048
|
runs_restored: Optional[int] = None
|
|
@@ -5886,68 +4344,6 @@ class RunTag:
|
|
|
5886
4344
|
return cls(key=d.get("key", None), value=d.get("value", None))
|
|
5887
4345
|
|
|
5888
4346
|
|
|
5889
|
-
@dataclass
|
|
5890
|
-
class SearchExperiments:
|
|
5891
|
-
filter: Optional[str] = None
|
|
5892
|
-
"""String representing a SQL filter condition (e.g. "name ILIKE 'my-experiment%'")"""
|
|
5893
|
-
|
|
5894
|
-
max_results: Optional[int] = None
|
|
5895
|
-
"""Maximum number of experiments desired. Max threshold is 3000."""
|
|
5896
|
-
|
|
5897
|
-
order_by: Optional[List[str]] = None
|
|
5898
|
-
"""List of columns for ordering search results, which can include experiment name and last updated
|
|
5899
|
-
timestamp with an optional "DESC" or "ASC" annotation, where "ASC" is the default. Tiebreaks are
|
|
5900
|
-
done by experiment id DESC."""
|
|
5901
|
-
|
|
5902
|
-
page_token: Optional[str] = None
|
|
5903
|
-
"""Token indicating the page of experiments to fetch"""
|
|
5904
|
-
|
|
5905
|
-
view_type: Optional[ViewType] = None
|
|
5906
|
-
"""Qualifier for type of experiments to be returned. If unspecified, return only active
|
|
5907
|
-
experiments."""
|
|
5908
|
-
|
|
5909
|
-
def as_dict(self) -> dict:
|
|
5910
|
-
"""Serializes the SearchExperiments into a dictionary suitable for use as a JSON request body."""
|
|
5911
|
-
body = {}
|
|
5912
|
-
if self.filter is not None:
|
|
5913
|
-
body["filter"] = self.filter
|
|
5914
|
-
if self.max_results is not None:
|
|
5915
|
-
body["max_results"] = self.max_results
|
|
5916
|
-
if self.order_by:
|
|
5917
|
-
body["order_by"] = [v for v in self.order_by]
|
|
5918
|
-
if self.page_token is not None:
|
|
5919
|
-
body["page_token"] = self.page_token
|
|
5920
|
-
if self.view_type is not None:
|
|
5921
|
-
body["view_type"] = self.view_type.value
|
|
5922
|
-
return body
|
|
5923
|
-
|
|
5924
|
-
def as_shallow_dict(self) -> dict:
|
|
5925
|
-
"""Serializes the SearchExperiments into a shallow dictionary of its immediate attributes."""
|
|
5926
|
-
body = {}
|
|
5927
|
-
if self.filter is not None:
|
|
5928
|
-
body["filter"] = self.filter
|
|
5929
|
-
if self.max_results is not None:
|
|
5930
|
-
body["max_results"] = self.max_results
|
|
5931
|
-
if self.order_by:
|
|
5932
|
-
body["order_by"] = self.order_by
|
|
5933
|
-
if self.page_token is not None:
|
|
5934
|
-
body["page_token"] = self.page_token
|
|
5935
|
-
if self.view_type is not None:
|
|
5936
|
-
body["view_type"] = self.view_type
|
|
5937
|
-
return body
|
|
5938
|
-
|
|
5939
|
-
@classmethod
|
|
5940
|
-
def from_dict(cls, d: Dict[str, Any]) -> SearchExperiments:
|
|
5941
|
-
"""Deserializes the SearchExperiments from a dictionary."""
|
|
5942
|
-
return cls(
|
|
5943
|
-
filter=d.get("filter", None),
|
|
5944
|
-
max_results=d.get("max_results", None),
|
|
5945
|
-
order_by=d.get("order_by", None),
|
|
5946
|
-
page_token=d.get("page_token", None),
|
|
5947
|
-
view_type=_enum(d, "view_type", ViewType),
|
|
5948
|
-
)
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
4347
|
@dataclass
|
|
5952
4348
|
class SearchExperimentsResponse:
|
|
5953
4349
|
experiments: Optional[List[Experiment]] = None
|
|
@@ -6060,87 +4456,13 @@ class SearchLoggedModelsOrderBy:
|
|
|
6060
4456
|
return body
|
|
6061
4457
|
|
|
6062
4458
|
@classmethod
|
|
6063
|
-
def from_dict(cls, d: Dict[str, Any]) -> SearchLoggedModelsOrderBy:
|
|
6064
|
-
"""Deserializes the SearchLoggedModelsOrderBy from a dictionary."""
|
|
6065
|
-
return cls(
|
|
6066
|
-
ascending=d.get("ascending", None),
|
|
6067
|
-
dataset_digest=d.get("dataset_digest", None),
|
|
6068
|
-
dataset_name=d.get("dataset_name", None),
|
|
6069
|
-
field_name=d.get("field_name", None),
|
|
6070
|
-
)
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
@dataclass
|
|
6074
|
-
class SearchLoggedModelsRequest:
|
|
6075
|
-
datasets: Optional[List[SearchLoggedModelsDataset]] = None
|
|
6076
|
-
"""List of datasets on which to apply the metrics filter clauses. For example, a filter with
|
|
6077
|
-
`metrics.accuracy > 0.9` and dataset info with name "test_dataset" means we will return all
|
|
6078
|
-
logged models with accuracy > 0.9 on the test_dataset. Metric values from ANY dataset matching
|
|
6079
|
-
the criteria are considered. If no datasets are specified, then metrics across all datasets are
|
|
6080
|
-
considered in the filter."""
|
|
6081
|
-
|
|
6082
|
-
experiment_ids: Optional[List[str]] = None
|
|
6083
|
-
"""The IDs of the experiments in which to search for logged models."""
|
|
6084
|
-
|
|
6085
|
-
filter: Optional[str] = None
|
|
6086
|
-
"""A filter expression over logged model info and data that allows returning a subset of logged
|
|
6087
|
-
models. The syntax is a subset of SQL that supports AND'ing together binary operations.
|
|
6088
|
-
|
|
6089
|
-
Example: ``params.alpha < 0.3 AND metrics.accuracy > 0.9``."""
|
|
6090
|
-
|
|
6091
|
-
max_results: Optional[int] = None
|
|
6092
|
-
"""The maximum number of Logged Models to return. The maximum limit is 50."""
|
|
6093
|
-
|
|
6094
|
-
order_by: Optional[List[SearchLoggedModelsOrderBy]] = None
|
|
6095
|
-
"""The list of columns for ordering the results, with additional fields for sorting criteria."""
|
|
6096
|
-
|
|
6097
|
-
page_token: Optional[str] = None
|
|
6098
|
-
"""The token indicating the page of logged models to fetch."""
|
|
6099
|
-
|
|
6100
|
-
def as_dict(self) -> dict:
|
|
6101
|
-
"""Serializes the SearchLoggedModelsRequest into a dictionary suitable for use as a JSON request body."""
|
|
6102
|
-
body = {}
|
|
6103
|
-
if self.datasets:
|
|
6104
|
-
body["datasets"] = [v.as_dict() for v in self.datasets]
|
|
6105
|
-
if self.experiment_ids:
|
|
6106
|
-
body["experiment_ids"] = [v for v in self.experiment_ids]
|
|
6107
|
-
if self.filter is not None:
|
|
6108
|
-
body["filter"] = self.filter
|
|
6109
|
-
if self.max_results is not None:
|
|
6110
|
-
body["max_results"] = self.max_results
|
|
6111
|
-
if self.order_by:
|
|
6112
|
-
body["order_by"] = [v.as_dict() for v in self.order_by]
|
|
6113
|
-
if self.page_token is not None:
|
|
6114
|
-
body["page_token"] = self.page_token
|
|
6115
|
-
return body
|
|
6116
|
-
|
|
6117
|
-
def as_shallow_dict(self) -> dict:
|
|
6118
|
-
"""Serializes the SearchLoggedModelsRequest into a shallow dictionary of its immediate attributes."""
|
|
6119
|
-
body = {}
|
|
6120
|
-
if self.datasets:
|
|
6121
|
-
body["datasets"] = self.datasets
|
|
6122
|
-
if self.experiment_ids:
|
|
6123
|
-
body["experiment_ids"] = self.experiment_ids
|
|
6124
|
-
if self.filter is not None:
|
|
6125
|
-
body["filter"] = self.filter
|
|
6126
|
-
if self.max_results is not None:
|
|
6127
|
-
body["max_results"] = self.max_results
|
|
6128
|
-
if self.order_by:
|
|
6129
|
-
body["order_by"] = self.order_by
|
|
6130
|
-
if self.page_token is not None:
|
|
6131
|
-
body["page_token"] = self.page_token
|
|
6132
|
-
return body
|
|
6133
|
-
|
|
6134
|
-
@classmethod
|
|
6135
|
-
def from_dict(cls, d: Dict[str, Any]) -> SearchLoggedModelsRequest:
|
|
6136
|
-
"""Deserializes the SearchLoggedModelsRequest from a dictionary."""
|
|
4459
|
+
def from_dict(cls, d: Dict[str, Any]) -> SearchLoggedModelsOrderBy:
|
|
4460
|
+
"""Deserializes the SearchLoggedModelsOrderBy from a dictionary."""
|
|
6137
4461
|
return cls(
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
order_by=_repeated_dict(d, "order_by", SearchLoggedModelsOrderBy),
|
|
6143
|
-
page_token=d.get("page_token", None),
|
|
4462
|
+
ascending=d.get("ascending", None),
|
|
4463
|
+
dataset_digest=d.get("dataset_digest", None),
|
|
4464
|
+
dataset_name=d.get("dataset_name", None),
|
|
4465
|
+
field_name=d.get("field_name", None),
|
|
6144
4466
|
)
|
|
6145
4467
|
|
|
6146
4468
|
|
|
@@ -6246,86 +4568,6 @@ class SearchModelsResponse:
|
|
|
6246
4568
|
)
|
|
6247
4569
|
|
|
6248
4570
|
|
|
6249
|
-
@dataclass
|
|
6250
|
-
class SearchRuns:
|
|
6251
|
-
experiment_ids: Optional[List[str]] = None
|
|
6252
|
-
"""List of experiment IDs to search over."""
|
|
6253
|
-
|
|
6254
|
-
filter: Optional[str] = None
|
|
6255
|
-
"""A filter expression over params, metrics, and tags, that allows returning a subset of runs. The
|
|
6256
|
-
syntax is a subset of SQL that supports ANDing together binary operations between a param,
|
|
6257
|
-
metric, or tag and a constant.
|
|
6258
|
-
|
|
6259
|
-
Example: `metrics.rmse < 1 and params.model_class = 'LogisticRegression'`
|
|
6260
|
-
|
|
6261
|
-
You can select columns with special characters (hyphen, space, period, etc.) by using double
|
|
6262
|
-
quotes: `metrics."model class" = 'LinearRegression' and tags."user-name" = 'Tomas'`
|
|
6263
|
-
|
|
6264
|
-
Supported operators are `=`, `!=`, `>`, `>=`, `<`, and `<=`."""
|
|
6265
|
-
|
|
6266
|
-
max_results: Optional[int] = None
|
|
6267
|
-
"""Maximum number of runs desired. Max threshold is 50000"""
|
|
6268
|
-
|
|
6269
|
-
order_by: Optional[List[str]] = None
|
|
6270
|
-
"""List of columns to be ordered by, including attributes, params, metrics, and tags with an
|
|
6271
|
-
optional `"DESC"` or `"ASC"` annotation, where `"ASC"` is the default. Example: `["params.input
|
|
6272
|
-
DESC", "metrics.alpha ASC", "metrics.rmse"]`. Tiebreaks are done by start_time `DESC` followed
|
|
6273
|
-
by `run_id` for runs with the same start time (and this is the default ordering criterion if
|
|
6274
|
-
order_by is not provided)."""
|
|
6275
|
-
|
|
6276
|
-
page_token: Optional[str] = None
|
|
6277
|
-
"""Token for the current page of runs."""
|
|
6278
|
-
|
|
6279
|
-
run_view_type: Optional[ViewType] = None
|
|
6280
|
-
"""Whether to display only active, only deleted, or all runs. Defaults to only active runs."""
|
|
6281
|
-
|
|
6282
|
-
def as_dict(self) -> dict:
|
|
6283
|
-
"""Serializes the SearchRuns into a dictionary suitable for use as a JSON request body."""
|
|
6284
|
-
body = {}
|
|
6285
|
-
if self.experiment_ids:
|
|
6286
|
-
body["experiment_ids"] = [v for v in self.experiment_ids]
|
|
6287
|
-
if self.filter is not None:
|
|
6288
|
-
body["filter"] = self.filter
|
|
6289
|
-
if self.max_results is not None:
|
|
6290
|
-
body["max_results"] = self.max_results
|
|
6291
|
-
if self.order_by:
|
|
6292
|
-
body["order_by"] = [v for v in self.order_by]
|
|
6293
|
-
if self.page_token is not None:
|
|
6294
|
-
body["page_token"] = self.page_token
|
|
6295
|
-
if self.run_view_type is not None:
|
|
6296
|
-
body["run_view_type"] = self.run_view_type.value
|
|
6297
|
-
return body
|
|
6298
|
-
|
|
6299
|
-
def as_shallow_dict(self) -> dict:
|
|
6300
|
-
"""Serializes the SearchRuns into a shallow dictionary of its immediate attributes."""
|
|
6301
|
-
body = {}
|
|
6302
|
-
if self.experiment_ids:
|
|
6303
|
-
body["experiment_ids"] = self.experiment_ids
|
|
6304
|
-
if self.filter is not None:
|
|
6305
|
-
body["filter"] = self.filter
|
|
6306
|
-
if self.max_results is not None:
|
|
6307
|
-
body["max_results"] = self.max_results
|
|
6308
|
-
if self.order_by:
|
|
6309
|
-
body["order_by"] = self.order_by
|
|
6310
|
-
if self.page_token is not None:
|
|
6311
|
-
body["page_token"] = self.page_token
|
|
6312
|
-
if self.run_view_type is not None:
|
|
6313
|
-
body["run_view_type"] = self.run_view_type
|
|
6314
|
-
return body
|
|
6315
|
-
|
|
6316
|
-
@classmethod
|
|
6317
|
-
def from_dict(cls, d: Dict[str, Any]) -> SearchRuns:
|
|
6318
|
-
"""Deserializes the SearchRuns from a dictionary."""
|
|
6319
|
-
return cls(
|
|
6320
|
-
experiment_ids=d.get("experiment_ids", None),
|
|
6321
|
-
filter=d.get("filter", None),
|
|
6322
|
-
max_results=d.get("max_results", None),
|
|
6323
|
-
order_by=d.get("order_by", None),
|
|
6324
|
-
page_token=d.get("page_token", None),
|
|
6325
|
-
run_view_type=_enum(d, "run_view_type", ViewType),
|
|
6326
|
-
)
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
4571
|
@dataclass
|
|
6330
4572
|
class SearchRunsResponse:
|
|
6331
4573
|
next_page_token: Optional[str] = None
|
|
@@ -6358,45 +4600,6 @@ class SearchRunsResponse:
|
|
|
6358
4600
|
return cls(next_page_token=d.get("next_page_token", None), runs=_repeated_dict(d, "runs", Run))
|
|
6359
4601
|
|
|
6360
4602
|
|
|
6361
|
-
@dataclass
|
|
6362
|
-
class SetExperimentTag:
|
|
6363
|
-
experiment_id: str
|
|
6364
|
-
"""ID of the experiment under which to log the tag. Must be provided."""
|
|
6365
|
-
|
|
6366
|
-
key: str
|
|
6367
|
-
"""Name of the tag. Keys up to 250 bytes in size are supported."""
|
|
6368
|
-
|
|
6369
|
-
value: str
|
|
6370
|
-
"""String value of the tag being logged. Values up to 64KB in size are supported."""
|
|
6371
|
-
|
|
6372
|
-
def as_dict(self) -> dict:
|
|
6373
|
-
"""Serializes the SetExperimentTag into a dictionary suitable for use as a JSON request body."""
|
|
6374
|
-
body = {}
|
|
6375
|
-
if self.experiment_id is not None:
|
|
6376
|
-
body["experiment_id"] = self.experiment_id
|
|
6377
|
-
if self.key is not None:
|
|
6378
|
-
body["key"] = self.key
|
|
6379
|
-
if self.value is not None:
|
|
6380
|
-
body["value"] = self.value
|
|
6381
|
-
return body
|
|
6382
|
-
|
|
6383
|
-
def as_shallow_dict(self) -> dict:
|
|
6384
|
-
"""Serializes the SetExperimentTag into a shallow dictionary of its immediate attributes."""
|
|
6385
|
-
body = {}
|
|
6386
|
-
if self.experiment_id is not None:
|
|
6387
|
-
body["experiment_id"] = self.experiment_id
|
|
6388
|
-
if self.key is not None:
|
|
6389
|
-
body["key"] = self.key
|
|
6390
|
-
if self.value is not None:
|
|
6391
|
-
body["value"] = self.value
|
|
6392
|
-
return body
|
|
6393
|
-
|
|
6394
|
-
@classmethod
|
|
6395
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetExperimentTag:
|
|
6396
|
-
"""Deserializes the SetExperimentTag from a dictionary."""
|
|
6397
|
-
return cls(experiment_id=d.get("experiment_id", None), key=d.get("key", None), value=d.get("value", None))
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
4603
|
@dataclass
|
|
6401
4604
|
class SetExperimentTagResponse:
|
|
6402
4605
|
def as_dict(self) -> dict:
|
|
@@ -6415,38 +4618,6 @@ class SetExperimentTagResponse:
|
|
|
6415
4618
|
return cls()
|
|
6416
4619
|
|
|
6417
4620
|
|
|
6418
|
-
@dataclass
|
|
6419
|
-
class SetLoggedModelTagsRequest:
|
|
6420
|
-
model_id: Optional[str] = None
|
|
6421
|
-
"""The ID of the logged model to set the tags on."""
|
|
6422
|
-
|
|
6423
|
-
tags: Optional[List[LoggedModelTag]] = None
|
|
6424
|
-
"""The tags to set on the logged model."""
|
|
6425
|
-
|
|
6426
|
-
def as_dict(self) -> dict:
|
|
6427
|
-
"""Serializes the SetLoggedModelTagsRequest into a dictionary suitable for use as a JSON request body."""
|
|
6428
|
-
body = {}
|
|
6429
|
-
if self.model_id is not None:
|
|
6430
|
-
body["model_id"] = self.model_id
|
|
6431
|
-
if self.tags:
|
|
6432
|
-
body["tags"] = [v.as_dict() for v in self.tags]
|
|
6433
|
-
return body
|
|
6434
|
-
|
|
6435
|
-
def as_shallow_dict(self) -> dict:
|
|
6436
|
-
"""Serializes the SetLoggedModelTagsRequest into a shallow dictionary of its immediate attributes."""
|
|
6437
|
-
body = {}
|
|
6438
|
-
if self.model_id is not None:
|
|
6439
|
-
body["model_id"] = self.model_id
|
|
6440
|
-
if self.tags:
|
|
6441
|
-
body["tags"] = self.tags
|
|
6442
|
-
return body
|
|
6443
|
-
|
|
6444
|
-
@classmethod
|
|
6445
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetLoggedModelTagsRequest:
|
|
6446
|
-
"""Deserializes the SetLoggedModelTagsRequest from a dictionary."""
|
|
6447
|
-
return cls(model_id=d.get("model_id", None), tags=_repeated_dict(d, "tags", LoggedModelTag))
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
4621
|
@dataclass
|
|
6451
4622
|
class SetLoggedModelTagsResponse:
|
|
6452
4623
|
def as_dict(self) -> dict:
|
|
@@ -6465,48 +4636,6 @@ class SetLoggedModelTagsResponse:
|
|
|
6465
4636
|
return cls()
|
|
6466
4637
|
|
|
6467
4638
|
|
|
6468
|
-
@dataclass
|
|
6469
|
-
class SetModelTagRequest:
|
|
6470
|
-
name: str
|
|
6471
|
-
"""Unique name of the model."""
|
|
6472
|
-
|
|
6473
|
-
key: str
|
|
6474
|
-
"""Name of the tag. Maximum size depends on storage backend. If a tag with this name already
|
|
6475
|
-
exists, its preexisting value will be replaced by the specified `value`. All storage backends
|
|
6476
|
-
are guaranteed to support key values up to 250 bytes in size."""
|
|
6477
|
-
|
|
6478
|
-
value: str
|
|
6479
|
-
"""String value of the tag being logged. Maximum size depends on storage backend. All storage
|
|
6480
|
-
backends are guaranteed to support key values up to 5000 bytes in size."""
|
|
6481
|
-
|
|
6482
|
-
def as_dict(self) -> dict:
|
|
6483
|
-
"""Serializes the SetModelTagRequest into a dictionary suitable for use as a JSON request body."""
|
|
6484
|
-
body = {}
|
|
6485
|
-
if self.key is not None:
|
|
6486
|
-
body["key"] = self.key
|
|
6487
|
-
if self.name is not None:
|
|
6488
|
-
body["name"] = self.name
|
|
6489
|
-
if self.value is not None:
|
|
6490
|
-
body["value"] = self.value
|
|
6491
|
-
return body
|
|
6492
|
-
|
|
6493
|
-
def as_shallow_dict(self) -> dict:
|
|
6494
|
-
"""Serializes the SetModelTagRequest into a shallow dictionary of its immediate attributes."""
|
|
6495
|
-
body = {}
|
|
6496
|
-
if self.key is not None:
|
|
6497
|
-
body["key"] = self.key
|
|
6498
|
-
if self.name is not None:
|
|
6499
|
-
body["name"] = self.name
|
|
6500
|
-
if self.value is not None:
|
|
6501
|
-
body["value"] = self.value
|
|
6502
|
-
return body
|
|
6503
|
-
|
|
6504
|
-
@classmethod
|
|
6505
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetModelTagRequest:
|
|
6506
|
-
"""Deserializes the SetModelTagRequest from a dictionary."""
|
|
6507
|
-
return cls(key=d.get("key", None), name=d.get("name", None), value=d.get("value", None))
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
4639
|
@dataclass
|
|
6511
4640
|
class SetModelTagResponse:
|
|
6512
4641
|
def as_dict(self) -> dict:
|
|
@@ -6525,57 +4654,6 @@ class SetModelTagResponse:
|
|
|
6525
4654
|
return cls()
|
|
6526
4655
|
|
|
6527
4656
|
|
|
6528
|
-
@dataclass
|
|
6529
|
-
class SetModelVersionTagRequest:
|
|
6530
|
-
name: str
|
|
6531
|
-
"""Unique name of the model."""
|
|
6532
|
-
|
|
6533
|
-
version: str
|
|
6534
|
-
"""Model version number."""
|
|
6535
|
-
|
|
6536
|
-
key: str
|
|
6537
|
-
"""Name of the tag. Maximum size depends on storage backend. If a tag with this name already
|
|
6538
|
-
exists, its preexisting value will be replaced by the specified `value`. All storage backends
|
|
6539
|
-
are guaranteed to support key values up to 250 bytes in size."""
|
|
6540
|
-
|
|
6541
|
-
value: str
|
|
6542
|
-
"""String value of the tag being logged. Maximum size depends on storage backend. All storage
|
|
6543
|
-
backends are guaranteed to support key values up to 5000 bytes in size."""
|
|
6544
|
-
|
|
6545
|
-
def as_dict(self) -> dict:
|
|
6546
|
-
"""Serializes the SetModelVersionTagRequest into a dictionary suitable for use as a JSON request body."""
|
|
6547
|
-
body = {}
|
|
6548
|
-
if self.key is not None:
|
|
6549
|
-
body["key"] = self.key
|
|
6550
|
-
if self.name is not None:
|
|
6551
|
-
body["name"] = self.name
|
|
6552
|
-
if self.value is not None:
|
|
6553
|
-
body["value"] = self.value
|
|
6554
|
-
if self.version is not None:
|
|
6555
|
-
body["version"] = self.version
|
|
6556
|
-
return body
|
|
6557
|
-
|
|
6558
|
-
def as_shallow_dict(self) -> dict:
|
|
6559
|
-
"""Serializes the SetModelVersionTagRequest into a shallow dictionary of its immediate attributes."""
|
|
6560
|
-
body = {}
|
|
6561
|
-
if self.key is not None:
|
|
6562
|
-
body["key"] = self.key
|
|
6563
|
-
if self.name is not None:
|
|
6564
|
-
body["name"] = self.name
|
|
6565
|
-
if self.value is not None:
|
|
6566
|
-
body["value"] = self.value
|
|
6567
|
-
if self.version is not None:
|
|
6568
|
-
body["version"] = self.version
|
|
6569
|
-
return body
|
|
6570
|
-
|
|
6571
|
-
@classmethod
|
|
6572
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetModelVersionTagRequest:
|
|
6573
|
-
"""Deserializes the SetModelVersionTagRequest from a dictionary."""
|
|
6574
|
-
return cls(
|
|
6575
|
-
key=d.get("key", None), name=d.get("name", None), value=d.get("value", None), version=d.get("version", None)
|
|
6576
|
-
)
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
4657
|
@dataclass
|
|
6580
4658
|
class SetModelVersionTagResponse:
|
|
6581
4659
|
def as_dict(self) -> dict:
|
|
@@ -6594,58 +4672,6 @@ class SetModelVersionTagResponse:
|
|
|
6594
4672
|
return cls()
|
|
6595
4673
|
|
|
6596
4674
|
|
|
6597
|
-
@dataclass
|
|
6598
|
-
class SetTag:
|
|
6599
|
-
key: str
|
|
6600
|
-
"""Name of the tag. Keys up to 250 bytes in size are supported."""
|
|
6601
|
-
|
|
6602
|
-
value: str
|
|
6603
|
-
"""String value of the tag being logged. Values up to 64KB in size are supported."""
|
|
6604
|
-
|
|
6605
|
-
run_id: Optional[str] = None
|
|
6606
|
-
"""ID of the run under which to log the tag. Must be provided."""
|
|
6607
|
-
|
|
6608
|
-
run_uuid: Optional[str] = None
|
|
6609
|
-
"""[Deprecated, use `run_id` instead] ID of the run under which to log the tag. This field will be
|
|
6610
|
-
removed in a future MLflow version."""
|
|
6611
|
-
|
|
6612
|
-
def as_dict(self) -> dict:
|
|
6613
|
-
"""Serializes the SetTag into a dictionary suitable for use as a JSON request body."""
|
|
6614
|
-
body = {}
|
|
6615
|
-
if self.key is not None:
|
|
6616
|
-
body["key"] = self.key
|
|
6617
|
-
if self.run_id is not None:
|
|
6618
|
-
body["run_id"] = self.run_id
|
|
6619
|
-
if self.run_uuid is not None:
|
|
6620
|
-
body["run_uuid"] = self.run_uuid
|
|
6621
|
-
if self.value is not None:
|
|
6622
|
-
body["value"] = self.value
|
|
6623
|
-
return body
|
|
6624
|
-
|
|
6625
|
-
def as_shallow_dict(self) -> dict:
|
|
6626
|
-
"""Serializes the SetTag into a shallow dictionary of its immediate attributes."""
|
|
6627
|
-
body = {}
|
|
6628
|
-
if self.key is not None:
|
|
6629
|
-
body["key"] = self.key
|
|
6630
|
-
if self.run_id is not None:
|
|
6631
|
-
body["run_id"] = self.run_id
|
|
6632
|
-
if self.run_uuid is not None:
|
|
6633
|
-
body["run_uuid"] = self.run_uuid
|
|
6634
|
-
if self.value is not None:
|
|
6635
|
-
body["value"] = self.value
|
|
6636
|
-
return body
|
|
6637
|
-
|
|
6638
|
-
@classmethod
|
|
6639
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetTag:
|
|
6640
|
-
"""Deserializes the SetTag from a dictionary."""
|
|
6641
|
-
return cls(
|
|
6642
|
-
key=d.get("key", None),
|
|
6643
|
-
run_id=d.get("run_id", None),
|
|
6644
|
-
run_uuid=d.get("run_uuid", None),
|
|
6645
|
-
value=d.get("value", None),
|
|
6646
|
-
)
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
4675
|
@dataclass
|
|
6650
4676
|
class SetTagResponse:
|
|
6651
4677
|
def as_dict(self) -> dict:
|
|
@@ -6677,140 +4703,36 @@ class Status(Enum):
|
|
|
6677
4703
|
READY = "READY"
|
|
6678
4704
|
|
|
6679
4705
|
|
|
6680
|
-
@dataclass
|
|
6681
|
-
class TestRegistryWebhookRequest:
|
|
6682
|
-
"""Details required to test a registry webhook."""
|
|
6683
|
-
|
|
6684
|
-
id: str
|
|
6685
|
-
"""Webhook ID"""
|
|
6686
|
-
|
|
6687
|
-
event: Optional[RegistryWebhookEvent] = None
|
|
6688
|
-
"""If `event` is specified, the test trigger uses the specified event. If `event` is not specified,
|
|
6689
|
-
the test trigger uses a randomly chosen event associated with the webhook."""
|
|
6690
|
-
|
|
6691
|
-
def as_dict(self) -> dict:
|
|
6692
|
-
"""Serializes the TestRegistryWebhookRequest into a dictionary suitable for use as a JSON request body."""
|
|
6693
|
-
body = {}
|
|
6694
|
-
if self.event is not None:
|
|
6695
|
-
body["event"] = self.event.value
|
|
6696
|
-
if self.id is not None:
|
|
6697
|
-
body["id"] = self.id
|
|
6698
|
-
return body
|
|
6699
|
-
|
|
6700
|
-
def as_shallow_dict(self) -> dict:
|
|
6701
|
-
"""Serializes the TestRegistryWebhookRequest into a shallow dictionary of its immediate attributes."""
|
|
6702
|
-
body = {}
|
|
6703
|
-
if self.event is not None:
|
|
6704
|
-
body["event"] = self.event
|
|
6705
|
-
if self.id is not None:
|
|
6706
|
-
body["id"] = self.id
|
|
6707
|
-
return body
|
|
6708
|
-
|
|
6709
|
-
@classmethod
|
|
6710
|
-
def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookRequest:
|
|
6711
|
-
"""Deserializes the TestRegistryWebhookRequest from a dictionary."""
|
|
6712
|
-
return cls(event=_enum(d, "event", RegistryWebhookEvent), id=d.get("id", None))
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
4706
|
@dataclass
|
|
6716
4707
|
class TestRegistryWebhookResponse:
|
|
6717
4708
|
body: Optional[str] = None
|
|
6718
4709
|
"""Body of the response from the webhook URL"""
|
|
6719
4710
|
|
|
6720
|
-
status_code: Optional[int] = None
|
|
6721
|
-
"""Status code returned by the webhook URL"""
|
|
6722
|
-
|
|
6723
|
-
def as_dict(self) -> dict:
|
|
6724
|
-
"""Serializes the TestRegistryWebhookResponse into a dictionary suitable for use as a JSON request body."""
|
|
6725
|
-
body = {}
|
|
6726
|
-
if self.body is not None:
|
|
6727
|
-
body["body"] = self.body
|
|
6728
|
-
if self.status_code is not None:
|
|
6729
|
-
body["status_code"] = self.status_code
|
|
6730
|
-
return body
|
|
6731
|
-
|
|
6732
|
-
def as_shallow_dict(self) -> dict:
|
|
6733
|
-
"""Serializes the TestRegistryWebhookResponse into a shallow dictionary of its immediate attributes."""
|
|
6734
|
-
body = {}
|
|
6735
|
-
if self.body is not None:
|
|
6736
|
-
body["body"] = self.body
|
|
6737
|
-
if self.status_code is not None:
|
|
6738
|
-
body["status_code"] = self.status_code
|
|
6739
|
-
return body
|
|
6740
|
-
|
|
6741
|
-
@classmethod
|
|
6742
|
-
def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookResponse:
|
|
6743
|
-
"""Deserializes the TestRegistryWebhookResponse from a dictionary."""
|
|
6744
|
-
return cls(body=d.get("body", None), status_code=d.get("status_code", None))
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
@dataclass
|
|
6748
|
-
class TransitionModelVersionStageDatabricks:
|
|
6749
|
-
"""Details required to transition a model version's stage."""
|
|
6750
|
-
|
|
6751
|
-
name: str
|
|
6752
|
-
"""Name of the model."""
|
|
6753
|
-
|
|
6754
|
-
version: str
|
|
6755
|
-
"""Version of the model."""
|
|
6756
|
-
|
|
6757
|
-
stage: str
|
|
6758
|
-
"""Target stage of the transition. Valid values are:
|
|
6759
|
-
|
|
6760
|
-
* `None`: The initial stage of a model version.
|
|
6761
|
-
|
|
6762
|
-
* `Staging`: Staging or pre-production stage.
|
|
6763
|
-
|
|
6764
|
-
* `Production`: Production stage.
|
|
6765
|
-
|
|
6766
|
-
* `Archived`: Archived stage."""
|
|
6767
|
-
|
|
6768
|
-
archive_existing_versions: bool
|
|
6769
|
-
"""Specifies whether to archive all current model versions in the target stage."""
|
|
6770
|
-
|
|
6771
|
-
comment: Optional[str] = None
|
|
6772
|
-
"""User-provided comment on the action."""
|
|
4711
|
+
status_code: Optional[int] = None
|
|
4712
|
+
"""Status code returned by the webhook URL"""
|
|
6773
4713
|
|
|
6774
4714
|
def as_dict(self) -> dict:
|
|
6775
|
-
"""Serializes the
|
|
4715
|
+
"""Serializes the TestRegistryWebhookResponse into a dictionary suitable for use as a JSON request body."""
|
|
6776
4716
|
body = {}
|
|
6777
|
-
if self.
|
|
6778
|
-
body["
|
|
6779
|
-
if self.
|
|
6780
|
-
body["
|
|
6781
|
-
if self.name is not None:
|
|
6782
|
-
body["name"] = self.name
|
|
6783
|
-
if self.stage is not None:
|
|
6784
|
-
body["stage"] = self.stage
|
|
6785
|
-
if self.version is not None:
|
|
6786
|
-
body["version"] = self.version
|
|
4717
|
+
if self.body is not None:
|
|
4718
|
+
body["body"] = self.body
|
|
4719
|
+
if self.status_code is not None:
|
|
4720
|
+
body["status_code"] = self.status_code
|
|
6787
4721
|
return body
|
|
6788
4722
|
|
|
6789
4723
|
def as_shallow_dict(self) -> dict:
|
|
6790
|
-
"""Serializes the
|
|
4724
|
+
"""Serializes the TestRegistryWebhookResponse into a shallow dictionary of its immediate attributes."""
|
|
6791
4725
|
body = {}
|
|
6792
|
-
if self.
|
|
6793
|
-
body["
|
|
6794
|
-
if self.
|
|
6795
|
-
body["
|
|
6796
|
-
if self.name is not None:
|
|
6797
|
-
body["name"] = self.name
|
|
6798
|
-
if self.stage is not None:
|
|
6799
|
-
body["stage"] = self.stage
|
|
6800
|
-
if self.version is not None:
|
|
6801
|
-
body["version"] = self.version
|
|
4726
|
+
if self.body is not None:
|
|
4727
|
+
body["body"] = self.body
|
|
4728
|
+
if self.status_code is not None:
|
|
4729
|
+
body["status_code"] = self.status_code
|
|
6802
4730
|
return body
|
|
6803
4731
|
|
|
6804
4732
|
@classmethod
|
|
6805
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
6806
|
-
"""Deserializes the
|
|
6807
|
-
return cls(
|
|
6808
|
-
archive_existing_versions=d.get("archive_existing_versions", None),
|
|
6809
|
-
comment=d.get("comment", None),
|
|
6810
|
-
name=d.get("name", None),
|
|
6811
|
-
stage=d.get("stage", None),
|
|
6812
|
-
version=d.get("version", None),
|
|
6813
|
-
)
|
|
4733
|
+
def from_dict(cls, d: Dict[str, Any]) -> TestRegistryWebhookResponse:
|
|
4734
|
+
"""Deserializes the TestRegistryWebhookResponse from a dictionary."""
|
|
4735
|
+
return cls(body=d.get("body", None), status_code=d.get("status_code", None))
|
|
6814
4736
|
|
|
6815
4737
|
|
|
6816
4738
|
@dataclass
|
|
@@ -6908,40 +4830,6 @@ class TransitionStageResponse:
|
|
|
6908
4830
|
return cls(model_version_databricks=_from_dict(d, "model_version_databricks", ModelVersionDatabricks))
|
|
6909
4831
|
|
|
6910
4832
|
|
|
6911
|
-
@dataclass
|
|
6912
|
-
class UpdateComment:
|
|
6913
|
-
"""Details required to edit a comment on a model version."""
|
|
6914
|
-
|
|
6915
|
-
id: str
|
|
6916
|
-
"""Unique identifier of an activity"""
|
|
6917
|
-
|
|
6918
|
-
comment: str
|
|
6919
|
-
"""User-provided comment on the action."""
|
|
6920
|
-
|
|
6921
|
-
def as_dict(self) -> dict:
|
|
6922
|
-
"""Serializes the UpdateComment into a dictionary suitable for use as a JSON request body."""
|
|
6923
|
-
body = {}
|
|
6924
|
-
if self.comment is not None:
|
|
6925
|
-
body["comment"] = self.comment
|
|
6926
|
-
if self.id is not None:
|
|
6927
|
-
body["id"] = self.id
|
|
6928
|
-
return body
|
|
6929
|
-
|
|
6930
|
-
def as_shallow_dict(self) -> dict:
|
|
6931
|
-
"""Serializes the UpdateComment into a shallow dictionary of its immediate attributes."""
|
|
6932
|
-
body = {}
|
|
6933
|
-
if self.comment is not None:
|
|
6934
|
-
body["comment"] = self.comment
|
|
6935
|
-
if self.id is not None:
|
|
6936
|
-
body["id"] = self.id
|
|
6937
|
-
return body
|
|
6938
|
-
|
|
6939
|
-
@classmethod
|
|
6940
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateComment:
|
|
6941
|
-
"""Deserializes the UpdateComment from a dictionary."""
|
|
6942
|
-
return cls(comment=d.get("comment", None), id=d.get("id", None))
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
4833
|
@dataclass
|
|
6946
4834
|
class UpdateCommentResponse:
|
|
6947
4835
|
comment: Optional[CommentObject] = None
|
|
@@ -6967,38 +4855,6 @@ class UpdateCommentResponse:
|
|
|
6967
4855
|
return cls(comment=_from_dict(d, "comment", CommentObject))
|
|
6968
4856
|
|
|
6969
4857
|
|
|
6970
|
-
@dataclass
|
|
6971
|
-
class UpdateExperiment:
|
|
6972
|
-
experiment_id: str
|
|
6973
|
-
"""ID of the associated experiment."""
|
|
6974
|
-
|
|
6975
|
-
new_name: Optional[str] = None
|
|
6976
|
-
"""If provided, the experiment's name is changed to the new name. The new name must be unique."""
|
|
6977
|
-
|
|
6978
|
-
def as_dict(self) -> dict:
|
|
6979
|
-
"""Serializes the UpdateExperiment into a dictionary suitable for use as a JSON request body."""
|
|
6980
|
-
body = {}
|
|
6981
|
-
if self.experiment_id is not None:
|
|
6982
|
-
body["experiment_id"] = self.experiment_id
|
|
6983
|
-
if self.new_name is not None:
|
|
6984
|
-
body["new_name"] = self.new_name
|
|
6985
|
-
return body
|
|
6986
|
-
|
|
6987
|
-
def as_shallow_dict(self) -> dict:
|
|
6988
|
-
"""Serializes the UpdateExperiment into a shallow dictionary of its immediate attributes."""
|
|
6989
|
-
body = {}
|
|
6990
|
-
if self.experiment_id is not None:
|
|
6991
|
-
body["experiment_id"] = self.experiment_id
|
|
6992
|
-
if self.new_name is not None:
|
|
6993
|
-
body["new_name"] = self.new_name
|
|
6994
|
-
return body
|
|
6995
|
-
|
|
6996
|
-
@classmethod
|
|
6997
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateExperiment:
|
|
6998
|
-
"""Deserializes the UpdateExperiment from a dictionary."""
|
|
6999
|
-
return cls(experiment_id=d.get("experiment_id", None), new_name=d.get("new_name", None))
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
4858
|
@dataclass
|
|
7003
4859
|
class UpdateExperimentResponse:
|
|
7004
4860
|
def as_dict(self) -> dict:
|
|
@@ -7017,38 +4873,6 @@ class UpdateExperimentResponse:
|
|
|
7017
4873
|
return cls()
|
|
7018
4874
|
|
|
7019
4875
|
|
|
7020
|
-
@dataclass
|
|
7021
|
-
class UpdateModelRequest:
|
|
7022
|
-
name: str
|
|
7023
|
-
"""Registered model unique name identifier."""
|
|
7024
|
-
|
|
7025
|
-
description: Optional[str] = None
|
|
7026
|
-
"""If provided, updates the description for this `registered_model`."""
|
|
7027
|
-
|
|
7028
|
-
def as_dict(self) -> dict:
|
|
7029
|
-
"""Serializes the UpdateModelRequest into a dictionary suitable for use as a JSON request body."""
|
|
7030
|
-
body = {}
|
|
7031
|
-
if self.description is not None:
|
|
7032
|
-
body["description"] = self.description
|
|
7033
|
-
if self.name is not None:
|
|
7034
|
-
body["name"] = self.name
|
|
7035
|
-
return body
|
|
7036
|
-
|
|
7037
|
-
def as_shallow_dict(self) -> dict:
|
|
7038
|
-
"""Serializes the UpdateModelRequest into a shallow dictionary of its immediate attributes."""
|
|
7039
|
-
body = {}
|
|
7040
|
-
if self.description is not None:
|
|
7041
|
-
body["description"] = self.description
|
|
7042
|
-
if self.name is not None:
|
|
7043
|
-
body["name"] = self.name
|
|
7044
|
-
return body
|
|
7045
|
-
|
|
7046
|
-
@classmethod
|
|
7047
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelRequest:
|
|
7048
|
-
"""Deserializes the UpdateModelRequest from a dictionary."""
|
|
7049
|
-
return cls(description=d.get("description", None), name=d.get("name", None))
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
4876
|
@dataclass
|
|
7053
4877
|
class UpdateModelResponse:
|
|
7054
4878
|
registered_model: Optional[Model] = None
|
|
@@ -7073,45 +4897,6 @@ class UpdateModelResponse:
|
|
|
7073
4897
|
return cls(registered_model=_from_dict(d, "registered_model", Model))
|
|
7074
4898
|
|
|
7075
4899
|
|
|
7076
|
-
@dataclass
|
|
7077
|
-
class UpdateModelVersionRequest:
|
|
7078
|
-
name: str
|
|
7079
|
-
"""Name of the registered model"""
|
|
7080
|
-
|
|
7081
|
-
version: str
|
|
7082
|
-
"""Model version number"""
|
|
7083
|
-
|
|
7084
|
-
description: Optional[str] = None
|
|
7085
|
-
"""If provided, updates the description for this `registered_model`."""
|
|
7086
|
-
|
|
7087
|
-
def as_dict(self) -> dict:
|
|
7088
|
-
"""Serializes the UpdateModelVersionRequest into a dictionary suitable for use as a JSON request body."""
|
|
7089
|
-
body = {}
|
|
7090
|
-
if self.description is not None:
|
|
7091
|
-
body["description"] = self.description
|
|
7092
|
-
if self.name is not None:
|
|
7093
|
-
body["name"] = self.name
|
|
7094
|
-
if self.version is not None:
|
|
7095
|
-
body["version"] = self.version
|
|
7096
|
-
return body
|
|
7097
|
-
|
|
7098
|
-
def as_shallow_dict(self) -> dict:
|
|
7099
|
-
"""Serializes the UpdateModelVersionRequest into a shallow dictionary of its immediate attributes."""
|
|
7100
|
-
body = {}
|
|
7101
|
-
if self.description is not None:
|
|
7102
|
-
body["description"] = self.description
|
|
7103
|
-
if self.name is not None:
|
|
7104
|
-
body["name"] = self.name
|
|
7105
|
-
if self.version is not None:
|
|
7106
|
-
body["version"] = self.version
|
|
7107
|
-
return body
|
|
7108
|
-
|
|
7109
|
-
@classmethod
|
|
7110
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateModelVersionRequest:
|
|
7111
|
-
"""Deserializes the UpdateModelVersionRequest from a dictionary."""
|
|
7112
|
-
return cls(description=d.get("description", None), name=d.get("name", None), version=d.get("version", None))
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
4900
|
@dataclass
|
|
7116
4901
|
class UpdateModelVersionResponse:
|
|
7117
4902
|
model_version: Optional[ModelVersion] = None
|
|
@@ -7137,160 +4922,6 @@ class UpdateModelVersionResponse:
|
|
|
7137
4922
|
return cls(model_version=_from_dict(d, "model_version", ModelVersion))
|
|
7138
4923
|
|
|
7139
4924
|
|
|
7140
|
-
@dataclass
|
|
7141
|
-
class UpdateRegistryWebhook:
|
|
7142
|
-
"""Details required to update a registry webhook. Only the fields that need to be updated should be
|
|
7143
|
-
specified, and both `http_url_spec` and `job_spec` should not be specified in the same request."""
|
|
7144
|
-
|
|
7145
|
-
id: str
|
|
7146
|
-
"""Webhook ID"""
|
|
7147
|
-
|
|
7148
|
-
description: Optional[str] = None
|
|
7149
|
-
"""User-specified description for the webhook."""
|
|
7150
|
-
|
|
7151
|
-
events: Optional[List[RegistryWebhookEvent]] = None
|
|
7152
|
-
"""Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A new model version was
|
|
7153
|
-
created for the associated model.
|
|
7154
|
-
|
|
7155
|
-
* `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was changed.
|
|
7156
|
-
|
|
7157
|
-
* `TRANSITION_REQUEST_CREATED`: A user requested a model version’s stage be transitioned.
|
|
7158
|
-
|
|
7159
|
-
* `COMMENT_CREATED`: A user wrote a comment on a registered model.
|
|
7160
|
-
|
|
7161
|
-
* `REGISTERED_MODEL_CREATED`: A new registered model was created. This event type can only be
|
|
7162
|
-
specified for a registry-wide webhook, which can be created by not specifying a model name in
|
|
7163
|
-
the create request.
|
|
7164
|
-
|
|
7165
|
-
* `MODEL_VERSION_TAG_SET`: A user set a tag on the model version.
|
|
7166
|
-
|
|
7167
|
-
* `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was transitioned to staging.
|
|
7168
|
-
|
|
7169
|
-
* `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was transitioned to production.
|
|
7170
|
-
|
|
7171
|
-
* `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived.
|
|
7172
|
-
|
|
7173
|
-
* `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model version be transitioned to
|
|
7174
|
-
staging.
|
|
7175
|
-
|
|
7176
|
-
* `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model version be transitioned
|
|
7177
|
-
to production.
|
|
7178
|
-
|
|
7179
|
-
* `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model version be archived."""
|
|
7180
|
-
|
|
7181
|
-
http_url_spec: Optional[HttpUrlSpec] = None
|
|
7182
|
-
|
|
7183
|
-
job_spec: Optional[JobSpec] = None
|
|
7184
|
-
|
|
7185
|
-
status: Optional[RegistryWebhookStatus] = None
|
|
7186
|
-
|
|
7187
|
-
def as_dict(self) -> dict:
|
|
7188
|
-
"""Serializes the UpdateRegistryWebhook into a dictionary suitable for use as a JSON request body."""
|
|
7189
|
-
body = {}
|
|
7190
|
-
if self.description is not None:
|
|
7191
|
-
body["description"] = self.description
|
|
7192
|
-
if self.events:
|
|
7193
|
-
body["events"] = [v.value for v in self.events]
|
|
7194
|
-
if self.http_url_spec:
|
|
7195
|
-
body["http_url_spec"] = self.http_url_spec.as_dict()
|
|
7196
|
-
if self.id is not None:
|
|
7197
|
-
body["id"] = self.id
|
|
7198
|
-
if self.job_spec:
|
|
7199
|
-
body["job_spec"] = self.job_spec.as_dict()
|
|
7200
|
-
if self.status is not None:
|
|
7201
|
-
body["status"] = self.status.value
|
|
7202
|
-
return body
|
|
7203
|
-
|
|
7204
|
-
def as_shallow_dict(self) -> dict:
|
|
7205
|
-
"""Serializes the UpdateRegistryWebhook into a shallow dictionary of its immediate attributes."""
|
|
7206
|
-
body = {}
|
|
7207
|
-
if self.description is not None:
|
|
7208
|
-
body["description"] = self.description
|
|
7209
|
-
if self.events:
|
|
7210
|
-
body["events"] = self.events
|
|
7211
|
-
if self.http_url_spec:
|
|
7212
|
-
body["http_url_spec"] = self.http_url_spec
|
|
7213
|
-
if self.id is not None:
|
|
7214
|
-
body["id"] = self.id
|
|
7215
|
-
if self.job_spec:
|
|
7216
|
-
body["job_spec"] = self.job_spec
|
|
7217
|
-
if self.status is not None:
|
|
7218
|
-
body["status"] = self.status
|
|
7219
|
-
return body
|
|
7220
|
-
|
|
7221
|
-
@classmethod
|
|
7222
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateRegistryWebhook:
|
|
7223
|
-
"""Deserializes the UpdateRegistryWebhook from a dictionary."""
|
|
7224
|
-
return cls(
|
|
7225
|
-
description=d.get("description", None),
|
|
7226
|
-
events=_repeated_enum(d, "events", RegistryWebhookEvent),
|
|
7227
|
-
http_url_spec=_from_dict(d, "http_url_spec", HttpUrlSpec),
|
|
7228
|
-
id=d.get("id", None),
|
|
7229
|
-
job_spec=_from_dict(d, "job_spec", JobSpec),
|
|
7230
|
-
status=_enum(d, "status", RegistryWebhookStatus),
|
|
7231
|
-
)
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
@dataclass
|
|
7235
|
-
class UpdateRun:
|
|
7236
|
-
end_time: Optional[int] = None
|
|
7237
|
-
"""Unix timestamp in milliseconds of when the run ended."""
|
|
7238
|
-
|
|
7239
|
-
run_id: Optional[str] = None
|
|
7240
|
-
"""ID of the run to update. Must be provided."""
|
|
7241
|
-
|
|
7242
|
-
run_name: Optional[str] = None
|
|
7243
|
-
"""Updated name of the run."""
|
|
7244
|
-
|
|
7245
|
-
run_uuid: Optional[str] = None
|
|
7246
|
-
"""[Deprecated, use `run_id` instead] ID of the run to update. This field will be removed in a
|
|
7247
|
-
future MLflow version."""
|
|
7248
|
-
|
|
7249
|
-
status: Optional[UpdateRunStatus] = None
|
|
7250
|
-
"""Updated status of the run."""
|
|
7251
|
-
|
|
7252
|
-
def as_dict(self) -> dict:
|
|
7253
|
-
"""Serializes the UpdateRun into a dictionary suitable for use as a JSON request body."""
|
|
7254
|
-
body = {}
|
|
7255
|
-
if self.end_time is not None:
|
|
7256
|
-
body["end_time"] = self.end_time
|
|
7257
|
-
if self.run_id is not None:
|
|
7258
|
-
body["run_id"] = self.run_id
|
|
7259
|
-
if self.run_name is not None:
|
|
7260
|
-
body["run_name"] = self.run_name
|
|
7261
|
-
if self.run_uuid is not None:
|
|
7262
|
-
body["run_uuid"] = self.run_uuid
|
|
7263
|
-
if self.status is not None:
|
|
7264
|
-
body["status"] = self.status.value
|
|
7265
|
-
return body
|
|
7266
|
-
|
|
7267
|
-
def as_shallow_dict(self) -> dict:
|
|
7268
|
-
"""Serializes the UpdateRun into a shallow dictionary of its immediate attributes."""
|
|
7269
|
-
body = {}
|
|
7270
|
-
if self.end_time is not None:
|
|
7271
|
-
body["end_time"] = self.end_time
|
|
7272
|
-
if self.run_id is not None:
|
|
7273
|
-
body["run_id"] = self.run_id
|
|
7274
|
-
if self.run_name is not None:
|
|
7275
|
-
body["run_name"] = self.run_name
|
|
7276
|
-
if self.run_uuid is not None:
|
|
7277
|
-
body["run_uuid"] = self.run_uuid
|
|
7278
|
-
if self.status is not None:
|
|
7279
|
-
body["status"] = self.status
|
|
7280
|
-
return body
|
|
7281
|
-
|
|
7282
|
-
@classmethod
|
|
7283
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateRun:
|
|
7284
|
-
"""Deserializes the UpdateRun from a dictionary."""
|
|
7285
|
-
return cls(
|
|
7286
|
-
end_time=d.get("end_time", None),
|
|
7287
|
-
run_id=d.get("run_id", None),
|
|
7288
|
-
run_name=d.get("run_name", None),
|
|
7289
|
-
run_uuid=d.get("run_uuid", None),
|
|
7290
|
-
status=_enum(d, "status", UpdateRunStatus),
|
|
7291
|
-
)
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
4925
|
@dataclass
|
|
7295
4926
|
class UpdateRunResponse:
|
|
7296
4927
|
run_info: Optional[RunInfo] = None
|