fix(explore): Derive default chart type for explore Slack unfurls#112717
Merged
DominikB2014 merged 2 commits intomasterfrom Apr 10, 2026
Merged
Conversation
When no explicit chartType is in the URL, the unfurl always rendered a line chart. But Explore defaults count/count_unique/sum aggregates to bar charts and everything else to line, via determineDefaultChartType. Add _resolve_display_type helper that uses the URL's chartType when present and otherwise derives the default from the aggregate function, matching the frontend behavior. Fixes DAIN-1495 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Warden flagged that a malformed URL with a non-int chartType (e.g. a list or dict) would crash dict.get() with TypeError. Use isinstance check instead of a presence check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
edwardgou-sentry
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When no explicit
chartTypeis in the URL, the Slack unfurl alwaysrendered a line chart. But Explore defaults
count/count_unique/sumaggregates to bar charts and everything else to line.
Adds
_resolve_display_type(chart_type, y_axes)which uses the URL'schartTypewhen present and otherwise derives the default from theaggregate function name, matching the frontend's
determineDefaultChartType.Also stores
chart_typeas the raw int from the URL (instead ofpre-converting to a string) so the helper handles the full mapping.
Fixes DAIN-1495