arcgis-python-api
arcgis-python-api copied to clipboard
Group "providerGroupName" property returns None
Describe the bug Whenever I try to access group "providerGroupName" property from group search results, I get "None" value. Note that this property is not documented: https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#group But I have been told to use it in: https://github.com/Esri/arcgis-python-api/issues/951
To Reproduce Steps to reproduce the behavior:
from arcgis.gis import GIS
portal_url = "https://myorgportal.company.com/portal"
portal_username = "admin"
portal_password = "foo"
ent_gis = GIS(portal_url, portal_username, portal_password, verify_cert=False)
editing_groups = ent_gis.groups.search(query="tags:Edition",sort_field="title",sort_order="asc",outside_org=False)
for editing_group in editing_groups:
print(editing_group.providerGroupName)
error:
None
None
None
None
Screenshots If applicable, add screenshots to help explain your problem.
Expected behavior
providerGroupName should not be None if there is a value defined.
Platform (please complete the following information):
- OS: Windows
- Python API Version: 2.0.1 but was already there in 1.8.2
Additional context Add any other context about the problem here, attachments etc.
Hello, when you go into your group in your Portal are you able to see provider group names for these groups? None will appear if there is no association between a Portal group and an Active Directory or LDAP group.
Hello,
Yes, of course I can see the provider group name for these groups. I can see in the REST API as well: https://myorgportal.company.com/portal/sharing/rest/community/groups/2adfbffb446f4aca9a00f763119f9c9f?f=json&token=foo
Indeed, "there is no association between a Portal group and an Active Directory or LDAP group" because "SAML based group membership" is enabled.
Why not just forwarding the reply from the sharing API ?
Thanks
Is this bug going to be fixed? I am getting the same results.
@whitacrej Hello, we are working on fixing this
@Biboba @whitacrej
This is found to be a similar issue as when querying an Item. If you are to search for the Item, different parameters are specified than when you use the get
method to retrieve the Item by it's id.
If you take one of the groups that has a provider group name and use gis.groups.get("<id>")
then the providerGroupName will be specified for the group.
We will work on a fix for this but as of now you will have to create a list of the group ids from the search and then use the get method to get all of the correct parameters.
For example:
from arcgis.gis import GIS
portal_url = "https://myorgportal.company.com/portal"
portal_username = "admin"
portal_password = "foo"
ent_gis = GIS(portal_url, portal_username, portal_password, verify_cert=False)
editing_groups = ent_gis.groups.search(query="tags:Edition",sort_field="title",sort_order="asc",outside_org=False)
for editing_group in editing_groups:
edit_group = ent_gis.groups.get(editing_group["id"])
print(edit_group.providerGroupName)