Repository navigation
fix(drill-by): keep the clicked time bucket when drilling from a grained temporal axis - #45612
aminghadersohi wants to merge 28 commits into
Conversation
…ned temporal axis
Drill by from a grained temporal bucket sends the bucket as a TEMPORAL_RANGE
filter, but the backend replaces the value of every TEMPORAL_RANGE filter with
the query's time_range. The bucket was widened to the chart's time range
("No filter" returned every row) or to the dashboard's Time range.
The Drill by modal now carries the innermost TEMPORAL_RANGE drill filter as the
drilled query's time_range, and replaces a dashboard time_range override in
extra_form_data with it. The filter stays a TEMPORAL_RANGE, so the dataset
timezone and Hours offset are still applied to its bounds.
Carry the clicked bucket through reserved legacy dashboard time filters as well as native filter overrides. Preserve categorical filters and the source form data, and exercise the outgoing query rather than only its form data.\n\nWait for the modal transition before asserting breadcrumb visibility.
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #45612 +/- ##
==========================================
+ Coverage 85.03% 85.04% +0.01%
==========================================
Files 3080 3080
Lines 209437 209549 +112
Branches 49385 49455 +70
==========================================
+ Hits 178095 178218 +123
+ Misses 27960 27948 -12
- Partials 3382 3383 +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:
|
…ange A grained Drill by replaced the chart's or dashboard's time range with the clicked bucket. When that range covered only part of the bucket (a Year bar under a Jun-Dec range, a Quarter bar under a mid-quarter range, a Year bar after a monthly cross-filter), the drill returned rows the chart never displayed, e.g. 1,000 rows for a bar that showed 754. Resolve the chart's effective time range (dashboard override, legacy dashboard time filter, chart time range, or the chart's own TEMPORAL_RANGE filter on the drilled column) through /api/v1/time_range/ and query only the overlap of that range and the bucket. The chart data request waits for the range, so it is sent once. If the range cannot be resolved, the bucket is used as before.
|
Acceptance at 4f27f24 (local docker-compose-light, examples dataset Works. Timeseries Drill by from a grained bucket returns the clicked bucket's rows. Chart time range "No filter": Day 34, Week 98, Month (Oct 2003) 158, Quarter (2003 Q4) 524, Year (2003) 1,000, each equal to a SQL count (merge-base: 2,823). Under a dashboard Time range Remaining (not fixed, outside this diff): under a dashboard Time grain filter set to Year, a Month chart's 2003 bar (1,000) drills to 39 rows (Jan 2003 only) and a Day chart's to 0, because Fixed in 4f27f24. When the chart's own range, a dashboard Time range or a time cross-filter covers only part of the bucket, d0ea5a4 queried the whole bucket: a Year bar showing 754 under a Jun–Dec 2003 range drilled to 1,000 rows (the merge-base gave 754), and a 2003 Q4 bar of 173 under Siblings checked:
|
|
Acceptance of the dashboard Time grain change at ac63962: ship. I ran 40 Drill by actions in a local docker-compose-light env on the examples dataset
With This PR does not change Sunburst; that goes in #45571. |
rebenitez1802
left a comment
There was a problem hiding this comment.
Request changes: Drill by now keeps the clicked time bucket, and that part works. But on charts without a saved time_range it also overwrites the chart's own filter on a different date column. Details and an applyable fix are inline.
|
@rebenitez1802 I reproduced the review body's independent-date-column regression. Fixed in 6c75c08: a drill without a query-wide range leaves it unset; with independent temporal filters, saved/native/legacy range overrides are represented by the resolved clicked filter rather than overwriting other columns. Other date filters and outer drill buckets retain their values. Regression test: The same commit also carries clicked grained buckets from markerless line/area charts and both Mixed Timeseries queries, and formats forced-categorical temporal bucket labels. Regression tests: Siblings checked:
Validation: Jest: 829 passed, 1 skipped (45 suites); America/New_York: 98 passed (4 suites); Docker backend temporal-query tests: 97 passed. Changed-file pre-commit (including type checking) passed. The four stale-response cases from #45612 (comment) still pass. Fresh live UI/SQL acceptance was not run: the local health endpoint was unavailable. Remaining: cross-filter-chip ISO display and differences in breadcrumb column names are unchanged; only the epoch bucket-label correction is included in this update. Right-click discoverability and Table/AG Grid Month-cell behavior are intentionally untouched. |
…d-temporal-range # Conflicts: # superset/translations/ar/LC_MESSAGES/messages.po # superset/translations/ca/LC_MESSAGES/messages.po # superset/translations/cs/LC_MESSAGES/messages.po # superset/translations/de/LC_MESSAGES/messages.po # superset/translations/en/LC_MESSAGES/messages.po # superset/translations/es/LC_MESSAGES/messages.po # superset/translations/fa/LC_MESSAGES/messages.po # superset/translations/fi/LC_MESSAGES/messages.po # superset/translations/fr/LC_MESSAGES/messages.po # superset/translations/it/LC_MESSAGES/messages.po # superset/translations/ja/LC_MESSAGES/messages.po # superset/translations/ko/LC_MESSAGES/messages.po # superset/translations/lv/LC_MESSAGES/messages.po # superset/translations/messages.pot # superset/translations/mi/LC_MESSAGES/messages.po # superset/translations/nl/LC_MESSAGES/messages.po # superset/translations/pl/LC_MESSAGES/messages.po # superset/translations/pt/LC_MESSAGES/messages.po # superset/translations/pt_BR/LC_MESSAGES/messages.po # superset/translations/ro/LC_MESSAGES/messages.po # superset/translations/ru/LC_MESSAGES/messages.po # superset/translations/sk/LC_MESSAGES/messages.po # superset/translations/sl/LC_MESSAGES/messages.po # superset/translations/sr/LC_MESSAGES/messages.po # superset/translations/sr_Latn/LC_MESSAGES/messages.po # superset/translations/ta/LC_MESSAGES/messages.po # superset/translations/th/LC_MESSAGES/messages.po # superset/translations/tr/LC_MESSAGES/messages.po # superset/translations/uk/LC_MESSAGES/messages.po # superset/translations/zh/LC_MESSAGES/messages.po # superset/translations/zh_TW/LC_MESSAGES/messages.po
…d-temporal-range # Conflicts: # superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/EchartsTimeseries.test.tsx
SUMMARY
Grained Drill by carries the clicked temporal bucket as a grained equality, like Drill to detail, while preserving the chart's existing time filters and effective dashboard grain. This supports independent date-column filters, nested buckets, custom SQL axes, markerless line/area clicks and either Mixed Timeseries query. Downloads and Edit chart use the same predicates.
In Explore, changing the bucket's column or operator removes its inherited grain. Picking a date range therefore compares raw dates; comparator-only and clause-only edits preserve bucket semantics. The Custom SQL tab is unavailable while a filter carries a grain because converting that predicate to portable raw SQL would lose its meaning. Late responses cannot replace results from a subsequent drill.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
The existing screenshots below are historical captures, not fresh acceptance evidence for this revision. The local health endpoint was unavailable; I did not re-capture them or run fresh live UI/SQL acceptance.
Screenshots
Captured at
ac639621. Local docker-compose-light env at the PR head, examples dataset cleaned_sales_data. Before = the previous PR head for the Time grain rows, the merge-base for the last row.TESTING INSTRUCTIONS
Validation for this revision:
The date-picker and other operator-edit regressions fail on the reviewed head (five failures) and pass after the change. The additional Custom SQL guard regression fails before its guard and passes after it. Invalid bucket metadata and scalar fallback cases cover the mapper branches missing from the previous CI coverage gate.
Manual checks when a development environment is available:
order_datebucket, choose Edit chart, and pick2004-01-15 : 2004-02-15. The resulting predicate must haveop: TEMPORAL_RANGEwith nograin, selecting raw dates rather than month-truncated dates.Remaining: fresh live UI/SQL acceptance was not run because the local health endpoint is unavailable. Historical screenshots below are not acceptance evidence for this revision. Fresh GitHub CI is running; its final result is unknown.
ADDITIONAL INFORMATION