Ensure CursorPagination respects nulls in the ordering field#8912
Ensure CursorPagination respects nulls in the ordering field#8912auvipy merged 9 commits intoencode:masterfrom
Conversation
auvipy
left a comment
There was a problem hiding this comment.
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. |
|
For the paper trail, this is reverted in #9381. |
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/__gtfilter, which implicitly filters out nulls altogether.