-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Ensure CursorPagination respects nulls in the ordering field #8912
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please make sure that the tests also pass and no regression introduced?
Hi @auvipy 👋 I saw the MockQuerySet ( There are also a number of errors that do not look related to this PR (isoformat datetime discrepancies etc). Could you have a look? |
the CI is stable in main branch, if you fiix it, I can look into the others for sure. btw which issue you are trying to fix? |
I haven't created an issue for this PR. Would you like me to create one?
ok interesting, that these can be side-effects of this PR 🤔
|
you can describe that in description section too. and yes those are side-effects of this PR |
what exactly would you like me to add to the current description of the bug? |
both |
found out these errors also occur on master, they just don't fail tox overall 👍 |
I fixed the existing pagination tests, will add a new test that covers nulls in the ordering field. |
thanks, and will be looking forward to more relevant tests |
hi @auvipy 👋 any chance you could cut a new release any time soon? |
I'm waiting for Original creators response. I hope that will happen soon |
…ncode#8912)" This reverts commit b1cec51.
we have to revert this for some issues |
thanks for the ping, #9381 makes total sense. |
Note: Before submitting this pull request, please review our contributing guidelines.
Description
When some records contain a null for the ordering field:
Currently, if we cursor paginate with
?page_size=1&ordering=-year
(the nulls will come first), we'll paginate: 1, 4, 3.Expected behaviour: 1, 2, 4, 3.
The problem lies in the
__lt
/__gt
filter, which implicitly filters out nulls altogether.