oracle / oracle/oci-python-sdk

Pagination never terminates for oci.tenant_manager_control_plane.OrganizationClient.list_organizations in Python SDK

Open
#718 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

SDK
Dominant language
Python
Stars
474
Forks
321
Avg merge
23m
Merged PRs (30d)
4

Description

It looks like pagination is broken for oci.tenant_manager_control_plane.OrganizationClient.list_organizations, each call returns a response object with a different next_page token and has_next_page set to True, but the items in the data are always the same.

To reproduce just run:

organization_client = oci.tenant_manager_control_plane.OrganizationClient(config)
for response in oci.pagination.list_call_get_all_results_generator(
organization_client.list_organizations, "response", tenancy_ocid
):
print(response.data.items)
print(response.next_page)
print(response.has_next_page)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with oci.tenant_manager_control_plane.OrganizationClient.list_organizations and the oci.pagination.list_call_get_all_results_generator reproduction shown in the issue. Trace how response.next_page and response.has_next_page are handled across calls; done when pagination returns distinct organization items and terminates normally.

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
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.