How to set model owner programmatically within databricks and mlflow?

228 Views Asked by At

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.

1

There are 1 best solutions below

0
On

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.