Skip to content

feat(interpolation): Persist dashboard and saved query transformations - #127081

Closed
nsdeschenes wants to merge 5 commits into
masterfrom
nd/feat/save-query-transformations
Closed

nsdeschenes wants to merge 5 commits into
masterfrom
nd/feat/save-query-transformations

Conversation

@nsdeschenes

@nsdeschenes nsdeschenes commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

The goal of this PR is to enables users to create and save dashboards and queries utilizing transformation functions.

🤖 generated description below:

Why

Dashboard and saved Explore query APIs need to retain per-axis transformations using the positional contract in #127057. Save the ordered function strings as opaque metadata so query execution can interpret them separately.

What changed

  • Store sparse transformation maps on dashboard queries and within each Explore visualization. Indexes refer to aggregate positions or local yAxes positions.
  • Validate canonical indexes, axis bounds, and lists of strict strings. Preserve order, duplicates, and whitespace.
  • Add a nullable dashboard query JSON column. Existing rows return an empty map without a backfill.
  • Preserve transformations through transaction-to-spans translation and snapshot restoration. Reindex surviving axes and retain distinct maps for duplicate occurrences.

Scope

Backend persistence and API round trips. Frontend propagation and transformation execution remain follow-ups.

Blast Radius

Nonempty writes require explore-interpolation-and-smoothing. Dashboard updates retain omitted maps, and {} clears them. With the flag disabled, nonempty saves and transformed revision restores are rejected. Stored maps remain readable.

Verification

  • All 212 tests in the affected dashboard, saved-query, and revision API suites passed. The final targeted recheck passed 19 tests.
  • Nine translation and restoration regressions failed before the fix and passed afterward. All 23 tests in that suite and four existing serializer-caller tests passed.
  • Organization backup export and import retained transformation metadata.
  • Repository lint, formatting, and mypy passed. The generated migration applied locally, and the OpenAPI field schema maps indexes to string arrays.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 9, 2026
@nsdeschenes nsdeschenes changed the title feat(explore): persist dashboard and saved query transformations feat(interpolation): Persist dashboard and saved query transformations Oct 9, 2026
@nsdeschenes

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1209_dashboard_widget_query_transformations.py

for 1209_dashboard_widget_query_transformations in sentry

--
-- Add field transformations to dashboardwidgetquery
--
ALTER TABLE "sentry_dashboardwidgetquery" ADD COLUMN "transformations" jsonb NULL;

@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1210_dashboard_widget_query_transformations.py

for 1210_dashboard_widget_query_transformations in sentry

--
-- Add field transformations to dashboardwidgetquery
--
ALTER TABLE "sentry_dashboardwidgetquery" ADD COLUMN "transformations" jsonb NULL;

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9652247. Configure here.

@nsdeschenes

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant