fix: correct pagination import paths and method names in README#569
Open
nsingh347X wants to merge 1 commit into
Open
fix: correct pagination import paths and method names in README#569nsingh347X wants to merge 1 commit into
nsingh347X wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The pagination section of the README contains two incorrect code examples that cause errors for users following the documentation.
Issue 1 - Wrong import path
The README documents from okta import paginate_all, from okta import paginate_pages and from okta import PaginationHelper. All three throw an ImportError because these are defined in okta/pagination.py but not exported from the top-level oktapackage.
Fix: Import from okta.pagination instead:
from okta.pagination import paginate_all
from okta.pagination import paginate_pages
from okta.pagination import PaginationHelper
Issue 2 - Non-existent method name
The README references list_users_with_http_info throughout the pagination examples. This method does not exist on the client - it throws AttributeError: 'Client' object has no attribute 'list_users_with_http_info'. The correct method is list_users, which already returns a (data, resp, error) tuple including the response headers needed for pagination.
Fix:
Before
async for user in paginate_all(client.list_users_with_http_info, limit=200):
After
async for user in paginate_all(client.list_users, limit=200):
Verification
Both fixes verified against SDK v3.1.0 on Python 3.9.