Skip to content

[ISSUE] workspace_conf.get_status failed #500

@danny-db

Description

@danny-db

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions