Skip to content

fix(memory-storage): Apply skip_empty after pagination in MemoryDatasetClient.get_data#1937

Merged
vdusek merged 1 commit into
masterfrom
fix/memory-dataset-get-data-skip-empty-order
Jun 4, 2026
Merged

fix(memory-storage): Apply skip_empty after pagination in MemoryDatasetClient.get_data#1937
vdusek merged 1 commit into
masterfrom
fix/memory-dataset-get-data-skip-empty-order

Conversation

@vdusek
Copy link
Copy Markdown
Collaborator

@vdusek vdusek commented Jun 3, 2026

MemoryDatasetClient.get_data applied the skip_empty filter before the offset/limit slice, while FileSystemDatasetClient.get_data and MemoryDatasetClient.iterate_items both 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 with iterate_items on the same memory client.

This change reorders the operations in MemoryDatasetClient.get_data to apply the desc reversal, then the offset/limit slice, and only then filter out empty items — matching the other implementations. The returned count/total/offset pagination math is now also internally consistent when skip_empty=True.

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.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Jun 3, 2026
@vdusek vdusek self-assigned this Jun 3, 2026
@vdusek vdusek marked this pull request as draft June 3, 2026 12:52
@github-actions github-actions Bot added this to the 142nd sprint - Tooling team milestone Jun 3, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.92%. Comparing base (dc1ed61) to head (43d033d).

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     
Flag Coverage Δ
unit 92.92% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek requested a review from Mantisus June 3, 2026 17:56
@vdusek vdusek changed the title fix: apply skip_empty after pagination in MemoryDatasetClient.get_data fix(memory-storage): Apply skip_empty after pagination in MemoryDatasetClient.get_data Jun 3, 2026
@vdusek vdusek marked this pull request as ready for review June 3, 2026 17:56
Copy link
Copy Markdown
Collaborator

@Mantisus Mantisus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdusek vdusek requested a review from janbuchar June 4, 2026 10:58
@vdusek vdusek merged commit 7e807aa into master Jun 4, 2026
33 checks passed
@vdusek vdusek deleted the fix/memory-dataset-get-data-skip-empty-order branch June 4, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants