Reputation: 1065
Looking at the documentation of MLFlow and Databricks, you can nicely manage the owner of (feature) tables with
ALTER TABLE <table_name> SET OWNER TO `<owner_name>`;
however, you cannot do this programmatically with MLFlow models. The docs do not specify any of this. Neither when creating the model (then it is always the user that creates the model), nor after the model was created. One can change the owner in the databricks catalog UI. However this wouldn't scale and needs manual change after each creation.
Are there any ways on how to accomplish this?
PS: ChatGPT suggested workarounds as this is currently not doable within an MLFlow and Databricks setting.
There is no command available. There are ways on accomplishing this loading the model each time through the path directly, but this does not fit the idea of the unity catalog to manage permissions etc in one place.
Upvotes: 4
Views: 1034
Reputation: 1065
Thanks a lot. I solved it by using the API through the Databricks SDK for Python by:
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
w.registered_models.update(registered_model_name_fqtn, owner=owner)
Upvotes: 2
Reputation: 1706
You can use the rest api to update the model owner.
In general databricks releases automation capabilities to the api first. I am hopeful there will be a sql way to do this soon given the emphasis databricks is putting on the unity way.
Upvotes: 3