Skip to content

[ISSUE] wc.workspace_conf.get_status("enableDeprecatedClusterNamedInitScripts") is failing with type object 'dict' has no attribute 'from_dict' #458

@alexott

Description

@alexott

Description

workspace_conf.get_status fails with error

Reproduction

In a notebook, with DBR 14.0 ML run

wc = WorkspaceClient()
wc.workspace_conf.get_status("enableDeprecatedClusterNamedInitScripts")

it fails with following error:

ttributeError: type object 'dict' has no attribute 'from_dict'
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File <command-85549842133900>, line 1
----> 1 wc.workspace_conf.get_status(keys="enableDeprecatedClusterNamedInitScripts")

File /local_disk0/.ephemeral_nfs/envs/pythonEnv-31d522b2-5781-46e3-8fbb-a8f7361afd1d/lib/python3.10/site-packages/databricks/sdk/service/settings.py:1691, in WorkspaceConfAPI.get_status(self, keys)
   1689 headers = {'Accept': 'application/json', }
   1690 res = self._api.do('GET', '/api/2.0/workspace-conf', query=query, headers=headers)
-> 1691 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)

Expected behavior
A clear and concise description of what you expected to happen.

Is it a regression?
Did this work in a previous version of the SDK? If so, which versions did you try?

Debug Logs
The SDK logs helpful debugging information when debug logging is enabled. Set the log level to debug by adding logging.basicConfig(level=logging.DEBUG) to your program, and include the logs here.

I see that REST API call is done correctly:

EBUG:urllib3.connectionpool:https://oregon.cloud.databricks.com:443 "GET /api/2.0/workspace-conf?keys=enableDeprecatedClusterNamedInitScripts HTTP/1.1" 200 None
DEBUG:databricks.sdk:GET /api/2.0/workspace-conf?keys=enableDeprecatedClusterNamedInitScripts
< 200 OK
< {
<   "enableDeprecatedClusterNamedInitScripts": null
< }

Other Information

  • OS: [e.g. macOS]
  • Version: [e.g. 0.1.0]

Additional context
Add any other context about the problem here.

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