Repository navigation
fix: default chart source to last statement execution with results - #1735
Merged
kgopal492 merged 2 commits intoSep 16, 2026
Merged
Conversation
When editing a chart cell whose query execution has multiple statements, the composer defaulted the selected statement to statementIdList[0]. If the first statement produced no result rows (a non-result statement or a 0-row result), the chart had no data to bind to and the chart config failed to load. Default to the last DONE statement execution with result_row_count > 0 instead, and guard against missing statement executions in the filter. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
raymondtieu
approved these changes
Sep 16, 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.
Summary
Problem (Why)
When editing a chart cell in a DataDoc whose query execution contains multiple statements, the chart composer (
useChartSource) defaulted the selected statement tostatementIdList[0]— the first statement. If that first statement produced no result rows (a non-result statement likeSET/CREATE, or aSELECTreturning 0 rows), the chart had no data to bind to and the chart config failed to load in the edit view.Solution (What + How)
Default the selected statement to the last statement execution that is
DONEwithresult_row_count > 0, rather than blindly picking the first statement. ThestatementExecutionsmemo (already computing exactly this filtered list) is moved above the default-selection effect and reused, and astatementExecution &&guard is added to the filter to avoid dereferencing missing entries.Test Plan
Manual verification in a local DataDoc: