Skip to content

feat(calendar): migrate cal_heatmap chart to v1 chart data API - #41724

Merged
rusackas merged 1 commit into
remove-legacy-viz-pipelinefrom
legacy-viz-t2-calendar
Jul 3, 2026
Merged

feat(calendar): migrate cal_heatmap chart to v1 chart data API#41724
rusackas merged 1 commit into
remove-legacy-viz-pipelinefrom
legacy-viz-t2-calendar

Conversation

@rusackas

@rusackas rusackas commented Jul 3, 2026

Copy link
Copy Markdown
Member

SUMMARY

Tier 2 of #41714 (targets remove-legacy-viz-pipeline): migrate the Calendar Heatmap (cal_heatmap) off explore_json onto /api/v1/chart/data.

  • New buildQuery.ts mirroring the legacy CalHeatmapViz.query_obj: timeseries query with the time grain forced from subdomain_granularity (min→PT1M, …, year→P1Y).
  • The get_data reshape is ported to transformData: per-metric value maps keyed by unix seconds, and the cal-heatmap domain range computed from the query's from_dttm/to_dttm (which the v1 response carries) using calendar arithmetic that matches dateutil.relativedelta semantics, including month-end clamping. Missing time bounds throw the same "Please provide both time bounds" error the backend raised.
  • useLegacyApi: true removed.
  • No DB migration: viz_type unchanged; legacy granularity_sqla/time_range handled by extractExtras.

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.
  • Manual: open a saved Calendar Heatmap; network tab shows POST /api/v1/chart/data; calendar layout and cell values identical.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
  • Introduces new feature or API
  • Removes existing feature or API

🤖 Generated with Claude Code

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>
@dosubot dosubot Bot added the change:frontend Requires changing the frontend label Jul 3, 2026
@bito-code-review

bito-code-review Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at evan@preset.io.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.46154% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.09%. Comparing base (e318607) to head (43d729f).
⚠️ Report is 1 commits behind head on remove-legacy-viz-pipeline.

Files with missing lines Patch % Lines
...legacy-plugin-chart-calendar/src/transformProps.ts 0.00% 4 Missing ⚠️
...ins/legacy-plugin-chart-calendar/src/buildQuery.ts 83.33% 1 Missing ⚠️
.../plugins/legacy-plugin-chart-calendar/src/index.ts 0.00% 1 Missing ⚠️
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           
Flag Coverage Δ
javascript 69.44% <88.46%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@rusackas
rusackas merged commit 1a94c04 into remove-legacy-viz-pipeline Jul 3, 2026
61 checks passed
@rusackas
rusackas deleted the legacy-viz-t2-calendar branch July 3, 2026 05:56
rusackas added a commit that referenced this pull request Jul 7, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 7, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 8, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 10, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 13, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 14, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 15, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 15, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 16, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 17, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 20, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 20, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 20, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 21, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 21, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 23, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
rusackas added a commit that referenced this pull request Jul 27, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend plugins size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants