fix(memory-storage): Apply skip_empty after pagination in MemoryDatasetClient.get_data#1937
Open
vdusek wants to merge 1 commit into
Open
fix(memory-storage): Apply skip_empty after pagination in MemoryDatasetClient.get_data#1937vdusek wants to merge 1 commit into
vdusek wants to merge 1 commit into
Conversation
The skip_empty filter was applied before the offset/limit slice, so the same query returned different items than FileSystemDatasetClient.get_data and even MemoryDatasetClient.iterate_items. Paginate first and filter the sliced page to keep all storage clients consistent.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1937 +/- ##
==========================================
+ Coverage 92.85% 92.92% +0.06%
==========================================
Files 167 167
Lines 11714 11714
==========================================
+ Hits 10877 10885 +8
+ Misses 837 829 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
MemoryDatasetClient.get_dataapplied theskip_emptyfilter before theoffset/limitslice, whileFileSystemDatasetClient.get_dataandMemoryDatasetClient.iterate_itemsboth paginate first and then drop empty items. As a result,get_data(skip_empty=True, offset=N, limit=M)returned a different set of items depending on the storage backend, and disagreed withiterate_itemson the same memory client.This change reorders the operations in
MemoryDatasetClient.get_datato apply thedescreversal, then theoffset/limitslice, and only then filter out empty items — matching the other implementations. The returnedcount/total/offsetpagination math is now also internally consistent whenskip_empty=True.