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

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!