Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "'LEGACY_SINGLE_USER_STANDARD' is not a valid DataSecurityMode" when trying to list available cluster names #13

Closed
PaulCornellDB opened this issue Dec 21, 2022 · 5 comments · Fixed by #22

Comments

@PaulCornellDB
Copy link

Repro steps:

  1. Install version 0.0.1 of the Databricks SDK for Python.
  2. Run the following code:
from databricks.sdk import WorkspaceClient

w = WorkspaceClient(host = "https://db-sme-demo-docs.cloud.databricks.com", token = "REDACTED")

for c in w.clusters.list():
  print(c.cluster_name)

Expected:

  • A list of available cluster names in my workspace.

Actual:

  • This error:
Traceback (most recent call last):
  File "/Users/paul.cornell/databricks-python-sdk-demo/main.py", line 5, in <module>
    for c in w.clusters.list():
  File "/Users/paul.cornell/.local/share/virtualenvs/paul.cornell-Otax6dmi/lib/python3.9/site-packages/databricks/sdk/service/clusters.py", line 1908, in list
    return [ClusterInfo.from_dict(v) for v in json['clusters']]
  File "/Users/paul.cornell/.local/share/virtualenvs/paul.cornell-Otax6dmi/lib/python3.9/site-packages/databricks/sdk/service/clusters.py", line 1908, in <listcomp>
    return [ClusterInfo.from_dict(v) for v in json['clusters']]
  File "/Users/paul.cornell/.local/share/virtualenvs/paul.cornell-Otax6dmi/lib/python3.9/site-packages/databricks/sdk/service/clusters.py", line 410, in from_dict
    data_security_mode=DataSecurityMode(d['data_security_mode'])
  File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/enum.py", line 384, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/enum.py", line 702, in __new__
    raise ve_exc
ValueError: 'LEGACY_SINGLE_USER_STANDARD' is not a valid DataSecurityMode
@nfx
Copy link
Contributor

nfx commented Dec 21, 2022

@PaulCornellDB do we observe the same behavior with Go SDK, btw?

@PaulCornellDB
Copy link
Author

PaulCornellDB commented Dec 21, 2022

@nfx No. I just tested the same logic with the Go SDK, and it works as expected.

@nfx
Copy link
Contributor

nfx commented Feb 3, 2023

will be generically fixed with ENUM generation

@nfx
Copy link
Contributor

nfx commented Feb 23, 2023

fix required for consistent behavior:

    a = State.__members__.get('INTRO', None)
    assert a == None

@grusin-db
Copy link
Contributor

I am observing the same issue in 0.0.1 python sdk

@nfx nfx closed this as completed in #22 Mar 1, 2023
nfx added a commit that referenced this issue Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants