feat(calendar): migrate cal_heatmap chart to v1 chart data API - #41724
Conversation
Adds a buildQuery mirroring the legacy CalHeatmapViz.query_obj (a timeseries query whose time grain is forced from the subdomain granularity) and ports the get_data reshape into a transformData helper: per-metric value maps keyed by unix seconds, plus the domain range computed from the query's from_dttm/to_dttm with dateutil.relativedelta-compatible calendar arithmetic. Legacy pre-shaped payloads pass through untouched. No DB migration needed: viz_type is unchanged and legacy granularity_sqla/time_range form data flows through extractExtras. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bito Automatic Review Skipped - Branch Excluded |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## remove-legacy-viz-pipeline #41724 +/- ##
===========================================================
Coverage 64.08% 64.09%
===========================================================
Files 2687 2689 +2
Lines 148467 148519 +52
Branches 34262 34274 +12
===========================================================
+ Hits 95147 95194 +47
- Misses 51558 51563 +5
Partials 1762 1762
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:
|
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
SUMMARY
Tier 2 of #41714 (targets
remove-legacy-viz-pipeline): migrate the Calendar Heatmap (cal_heatmap) offexplore_jsononto/api/v1/chart/data.buildQuery.tsmirroring the legacyCalHeatmapViz.query_obj: timeseries query with the time grain forced fromsubdomain_granularity(min→PT1M, …, year→P1Y).get_datareshape is ported totransformData: per-metric value maps keyed by unix seconds, and the cal-heatmap domainrangecomputed from the query'sfrom_dttm/to_dttm(which the v1 response carries) using calendar arithmetic that matchesdateutil.relativedeltasemantics, including month-end clamping. Missing time bounds throw the same "Please provide both time bounds" error the backend raised.useLegacyApi: trueremoved.viz_typeunchanged; legacygranularity_sqla/time_rangehandled byextractExtras.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No visual change — same renderer, same data shape, different endpoint.
TESTING INSTRUCTIONS
npm run test -- plugins/legacy-plugin-chart-calendar— 10 new Jest tests (grain mapping incl. default, unix-second keying, year/month/week/day/hour range arithmetic, relativedelta month-end clamping, missing-bounds error); 17 total pass.POST /api/v1/chart/data; calendar layout and cell values identical.ADDITIONAL INFORMATION
🤖 Generated with Claude Code