Skip to content

fix: don't override per_page in PaginatedList #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

superle3
Copy link

@superle3 superle3 commented Mar 21, 2025

Proposed Changes

  • Don't override per_page parameter
  • update readme to state 100 is used instead of the 10 default when it is not specified, but we specify it already by default
  • add _kwargs as arg to PaginatedList and change every kwargs=combine_kwargs(**kwargs) to _kwargs=combine_kwargs(**kwargs), since I couldn't find a reason why some were different in the documentation and commits.
  • specify the per_page parameter in the mock requests.

Fixes #685 .

TODO: a test maybe?

Currently a default is set for `per_page` to 100, but later the manner of passing params to the functions was updated such that it is not the default but instead overrides `per_page`.
You would get a dict of `{"_kwargs": [("per_page": 1)], "per_page": 100}
which then converts to the following request
https://institution/api/v1/courses?per_page=1&per_page=100
since we define `per_page` later it will also be put in later when expanded with .items().

keeps the same behaviour as before except that _kwargs now must be list[tuple[str,Any]], this doesn't break anything internally, but can break other people's code.

Also made _kwargs keyword consistent for all PaginatedList calls, couldn't find any reason why they were different.
@superle3 superle3 force-pushed the issue/685-PaginatedList-doesnt-process-per_page-and-other-kwargs branch from d126fdb to 75454b4 Compare March 22, 2025 23:29
@superle3
Copy link
Author

fixtures were wrong, updated them and the tests accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PaginatedList doesn't process per_page and other kwargs
1 participant