unitycatalog.models¶
The classes of the models API.
Classes
| Name | Description |
|---|---|
ListModelVersionsResponse |
|
ListRegisteredModelsResponse |
|
ModelVersionInfo |
A version of a registered model. The server gives each new version the next number. |
RegisteredModelClient |
The requests on one RegisteredModelInfo. |
RegisteredModelInfo |
A registered model: a securable in the three-level namespace (catalog.schema.model) that holds model versions. |
Enums
| Name | Description |
|---|---|
ModelVersionStatus |
The status of a model version: where the upload of its files stands. |
class unitycatalog.models.ListModelVersionsResponse¶
Attributes
- model_versions (list[ModelVersionInfo]) – The model versions.
- next_page_token (str | None) – Opaque token of the next page. Absent on the last page.
class unitycatalog.models.ListRegisteredModelsResponse¶
Attributes
- next_page_token (str | None) – Opaque token of the next page. Absent on the last page.
- registered_models (list[RegisteredModelInfo]) – The registered models.
class unitycatalog.models.ModelVersionInfo¶
A version of a registered model. The server gives each new version the next number.
Attributes
- catalog_name (str) – Name of the parent catalog.
- comment (str | None) – User-provided free-form text description.
- created_at (int) – Time at which the model version was created, in epoch milliseconds.
- created_by (str | None) – Username of the creator of the model version.
- id (str) – Unique identifier of the model version.
- model_name (str) – Name of the parent registered model, relative to its schema.
- run_id (str | None) – ID of the run of the ML package that made the model.
- schema_name (str) – Name of the parent schema.
- source (str) – URI of the source files the model version was created from, such as an MLflow run artifact path.
- status (ModelVersionStatus | None) – Status of the model version.
- storage_location (str) – Storage location of the files of the model version.
- updated_at (int) – Time at which the model version was last changed, in epoch milliseconds.
- updated_by (str | None) – Username of the user who last changed the model version.
- version (int) – Number of the model version.
class unitycatalog.models.RegisteredModelClient¶
The requests on one RegisteredModelInfo.
delete(*, force: bool | None = None) → None¶
Delete a registered model. A model with versions needs force.
Parameters
- force (bool | None, optional) – Delete the model versions of the registered model too.
Async: delete_async(…) → Future[None]
get(*, include_browse: bool | None = None) → RegisteredModelInfo¶
Get a registered model.
Parameters
- include_browse (bool | None, optional) – Also answer a caller who sees the registered model through the
BROWSEprivilege only, with its discovery fields andbrowse_onlyset.
Returns
- RegisteredModelInfo – A registered model: a securable in the three-level namespace (catalog.schema.model) that holds model versions.
Async: get_async(…) → Future[RegisteredModelInfo]
update(*,comment: str | None = None,new_name: str | None = None,) → RegisteredModelInfo¶
Change a registered model.
Parameters
- comment (str | None, optional) – User-provided free-form text description.
- new_name (str | None, optional) – New name of the registered model, relative to its schema.
Returns
- RegisteredModelInfo – A registered model: a securable in the three-level namespace (catalog.schema.model) that holds model versions.
Async: update_async(…) → Future[RegisteredModelInfo]
class unitycatalog.models.RegisteredModelInfo¶
A registered model: a securable in the three-level namespace (catalog.schema.model) that holds model versions.
Attributes
- browse_only (bool | None) – True when the registered model has only the discovery fields that the
BROWSEprivilege allows. - catalog_name (str) – Name of the parent catalog.
- comment (str | None) – User-provided free-form text description.
- created_at (int) – Time at which the registered model was created, in epoch milliseconds.
- created_by (str | None) – Username of the creator of the registered model.
- full_name (str) – Three-level name of the registered model:
catalog.schema.model. - id (str) – Unique identifier of the registered model.
- name (str) – Name of the registered model, relative to its schema.
- owner (str | None) – Username of the owner of the registered model.
- schema_name (str) – Name of the parent schema.
- storage_location (str) – Storage location under which the model versions keep their files.
- updated_at (int) – Time at which the registered model was last changed, in epoch milliseconds.
- updated_by (str | None) – Username of the user who last changed the registered model.
class unitycatalog.models.ModelVersionStatus¶
The status of a model version: where the upload of its files stands.
Members
- MODEL_VERSION_STATUS_UNKNOWN – The status is not known.
- PENDING_REGISTRATION – The client has not yet written all files of the model version. A new model version has this status.
- FAILED_REGISTRATION – The client failed to write all files of the model version.
- READY – The client wrote all files and finalized the model version.