Closed mfilan closed 1 month ago
Nevermind, solved it with monkey patching:
from databricks.sdk import WorkspaceClient, dbutils as sdk_dbutils
import databricks.sdk.core as client
w = WorkspaceClient(
host = HOST,
token = TOKEN
)
def _make_dbutils(config: client.Config):
return sdk_dbutils.RemoteDbUtils(config)
w._dbutils = _make_dbutils(w._config)
for c in w.clusters.list():
print(c.cluster_name)
w.dbutils.fs.ls('/FileStore/')
Description After token authorisation with WorkspaceClient,
w.clusters.list()
correctly lists the clusters of the connected workspace, whereasw.dbutils.fs.ls
shows current workspace's files.Reproduction
Expected behavior
w.dbutils.fs.ls()
method correctly shows files present in the connected workspace.Other Information
Version: 0.28.0
Additional context The issue has been found when trying to use the databricks-sdk package inside databricks notebooks.