cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group