-
Notifications
You must be signed in to change notification settings - Fork 193
[ISSUE] workspace_conf.get_status failed #500
Copy link
Copy link
Closed
Description
Description
Getting the error message - AttributeError: type object 'dict' has no attribute 'from_dict'
Reproduction
Run this on a Databricks notebook:
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
conf = w.workspace_conf.get_status(keys="enableDcs")
Expected behavior
Return the workspace configuration
Stacktrace
AttributeError: type object 'dict' has no attribute 'from_dict'
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File <command-69050624337820>, line 4
1 from databricks.sdk import WorkspaceClient
2 w = WorkspaceClient()
----> 4 conf = w.workspace_conf.get_status(keys="enableDcs")
File /local_disk0/.ephemeral_nfs/envs/pythonEnv-cd22f41e-e6dc-4f0d-8e40-6bc38f57be3d/lib/python3.10/site-packages/databricks/sdk/service/settings.py:1397, in WorkspaceConfAPI.get_status(self, keys)
1395 headers = {'Accept': 'application/json', }
1396 res = self._api.do('GET', '/api/2.0/workspace-conf', query=query, headers=headers)
-> 1397 return WorkspaceConf.from_dict(res)
File /usr/lib/python3.10/typing.py:983, in _BaseGenericAlias.__getattr__(self, attr)
980 # We are careful for copy and pickle.
981 # Also for simplicity we don't relay any dunder names
982 if '__origin__' in self.__dict__ and not _is_dunder(attr):
--> 983 return getattr(self.__origin__, attr)
984 raise AttributeError(attr)
AttributeError: type object 'dict' has no attribute 'from_dict'
Additional context
Looks like WorkspaceConf is a dictionary, but trying to call the class method from_dict:
https://github.com/databricks/databricks-sdk-py/blob/main/databricks/sdk/service/settings.py#L2428
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels