fix(redis): Return all items from Redis dataset get_data with desc=True and limit=None#1939
Open
vdusek wants to merge 1 commit into
Open
fix(redis): Return all items from Redis dataset get_data with desc=True and limit=None#1939vdusek wants to merge 1 commit into
get_data with desc=True and limit=None#1939vdusek wants to merge 1 commit into
Conversation
…and `limit=None` The match statement fell through to the generic descending arm and built the JSON path `$[:-0]`, which slice semantics evaluate to an empty array, so a non-empty dataset silently returned zero items.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1939 +/- ##
==========================================
+ Coverage 92.85% 92.94% +0.08%
==========================================
Files 167 167
Lines 11714 11716 +2
==========================================
+ Hits 10877 10889 +12
+ Misses 837 827 -10
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:
|
get_data with desc=True and limit=Noneget_data with desc=True and limit=None
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.
Description
RedisDatasetClient.get_datacalled withdesc=True, offset=0, limit=Nonefell through to the generic descending match arm and built the Redis JSON path$[:-0]. Slice semantics treat-0as0, so the path evaluated to an empty array and a non-empty dataset silently returned zero items, while the symmetric ascending call correctly returned everything.This adds an explicit
case (True, 0, None)arm producing$[:](all items, reversed afterwards by the existingdeschandling), plus a regression test.