Repository navigation
fix(semantic-layer): support resampling date results without changing raw exports - #46378
Merged
mikebridge merged 6 commits intoNov 21, 2026
Merged
Conversation
Keep DATE objects for raw and non-resampled results so XLSX date-only formatting is unchanged. Convert typed dates for resample-bearing queries to provide the DatetimeIndex required after pivoting. Cover SQL parity, export bytes, null and empty results, filter bounds, and existing time-comparison refusal.
Cast only base-axis and granularity DATE columns so resampling does not change DATE series labels or exports. Cover date and timestamp axes against ordinary dataset output, consolidate serializer fixtures, and document the separate forecast limitation.
Give raw-export and other-operation queries a temporal axis so the tests catch accidental removal of the resample-only conversion gate.
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46378 +/- ##
==========================================
- Coverage 85.71% 85.67% -0.05%
==========================================
Files 3114 3109 -5
Lines 215336 214912 -424
Branches 51038 50823 -215
==========================================
- Hits 184580 184124 -456
- Misses 27340 27373 +33
+ Partials 3416 3415 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mikebridge
requested review from
aminghadersohi,
fitzee,
gabotorresruiz and
rebenitez1802
November 20, 2026 03:07
aminghadersohi
left a comment
Contributor
There was a problem hiding this comment.
The new mapper test reintroduces full-tree mypy errors that master already fixed, and the empty-result test cannot fail.
Narrow semantic filters before checking temporal bounds so full-tree mypy can verify the assertions. Snapshot empty results and assert post-processing is skipped so removing the empty guard fails the regression test. Addresses review threads 4639084179 and 4639084190 on apache#46378.
aminghadersohi
approved these changes
Nov 20, 2026
aminghadersohi
left a comment
Contributor
There was a problem hiding this comment.
The resample-only DATE-axis cast and both strengthened tests look correct.
9 tasks
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.
SUMMARY
TL;DR: Semantic DATE axes can be resampled (for example to fill daily gaps) while DATE series labels, raw results and exports without resampling retain their existing date-only format.
Background: Providers return typed Arrow data. Pandas receives DATE values as Python date objects by default, but resampling requires a datetime index after pivoting.
Problem: A semantic time-series chart using a DATE dimension fails with
Resample operation requires DatetimeIndex. Converting dates unconditionally would fix that error but change raw XLSX dates into date-and-time cells.Changes: Cast only Arrow DATE columns selected as a base axis or granularity to timestamps, and only for queries containing a resample operation. Leave DATE-valued series and non-resample conversion unchanged. Add regression, export compatibility and temporal-boundary tests, plus documentation. No provider, database migration or shared resampling change.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: observations on Jan 5 and Jan 7 cannot be resampled.
After: daily zero-fill returns Jan 5/6/7 values 1/0/3. Raw XLSX cells remain
YYYY-MM-DD; newly successful resampled exports match ordinary dataset charts (CSV calendar dates, XLSXYYYY-MM-DD HH:MM:SS).TESTING INSTRUCTIONS
Run the semantic mapper, model, date-result and time-comparison-refusal unit tests together with
tests/unit_tests/pandas_postprocessing/test_resample.py.In a time-series chart using a semantic DATE dimension, request daily resampling with zero fill and verify missing days appear. Export the chart as CSV and XLSX. Repeat without resampling and confirm date-only raw export formatting is unchanged.
Local verification: 744 focused tests pass; changed-file hooks pass. Six DATE-series regression cases fail before narrowing the conversion and pass afterwards. Removing the resample-only gate also produces seven failures in the non-resample export and operation guards; restoring it makes them pass. Verification used offline unit tests, not a live provider or browser session.
ADDITIONAL INFORMATION
NULL time-axis buckets remain unsupported by resampling, matching ordinary datasets; filter them out first. Semantic time comparison remains explicitly refused. Forecasting on a DATE axis remains an existing limitation and is not fixed here.