feat(partition): migrate partition chart to v1 chart data API - #41729
Conversation
Adds a buildQuery mirroring the legacy PartitionViz.query_obj (grouped query, timeseries only for time-based options, sort-metric handling) and ports the whole get_data dispatch into a transformData helper: summed/averaged hierarchies (levels_for + nest_values, including the plain time-series variant that treats the timestamp as the first level), first-vs-last period comparisons with pandas fill_value=0 semantics (levels_for_diff), and the period-analysis pivot with rolling window, cumulative sum and contribution normalization (levels_for_time + nest_procs). 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 #41729 +/- ##
==============================================================
+ Coverage 63.91% 63.94% +0.03%
==============================================================
Files 2697 2699 +2
Lines 148702 148904 +202
Branches 34331 34400 +69
==============================================================
+ Hits 95040 95216 +176
- Misses 51912 51938 +26
Partials 1750 1750
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:
|
The line-engine query_obj partition inherited always ordered by the sort metric or the first selected metric, ascending unless order_desc; buildQuery now mirrors that instead of only ordering when descending. transformData returns an empty hierarchy for empty results like the legacy endpoint and avoids quadratic row accumulation in period analysis. Co-Authored-By: Claude Fable 5 <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>
Co-authored-by: Claude Code <noreply@anthropic.com>
SUMMARY
Tier 4 of #41714 (targets
remove-legacy-viz-pipeline): migrate the Partition Chart (partition) offexplore_jsononto/api/v1/chart/data. This was the largestviz.pytransform left.buildQuery.tsmirroringPartitionViz.query_obj: grouped query,is_timeseriesonly for time-based options, legacy sort-metric append/orderby.transformDataports the fullget_datadispatch:not_time/agg_sum/agg_mean→levels_for+nest_values(summed/averaged hierarchy, dim-path names at deeper levels, sorted group indexes);time_series→ same nesting with the timestamp prepended as the first level;point_diff/point_factor/point_percent→levels_for_diff(last vs first time grain, pandasfill_value=0semantics for grouped rows, plain arithmetic at the top level);adv_anal→levels_for_time+nest_procs(per-timestamp pivot summed with missing combos filled as 0, rolling mean/sum/std/cumsum withmin_periodstrimming, contribution row-normalization per level).useLegacyApi: trueremoved (and the "Legacy" tag dropped).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-partition— 13 Jest tests covering every time-series option (hierarchy shape and values, mean vs sum, point comparisons incl. missing-side fill, timestamp-first nesting, period analysis with cumsum and contribution, groupby validation, query shapes).POST /api/v1/chart/data; rendering identical.ADDITIONAL INFORMATION
🤖 Generated with Claude Code