You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
/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'
## 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.
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
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.
The text was updated successfully, but these errors were encountered: