fix: don't override per_page in PaginatedList#686
Open
superle3 wants to merge 1 commit intoucfopen:developfrom
Open
fix: don't override per_page in PaginatedList#686superle3 wants to merge 1 commit intoucfopen:developfrom
per_page in PaginatedList#686superle3 wants to merge 1 commit intoucfopen:developfrom
Conversation
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.
d126fdb to
75454b4
Compare
Author
|
fixtures were wrong, updated them and the tests accordingly. |
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.
Proposed Changes
per_pageparameterPaginatedListand change everykwargs=combine_kwargs(**kwargs)to_kwargs=combine_kwargs(**kwargs), since I couldn't find a reason why some were different in the documentation and commits.Fixes #685 .
TODO: a test maybe?