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 result from calling AccountClient.groups.list() returns only the id and display_name fields, the other attributes are None or []. For the members field, I can find it using groups.get() but not groups.list(), so if I want information for members of the groups I need to iterate over all groups using the get?
Additionally, it seems that the names of the fields internally are different from the names you need to use for the attributes= or filter= arguments.
from databricks.sdk import AccountClient
from pprint import pprint
act_client = AccountClient(host, account_id, client_id, client_secret)
gg = act_client.groups.list()
for g in gg:
pprint(g)
# out: members not present
# Group(display_name='my-group-name',
# entitlements=[],
# external_id=None,
# groups=[],
# id='00000000000001',
# members=[],
# meta=None,
# roles=[],
# schemas=None)
sg = act_client.groups.get(id="00000000000001")
pprint(sg)
# out: members present when using get() but not list()
# Group(display_name='my-group-name',
# entitlements=[],
# external_id=None,
# groups=[],
# id='00000000000001',
# members=[ComplexValue(display='First Last', ...),
# ...,
# ],
# meta=None,
# roles=[],
# schemas=[<GroupSchema.URN_IETF_PARAMS_SCIM_SCHEMAS_CORE_2_0_GROUP: 'urn:ietf:params:scim:schemas:core:2.0:Group'>])
names are different when using args:
ex) display name is camelCase when using arg, but snakecase when calling Group.display_name
gg = act_client.groups.list(filter="display_name co 'my-group'")
for g in gg:
pprint(g)
# out BadRequest: invalidValue Not a valid attribute name/uri
gg = act_client.groups.list(filter="displayName co 'my-group'")
for g in gg:
pprint(g)
pprint(g.display_name)
# out: successfully finds group
attributes arg has same issue and does not work as expected
gg = act_client.groups.list(attributes="id")
for g in gg:
pprint(g)
# out: same elements as not specifying attributes, with display_name set to None
# Group(display_name=None,
# entitlements=[],
# external_id=None,
# groups=[],
# id='00000000000001',
# members=[],
# meta=None,
# roles=[],
# schemas=None)
gg = act_client.groups.list(attributes="id,displayName,members")
for g in gg:
pprint(g)
# out: display_name now populated, still missing info from groups.get(id)
# Group(display_name='my-group-name',
# entitlements=[],
# external_id=None,
# groups=[],
# id='00000000000001',
# members=[],
# meta=None,
# roles=[],
# schemas=None)
Expected behavior
Names used in args like attributes and filter should be consistent with the Group output
groups.list() should return the same information as groups.get() for the same group
Is it a regression?
Did this work in a previous version of the SDK? If so, which versions did you try?
Tested on 0.33.0 to 0.35.0 and got same results
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.
Other Information
Version: Name: databricks-sdk Version: 0.35.0
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Description
The result from calling
AccountClient.groups.list()
returns only theid
anddisplay_name
fields, the other attributes areNone
or[]
. For the members field, I can find it usinggroups.get()
but notgroups.list()
, so if I want information for members of the groups I need to iterate over all groups using theget
?Additionally, it seems that the names of the fields internally are different from the names you need to use for the
attributes=
orfilter=
arguments.docs followed:
https://databricks-sdk-py.readthedocs.io/en/latest/account/iam/groups.html
https://databricks-sdk-py.readthedocs.io/en/latest/dbdataclasses/iam.html#databricks.sdk.service.iam.Group
Reproduction
list()
does not return the same info asget()
:attributes
arg has same issue and does not work as expectedExpected behavior
attributes
andfilter
should be consistent with the Group outputIs it a regression?
Did this work in a previous version of the SDK? If so, which versions did you try?
Tested on 0.33.0 to 0.35.0 and got same results
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.Other Information
Version:
Name: databricks-sdk Version: 0.35.0
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: