-
Notifications
You must be signed in to change notification settings - Fork 101
group matching logic has changed due to changes on the API #190
Copy link
Copy link
Closed
Description
API has changed in terms of account-level group listing. Now we don't need to use the account level method, but just to filter out the relevant groups:
# databricks/labs/ucx/managers/group.py
....
@staticmethod
def _get_group(group_name, level: GroupLevel) -> Group | None:
query_filter = f"displayName eq '{group_name}'"
attributes = ",".join(["id", "displayName", "meta", "entitlements", "roles", "members"])
relevant_groups = provider.ws.groups.list(filter=query_filter, attributes=attributes)
resource_type = (
ResourceMeta(resource_type="Group")
if level == GroupLevel.ACCOUNT
else ResourceMeta(resource_type="WorkspaceGroup")
)
group = next(
iter([g for g in relevant_groups if g.meta == resource_type]),
None,
)
return group
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels