cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to get mlflow central model registry to work with dbconnect.

sajith_appukutt
Honored Contributor II

I'm working on setting up tooling to allow team members to easily register and load models from a central mlflow model registry via dbconnect.

However after following the instructions at the public docs , hitting this error

raise _NoDbutilsError
mlflow.utils.databricks_utils._NoDbutilsError 

Looks like _get_dbutils in mlflow expects a valid instance of  ip_shell. Any pointers or workarounds on how to get dbconnect to work with central model registry

1 ACCEPTED SOLUTION

Accepted Solutions

sajith_appukutt
Honored Contributor II

You could monkey patch MLFlow's _get_dbutils() with something similar to this to get this working while connecting from dbconnect

spark = SparkSession.builder.getOrCreate()
# monkey-patch MLFlow's _get_dbutils()
def _get_dbutils():
    return DBUtils(spark)
 
mlflow.utils.databricks_utils._get_dbutils = _get_dbutils

View solution in original post

1 REPLY 1

sajith_appukutt
Honored Contributor II

You could monkey patch MLFlow's _get_dbutils() with something similar to this to get this working while connecting from dbconnect

spark = SparkSession.builder.getOrCreate()
# monkey-patch MLFlow's _get_dbutils()
def _get_dbutils():
    return DBUtils(spark)
 
mlflow.utils.databricks_utils._get_dbutils = _get_dbutils

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.