oracle / oracle/oci-python-sdk
oci.pagination.list_call_get_all_results fails when using identity domain client
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 474
- Forks
- 321
- Avg merge
- 23m
- Merged PRs (30d)
- 4
Description
SDK version 2.123.0
Python version 3.11.4
When attempting to use oci.pagination.list_call_get_all_results with the list_groups method of oci.identity.IdentityClient, the call fails with the following error:
Traceback (most recent call last):
File "/Users/cpasternak/repos/oci_helpers/groups.py", line 48, in get_all_groups_idd
group_list=oci.pagination.list_call_get_all_results(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cpasternak/Library/Python/3.11/lib/python/site-packages/oci/pagination/pagination_utils.py", line 218, in list_call_get_all_results
else aggregated_results.extend(call_result.data.items)
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Groups' object has no attribute 'items'
CODE:
config=valid OCI config
url="https://idcs-c2ee2b3360e24cea83df0f956fb007d5.identity.oraclecloud.com:443"
identity_domain_client = oci.identity_domains.IdentityDomainsClient(config, url)
group_list=oci.pagination.list_call_get_all_results(
identity_domain_client.list_groups,
retry_strategy=oci.retry.DEFAULT_RETRY_STRATEGY
).data
It would appear that the aggregated_results.extend function is looking for .items, but with the identity domain client, it uses the terminology .resources (not .items)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with oci/pagination/pagination_utils.py at list_call_get_all_results, then reproduce the call using identity_domains.IdentityDomainsClient.list_groups. Compare the response data shape used by the pagination helper with the identity domain response, and verify that pagination returns all groups without the AttributeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100