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

The 'get_status()' on WorkspaceConf does not work. #211

Closed
xheox opened this issue Jun 30, 2023 · 1 comment
Closed

The 'get_status()' on WorkspaceConf does not work. #211

xheox opened this issue Jun 30, 2023 · 1 comment
Labels
Bug The issue is a bug. codegen issues related to generated code

Comments

@xheox
Copy link

xheox commented Jun 30, 2023

Description
The 'get_status()' on WorkspaceConf does not work.

Reproduction
using this simple code as in the sample

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

Expected behavior
This should return a json with the status of the feature passed in the "keys"
the following CURL returns an actual result
curl -n https:///api/2.0/workspace-conf?keys=enableIpAccessLists --header "Authorization: Bearer "

the result looks like :
{"enableIpAccessLists":null}

Debug Logs


AttributeError Traceback (most recent call last)
in <cell line: 4>()
2
3 w = WorkspaceClient()
----> 4 conf = w.workspace_conf.get_status(keys=None)

/local_disk0/.ephemeral_nfs/envs/pythonEnv-9db84145-4126-42e9-aa4b-8511b59ec0d9/lib/python3.9/site-packages/databricks/sdk/service/settings.py in get_status(self, keys, **kwargs)
1182
1183 json = self._api.do('GET', '/api/2.0/workspace-conf', query=query)
-> 1184 return WorkspaceConf.from_dict(json)
1185
1186 def set_status(self, **kwargs):

/usr/lib/python3.9/typing.py in getattr(self, attr)
691 # Also for simplicity we just don't relay all dunder names
692 if 'origin' in self.dict and not _is_dunder(attr):
--> 693 return getattr(self.origin, attr)
694 raise AttributeError(attr)
695

AttributeError: type object 'dict' has no attribute 'from_dict'

Other Information

  • executed in notebook in Azure databricks
  • Version: 11.3

Additional context
It would be also nice to find a list of all possible values for the "keys" in the documentation.
https://docs.databricks.com/api/azure/workspace/workspaceconf/getstatus
I am mostly interested in the flag to control the Table Access Control on the workspace level.

@nfx nfx added Bug The issue is a bug. codegen issues related to generated code labels Jul 10, 2023
@nfx
Copy link
Contributor

nfx commented Jul 10, 2023

Duplicate of #128

@nfx nfx marked this as a duplicate of #128 Jul 10, 2023
@nfx nfx closed this as completed Jul 10, 2023
github-merge-queue bot pushed a commit that referenced this issue Feb 1, 2024
## Changes
WorkspaceConf's APIs are unique in Databricks as they are the only
methods that accept a map for the request body (all other methods with
request bodies require a struct). This is incompatible with the Python
SDK, which generally has all fields of the request as method parameters.

This PR changes the behavior of methods that get and return maps. On the
set pathway, autogenerated code will include a field `contents` with a
map type corresponding to the type of the request body. This parameter
will be passed directly into the `do()` method of `ApiClient`. On the
get pathway, we'll return the deserialized response directly (which is
already a dictionary), rather than calling an imaginary
`WorkspaceConf.from_dict()` method.

Closes #500 and #128. Relates to #458, #455, #345, #211, and #167.

## Tests
New integration test for workspace conf passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The issue is a bug. codegen issues related to generated code
Projects
None yet
Development

No branches or pull requests

2 participants