Skip to content

[ISSUE] w.workspace_conf.get_status - AttributeError: type object 'dict' has no attribute 'from_dict' #345

@snowch

Description

@snowch

Description

I received the following exception:

Traceback (most recent call last):
  File "/databricks/python/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3378, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<command-1207976897601940>", line 8, in <module>
    conf = w.workspace_conf.get_status(keys="enableWorkspaceFilesystem")
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-1b805d4b-f851-4007-9970-aa16ffb0933a/lib/python3.9/site-packages/databricks/sdk/service/settings.py", line 1397, in get_status
    return WorkspaceConf.from_dict(res)
  File "/usr/lib/python3.9/typing.py", line 693, in __getattr__
    return getattr(self.__origin__, attr)
AttributeError: type object 'dict' has no attribute 'from_dict'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/databricks/python/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 1997, in showtraceback
    stb = self.InteractiveTB.structured_traceback(
  File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 1112, in structured_traceback
    return FormattedTB.structured_traceback(
  File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 1006, in structured_traceback
    return VerboseTB.structured_traceback(
  File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 859, in structured_traceback
    formatted_exception = self.format_exception_as_a_whole(etype, evalue, etb, number_of_lines_of_context,
  File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 812, in format_exception_as_a_whole
    frames.append(self.format_record(r))
  File "/databricks/python/lib/python3.9/site-packages/IPython/core/ultratb.py", line 730, in format_record
    result += ''.join(_format_traceback_lines(frame_info.lines, Colors, self.has_colors, lvals))
  File "/databricks/python/lib/python3.9/site-packages/stack_data/utils.py", line 145, in cached_property_wrapper
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/databricks/python/lib/python3.9/site-packages/stack_data/core.py", line 698, in lines
    pieces = self.included_pieces
  File "/databricks/python/lib/python3.9/site-packages/stack_data/utils.py", line 145, in cached_property_wrapper
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/databricks/python/lib/python3.9/site-packages/stack_data/core.py", line 649, in included_pieces
    pos = scope_pieces.index(self.executing_piece)
  File "/databricks/python/lib/python3.9/site-packages/stack_data/utils.py", line 145, in cached_property_wrapper
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/databricks/python/lib/python3.9/site-packages/stack_data/core.py", line 628, in executing_piece
    return only(
  File "/databricks/python/lib/python3.9/site-packages/executing/executing.py", line 164, in only
    raise NotOneValueFound('Expected one value, found 0')
executing.executing.NotOneValueFound: Expected one value, found 0

Reproduction

from databricks.sdk import WorkspaceClient
import logging

logging.basicConfig(level=logging.DEBUG)

w = WorkspaceClient()

conf = w.workspace_conf.get_status(keys="enableWorkspaceFilesystem")

Expected behavior

conf should be Dict[str,str]

Debug Logs

DEBUG:databricks.sdk:/root/.databrickscfg does not exist
DEBUG:databricks.sdk:Attempting to configure auth: pat
DEBUG:databricks.sdk:Attempting to configure auth: basic
DEBUG:databricks.sdk:Attempting to configure auth: metadata-service
DEBUG:databricks.sdk:Attempting to configure auth: oauth-m2m
DEBUG:databricks.sdk:Attempting to configure auth: azure-client-secret
DEBUG:databricks.sdk:Attempting to configure auth: azure-cli
DEBUG:databricks.sdk:Attempting to configure auth: external-browser
DEBUG:databricks.sdk:Attempting to configure auth: databricks-cli
DEBUG:databricks.sdk:Attempting to configure auth: runtime
DEBUG:py4j.clientserver:Command to send: i
java.util.HashMap
e

DEBUG:py4j.clientserver:Answer received: !yao635
DEBUG:py4j.clientserver:Command to send: c
o635
put
spackageNameRaw
sdbruntime
e

DEBUG:py4j.clientserver:Answer received: !yn
DEBUG:py4j.clientserver:Command to send: c
o635
put
spackageNameAllowlisted
s22a5145ea2dae9ca02b280a74ea51ee7ffd37e81970529947d8189308ded7814
e

DEBUG:py4j.clientserver:Answer received: !yn
DEBUG:py4j.clientserver:Command to send: c
o635
put
spackageHash
s22a5145ea2dae9ca02b280a74ea51ee7ffd37e81970529947d8189308ded7814
e

DEBUG:py4j.clientserver:Answer received: !yn
DEBUG:py4j.clientserver:Command to send: c
o635
put
spackageVersion
sunknown
e

DEBUG:py4j.clientserver:Answer received: !yn
DEBUG:py4j.clientserver:Command to send: c
o378
logUsage
spythonPackageImported
ro635
n
e

DEBUG:py4j.clientserver:Answer received: !yv
DEBUG:databricks.sdk:[init_runtime_repl_auth] runtime native auth configured
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): adb-4220020519396524.4.azuredatabricks.net:443
DEBUG:py4j.clientserver:Command to send: i
java.util.HashMap
e

DEBUG:py4j.clientserver:Answer received: !yao636
DEBUG:py4j.clientserver:Command to send: c
o636
put
spackageNameRaw
stime
e

DEBUG:py4j.clientserver:Answer received: !yn
DEBUG:py4j.clientserver:Command to send: c
o636
put
spackageNameAllowlisted
s336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e
e

DEBUG:py4j.clientserver:Answer received: !yn
DEBUG:py4j.clientserver:Command to send: c
o636
put
spackageHash
s336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e
e

DEBUG:py4j.clientserver:Answer received: !yn
DEBUG:py4j.clientserver:Command to send: c
o636
put
spackageVersion
sunknown
e

DEBUG:py4j.clientserver:Answer received: !yn
DEBUG:py4j.clientserver:Command to send: c
o378
logUsage
spythonPackageImported
ro636
n
e

DEBUG:py4j.clientserver:Answer received: !yv
DEBUG:urllib3.connectionpool:https://adb-4220020519396524.4.azuredatabricks.net:443 "GET /api/2.0/workspace-conf?keys=enableWorkspaceFilesystem HTTP/1.1" 200 None
DEBUG:databricks.sdk:GET /api/2.0/workspace-conf?keys=enableWorkspaceFilesystem
< 200 OK
< {
<   "enableWorkspaceFilesystem": "true"
< }

Other Information

  • databricks_sdk-0.8.0-py3-none-any.whl
  • Databricks Runtime Version: [12.2 LTS ML (includes Apache Spark 3.3.2, Scala 2.12)
  • Node type: Standard_DS3_v2

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