databricks-sdk-py
databricks-sdk-py copied to clipboard
[FEATURE] groups api should return members and indication if they are Groups or Users
Problem Statement Want to determine if a group member is a Group or a User
Proposed Solution
a.groups.list() should return a member with a type property that is either User or Group, example:
ComplexValue(display='iq_account_2',
primary=None,
type='User',
value='92394234234')
Additional Context
The SCIM api does provide $ref:User/1231293123 and $reg:Group/12123913 clues as to the member type but this is lost in the objects returned by a.groups.list(). (version 0.6.0
Can you please include the code sample and debug logs as specified in the issue template?
I agree with the 2 issues stated here:
- groups api should return members
- working fine for groups managed in Databricks
- not working for groups coming from Azure EntraID
- indication if they are Groups or Users or SPIs
- members of Groups should be of type Group, User or ServicePrincipal, not ComplexValue
Example:
from databricks.sdk import WorkspaceClient
display_name = 'some_existing_group'
workspace_client = WorkspaceClient()
groups = workspace_client.groups.list(filter=f'DisplayName eq {display_name}' )
group = next(groups)
members = group.members
Output if group managed in Databricks:
[ComplexValue(display=' .....
Output if group managed in Azure EntraID:
None