Skip to main content

model_registry_transitions

Creates, updates, deletes, gets or lists a model_registry_transitions resource.

Overview

Namemodel_registry_transitions
TypeResource
Iddatabricks_workspace.ml.model_registry_transitions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier for the object.
user_idstringThe username of the user that created the object.
activity_typestringType of activity. Valid values are: * `APPLIED_TRANSITION`: User applied the corresponding stage<br />transition.<br /><br />* `REQUESTED_TRANSITION`: User requested the corresponding stage transition.<br /><br />* `CANCELLED_REQUEST`: User cancelled an existing transition request.<br /><br />* `APPROVED_REQUEST`: User approved the corresponding stage transition.<br /><br />* `REJECTED_REQUEST`: User rejected the coressponding stage transition.<br /><br />* `SYSTEM_TRANSITION`: For events performed as a side effect, such as archiving existing model<br />versions in a stage. (APPLIED_TRANSITION, APPROVED_REQUEST, CANCELLED_REQUEST, NEW_COMMENT, REJECTED_REQUEST, REQUESTED_TRANSITION, SYSTEM_TRANSITION)
commentstringUser-provided comment associated with the activity, comment, or transition request.
creation_timestampintegerCreation time of the object, as a Unix timestamp in milliseconds.
from_stagestringSource stage of the transition (if the activity is stage transition related). Valid values are: * `None`: The initial stage of a model version. * `Staging`: Staging or pre-production stage. * `Production`: Production stage. * `Archived`: Archived stage.
last_updated_timestampintegerTime of the object at last update, as a Unix timestamp in milliseconds.
system_commentstringComment made by system, for example explaining an activity of type `SYSTEM_TRANSITION`. It usually describes a side effect, such as a version being archived as part of another version's stage transition, and may not be returned for some activity types.
to_stagestringTarget stage of the transition (if the activity is stage transition related). Valid values are: * `None`: The initial stage of a model version. * `Staging`: Staging or pre-production stage. * `Production`: Production stage. * `Archived`: Archived stage.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectname, version, deployment_nameGets a list of all open stage transition requests for the model version.
createinsertdeployment_name, name, version, stageCreates a model version stage transition request.
approveexecdeployment_name, name, version, stage, archive_existing_versionsApproves a model version stage transition request.
deleteexecname, version, stage, creator, deployment_namecommentCancels a model version stage transition request.
rejectexecdeployment_name, name, version, stageRejects a model version stage transition request.
transitionexecdeployment_name, name, version, stage, archive_existing_versionsTransition a model version's stage. This is a Databricks workspace version of the [MLflow endpoint]

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
creatorstringUsername of the user who created this request. Of the transition requests matching the specified details, only the one transition created by this user will be deleted.
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
namestringName of the model.
stagestringTarget stage of the transition request. Valid values are: * None: The initial stage of a model version. * Staging: Staging or pre-production stage. * Production: Production stage. * Archived: Archived stage.
versionstringVersion of the model.
commentstringUser-provided comment on the action.

SELECT examples

Gets a list of all open stage transition requests for the model version.

SELECT
id,
user_id,
activity_type,
comment,
creation_timestamp,
from_stage,
last_updated_timestamp,
system_comment,
to_stage
FROM databricks_workspace.ml.model_registry_transitions
WHERE name = '{{ name }}' -- required
AND version = '{{ version }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Creates a model version stage transition request.

INSERT INTO databricks_workspace.ml.model_registry_transitions (
name,
version,
stage,
comment,
deployment_name
)
SELECT
'{{ name }}' /* required */,
'{{ version }}' /* required */,
'{{ stage }}' /* required */,
'{{ comment }}',
'{{ deployment_name }}'
RETURNING
request
;

Lifecycle Methods

Approves a model version stage transition request.

EXEC databricks_workspace.ml.model_registry_transitions.approve 
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"name": "{{ name }}",
"version": "{{ version }}",
"stage": "{{ stage }}",
"archive_existing_versions": {{ archive_existing_versions }},
"comment": "{{ comment }}"
}'
;