Skip to content

Conversation

@pulpdrew
Copy link
Contributor

@pulpdrew pulpdrew commented Dec 29, 2025

Closes HDX-3089
Closes HDX-3083

Summary

This PR ensures that the Generated SQL and Materialized View Explanations are generated for the same config that is queried.

Previously, this was not the case because child components (eg. DBTableChart, DBTimeChart, DBNumberChart) would transform the config passed down by DBEditTimeChart or Dashboard.Tile. Now, the same transformations are applied at the parent component.

Demo

Table Tile MV Indicator now correctly ignores granularity

Note that the time chart tiles cannot use MVs because the granularity is too small, but the table tile can use the MV:

Screenshot 2025-12-29 at 9 00 16 AM
Number and Table Chart generated SQL is correct

Number Chart has no granularity, group, or order by:

Screenshot 2025-12-29 at 9 14 08 AM

Table Chart has implicit group by, limit, and order by applied:

Screenshot 2025-12-29 at 9 14 00 AM

@changeset-bot
Copy link

changeset-bot bot commented Dec 29, 2025

🦋 Changeset detected

Latest commit: 18d3916

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Dec 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview, Comment Jan 6, 2026 4:02pm

@claude
Copy link

claude bot commented Dec 29, 2025

Code Review

No critical issues found.

The refactoring successfully centralizes config transformations to ensure displayed SQL/MV indicators match queried configs. The changes are well-tested and follow existing patterns.

Minor observations:

  • Good use of useMemo to optimize the transformation functions
  • Tests properly validate the three transformation functions
  • Type safety maintained with proper TypeScript types (ChartConfigWithOptTimestamp)
  • Consistent pattern applied across all chart types (time, number, table)

The PR is ready to merge.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 29, 2025

E2E Test Results

All tests passed • 55 passed • 4 skipped • 724s

Status Count
✅ Passed 55
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 4

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew pulpdrew force-pushed the drew/fix-edit-chart-form-displayed-sql-explanations branch from c9c4b97 to bd559f1 Compare December 29, 2025 13:37
@pulpdrew pulpdrew force-pushed the drew/fix-edit-chart-form-displayed-sql-explanations branch from bd559f1 to 6979693 Compare December 29, 2025 13:53
@pulpdrew pulpdrew marked this pull request as ready for review December 29, 2025 14:25
@pulpdrew pulpdrew requested review from a team and knudtty and removed request for a team December 29, 2025 14:25
@pulpdrew pulpdrew force-pushed the drew/fix-edit-chart-form-displayed-sql-explanations branch from 6979693 to f74deaf Compare December 29, 2025 17:59
Comment on lines -1230 to +1273
config={{
...queriedConfig,
granularity: alert
? intervalToGranularity(alert.interval)
: queriedConfig.granularity,
dateRange: alert
? extendDateRangeToInterval(
queriedConfig.dateRange,
alert.interval,
)
: queriedConfig.dateRange,
}}
config={dbTimeChartConfig}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this wonderful performance improvement 🫡

@kodiakhq kodiakhq bot merged commit 8213d69 into main Jan 6, 2026
11 of 12 checks passed
@kodiakhq kodiakhq bot deleted the drew/fix-edit-chart-form-displayed-sql-explanations branch January 6, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants