databricks-sdk-py icon indicating copy to clipboard operation
databricks-sdk-py copied to clipboard

[FEATURE] groups api should return members and indication if they are Groups or Users

Open dmoore247 opened this issue 2 years ago • 2 comments

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

dmoore247 avatar Aug 30 '23 02:08 dmoore247

Can you please include the code sample and debug logs as specified in the issue template?

mgyucht avatar Aug 30 '23 13:08 mgyucht

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

schmocker avatar Jul 22 '25 14:07 schmocker