We're using the following method (generated by using dbx) to access dbutils, e.g. to retrieve parameters from secret scopes:
@staticmethod
def _get_dbutils(spark: SparkSession) -> "dbutils":
try:
from pyspark.dbutils import DBUtils # type: ignore
if "dbutils" not in locals():
utils = DBUtils(spark)
return utils
else:
return locals().get("dbutils") # type: ignore
except ImportError:
return None # type: ignore
However, I discovered when running on Databricks Runtime 13 that this no longer works.
I checked release notes for 13, but saw nothing relevant.
How can we access dbutils in library code in runtime 13?