Skip to content

perf(explore): reuse chart query data in Results tab - #38165

Merged
rusackas merged 2 commits into
apache:masterfrom
kimsehwan96:fix/explore-results-pane-duplicate-query
Jul 5, 2026
Merged

rusackas merged 2 commits into
apache:masterfrom
kimsehwan96:fix/explore-results-pane-duplicate-query

Conversation

@kimsehwan96

@kimsehwan96 kimsehwan96 commented Feb 22, 2026 •

Copy link
Copy Markdown
Contributor

User description

The Results tab in DataTablesPane independently fires a separate API request with resultType='results', which produces identical SQL to the chart's resultType='full' request on the backend. This doubles database load on every chart execution when the Results tab is open.

  • Reset isRequest.results to false during chart loading to prevent race condition where both requests fire simultaneously
  • Pass chart.queriesResponse from Redux through to useResultsPane
  • Reuse chart data directly when available (v1 API), falling back to API call for legacy charts

Closes #38152

SUMMARY

The Results tab in the Explore view's DataTablesPane fires an independent API request (resultType='results') every time a chart query runs. On the backend, _get_results() is a pure pass-through to _get_full() — both produce identical SQL. This means every chart execution with the Results tab open sends two duplicate database queries simultaneously.

Root cause (two issues):

  1. Race condition in DataTablesPane: isRequest.results is not reset to false when chartStatus transitions to 'loading'. WhenqueryFormData changes during chart loading, useResultsPane's effect fires immediately — sending the Results request at the same time as the chart request.

  2. Redundant API call in useResultsPane: The hook always fetches data via a separate network request, even though identical data is already available in Redux (chart.queriesResponse) after the chart query completes.

Fix:

  • Reset isRequest.results to false when chartStatus === 'loading' to prevent the race condition
  • Pass chart.queriesResponse from Redux through ExploreChartPanel → DataTablesPane → useResultsPane
  • When queriesResponse contains v1 API data (has colnames field), reuse it directly — skipping the separate API call entirely
  • Legacy charts without typed queriesResponse fall back to the existing API call

Result: One database query instead of two per chart execution. Results tab data appears instantly from Redux without a network round-trip.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

스크린샷 2026-02-21 오후 12 44 59

AS-IS duplicated query was submitted to trino

스크린샷 2026-02-21 오후 9 23 49

TO-BE only one query was submitted to trino and the result will be used in chart and result panels.

TESTING INSTRUCTIONS

Build it locally and creating environment with docker-compose and tested it.

ADDITIONAL INFORMATION


CodeAnt-AI Description

Reuse chart query data in Results tab to avoid duplicate backend queries

What Changed

  • Results tab now reuses the chart's query response when available, so opening Results does not send a second identical database query
  • Prevents a race where Results and chart requests could fire simultaneously by resetting the Results request flag while the chart is loading
  • Legacy charts without the shared response still fetch results from the API as a fallback

Impact

✅ Lower database load during chart execution
✅ Fewer duplicate queries when viewing Results
✅ Faster Results display when chart data is already loaded

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@dosubot

dosubot Bot commented Feb 22, 2026

Copy link
Copy Markdown

Related Documentation

Checked 0 published document(s) in 2 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@bito-code-review

bito-code-review Bot commented Feb 22, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #eda19d

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset-frontend/src/explore/components/DataTablesPane/types.ts - 1
    • Interface contract violation · Line 55-55
      The queriesResponse prop is added to ResultsPaneProps but ResultsPaneOnDashboard doesn't destructure or use it, which could ignore the prop if passed. To maintain interface consistency, the component should accept and forward this optional prop.
  • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx - 1
    • Type mismatch in data assignment · Line 88-88
      Assigning result.data (DataRecord[]) to QueryResultInterface.data (expected Record[][]) creates a type mismatch. While runtime works due to the cast, this reduces type safety. Consider updating the interface type since downstream usage treats data as an array of records.
Review Details
  • Files reviewed - 4 · Commit Range: fdb69a1..fdb69a1
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/types.ts
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added the explore:performance Related to performance of Explore label Feb 22, 2026
@bito-code-review

bito-code-review Bot commented Feb 22, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #3cbfd9

Actionable Suggestions - 0
Review Details
  • Files reviewed - 5 · Commit Range: fdb69a1..9cb4a46
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/types.ts
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

Copilot AI 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.

Pull request overview

This PR reduces duplicate backend queries in Explore by reusing the chart’s existing queriesResponse for the Results tab (when available), avoiding a separate resultType='results' request.

Changes:

  • Pass chart.queriesResponse from ExploreChartPanel into DataTablesPane/useResultsPane.
  • Reuse v1-shaped queriesResponse data in useResultsPane, with a fallback to the existing API call for legacy responses.
  • Reset isRequest.results during chart loading to prevent the “chart + results” race from firing two requests at once.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
superset-frontend/src/explore/components/ExploreChartPanel/index.tsx Wires chart.queriesResponse through to the data panel.
superset-frontend/src/explore/components/DataTablesPane/types.ts Adds queriesResponse to relevant props typing.
superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx Implements reuse of Redux query data with API fallback.
superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx Passes queriesResponse through to the shared hook.
superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx Resets results request state during loading; forwards queriesResponse.

.finally(() => {
setIsLoading(false);
});
}, [queryFormData, isRequest]);

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

useEffect now depends on queriesResponse/queryForce/ownState/errorMessage (and uses setForceQuery), but the dependency array is still [queryFormData, isRequest]. This can prevent the new reuse-path from running when queriesResponse arrives/changes (e.g., after the chart request completes without queryFormData changing) and may also trigger react-hooks/exhaustive-deps lint failures. Update the dependencies or refactor (e.g., separate effect keyed by queriesResponse + isRequest) so results update reliably without an extra API call.

Suggested change
}, [queryFormData, isRequest]);
}, [
queryFormData,
isRequest,
queriesResponse,
queryForce,
ownState,
errorMessage,
]);

Copilot uses AI. Check for mistakes.
Comment on lines +79 to +83
// Reuse chart data from Redux when available. The chart visualization
// query and the results query produce identical SQL on the backend,
// so there is no need for a separate network request.
if (queriesResponse?.length && 'colnames' in queriesResponse[0]) {
const mapped = queriesResponse.map(q => {

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

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

The new branch that reuses queriesResponse (skipping getChartDataRequest) isn’t covered by existing tests. Consider adding a unit test that passes a v1-shaped queriesResponse and asserts no network request is made and the table renders from Redux data, plus a test that verifies an update when queriesResponse changes.

Copilot uses AI. Check for mistakes.
@sadpandajoe
sadpandajoe requested a review from justinpark March 6, 2026 19:15
@codeant-ai-for-open-source codeant-ai-for-open-source Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Mar 6, 2026
@rusackas
rusackas force-pushed the fix/explore-results-pane-duplicate-query branch from 3cf6dfb to 498cf65 Compare June 18, 2026 01:32

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rebased this onto current master and pushed for you, the conflict was just the cappedFormData / import-path churn from a recent refactor. The DataTablesPane jest tests pass locally, CI re-running 🤞

Nice writeup on the root cause. The backend reasoning checks out too, _get_results is just a passthrough to _get_full, so reusing chart.queriesResponse gives identical data/colnames/coltypes. So the dedup itself looks right.

One thing I want to be sure of before merging: with the Redux reuse path, does the row-limit dropdown in the Results tab still do anything for v1 charts? Looks like changing it updates cappedFormData, but the effect re-enters the reuse branch and renders the chart's data regardless of the new limit... so the control might be a silent no-op now. Worth confirming, and maybe a small test around the reuse vs fallback split since there's no coverage on it yet. Thoughts @kimsehwan96?

@codecov

codecov Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.60%. Comparing base (ab0e77c) to head (56ea8e1).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...plore/components/DataTablesPane/DataTablesPane.tsx 50.00% 1 Missing ⚠️
...nents/DataTablesPane/components/useResultsPane.tsx 96.77% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #38165   +/-   ##
=======================================
  Coverage   64.60%   64.60%           
=======================================
  Files        2684     2684           
  Lines      148378   148397   +19     
  Branches    34187    34194    +7     
=======================================
+ Hits        95855    95872   +17     
- Misses      50769    50771    +2     
  Partials     1754     1754           
Flag Coverage Δ
javascript 69.37% <94.11%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bito-code-review

bito-code-review Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #e42beb

Actionable Suggestions - 0
Review Details
  • Files reviewed - 5 · Commit Range: 862cad6..498cf65
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/types.ts
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas

Copy link
Copy Markdown
Member

@kimsehwan96 just checking in on this PR again :) Thanks for the help here.

The reuse branch renders chart.queriesResponse and never looks at cappedFormData, and queriesResponse won't change when only the Results-tab row-limit dropdown moves. On a v1 chart, lowering that limit seems like it wouldn't do anything. Can you confirm the dropdown still works on the reuse path, and add a test covering reuse vs fallback? Happy to help if help is needed.

@kimsehwan96
kimsehwan96 force-pushed the fix/explore-results-pane-duplicate-query branch from 498cf65 to 0b44ea2 Compare June 25, 2026 00:13
@pull-request-size pull-request-size Bot added size/L and removed size/M labels Jun 25, 2026
const props = createResultsPaneOnDashboardProps({
sliceId: 203,
// legacy shape: present but without the v1 `colnames` discriminator
queriesResponse: [{ data: [{ genre: 'ignored' }] }] as any,

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.

Suggestion: Replace the any cast with a concrete test-safe type (or a narrow reusable generic/union) that represents the legacy queriesResponse shape without disabling type checking. [custom_rule]

Severity Level: Minor ⚠️

Why it matters? 🤔

The file is a new/modified TypeScript test file, and it contains an explicit as any cast. This directly violates the rule against using any in changed TypeScript/TSX code, so the suggestion is verified.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/src/explore/components/DataTablesPane/test/useResultsPane.test.tsx
**Line:** 107:107
**Comment:**
	*Custom Rule: Replace the `any` cast with a concrete test-safe type (or a narrow reusable generic/union) that represents the legacy `queriesResponse` shape without disabling type checking.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@netlify

netlify Bot commented Jun 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 56ea8e1
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a46f0ba77bb3100076bf5e8
😎 Deploy Preview https://deploy-preview-38165--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@kimsehwan96

Copy link
Copy Markdown
Contributor Author

@rusackas Hi ! sorry for late response.

I added some tests and fix Results-tab-row-limit dropdown related issue.

2026-06-25.9.11.00.mov

If there is more changes needed than feel free to request changes to me or make change with your own!

Thank you for feedback.

@kimsehwan96
kimsehwan96 force-pushed the fix/explore-results-pane-duplicate-query branch from 0b44ea2 to 61ff26e Compare June 25, 2026 00:19
@kimsehwan96
kimsehwan96 requested review from Copilot and rusackas June 25, 2026 00:19
Comment on lines +133 to +139
async openResultsTab(): Promise<void> {
await this.expandDataPanel();
const resultsTab = this.page
.locator(ExplorePage.SELECTORS.SOUTH_PANE)
.locator(ExplorePage.SELECTORS.RESULTS_TAB);
await resultsTab.click();
}

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.

Suggestion: openResultsTab() always clicks the Results tab even when it is already active. In DataTablesPane, clicking the active tab collapses the panel, so this helper can close the data panel instead of opening it (especially right after expanding a collapsed panel where Results is already selected by default). Guard the click so it only runs when Results is not already active. [logic error]

Severity Level: Critical 🚨
- ❌ Results tab Playwright test collapses panel instead of opening.
- ⚠️ Flaky or failing end-to-end coverage for Results reuse.
Steps of Reproduction ✅
1. Run the Playwright spec
`superset-frontend/playwright/tests/experimental/explore/results-tab-reuse.spec.ts`, which
constructs an `ExplorePage` and navigates to Explore (`ExplorePage.goto()` at lines 13–18
of the snippet, using `ExplorePage` from
`superset-frontend/playwright/pages/ExplorePage.ts`).

2. Observe that `results-tab-reuse.spec.ts` calls `await explorePage.openResultsTab();`
(lines 26–28 of the snippet), which in turn invokes `ExplorePage.openResultsTab()` at
`superset-frontend/playwright/pages/ExplorePage.ts:133-139`.

3. When `openResultsTab()` runs, it first calls `expandDataPanel()`, which clicks the
caret button with `aria-label="Expand data panel"` if visible (`DataTablesPane` renders
this caret in `CollapseButton` with that aria-label at
`superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx:161-185`),
causing `handleCollapseChange(true)` to set `panelOpen` to `true`
(`DataTablesPane.tsx:140-145`).

4. Immediately after expansion, `openResultsTab()` unconditionally clicks the Results tab
(`[data-node-key="results"]`), which triggers `Tabs` `onTabClick` -> `handleTabClick` in
`DataTablesPane.tsx:148-158`; since `panelOpen` is `true` and `activeTabKey` is already
`ResultTypes.Results` (`useState` default at `DataTablesPane.tsx:92`), the branch `else if
(tabKey === activeTabKey)` executes, calling `handleCollapseChange(false)` and collapsing
the panel, so the AG Grid inside the Results pane is hidden and `AgGrid.waitForRows()`
(which waits for visible rows in
`superset-frontend/playwright/components/core/AgGrid.ts:50-55`) can time out or fail to
find a visible grid.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/playwright/pages/ExplorePage.ts
**Line:** 133:139
**Comment:**
	*Logic Error: `openResultsTab()` always clicks the Results tab even when it is already active. In `DataTablesPane`, clicking the active tab collapses the panel, so this helper can close the data panel instead of opening it (especially right after expanding a collapsed panel where Results is already selected by default). Guard the click so it only runs when Results is not already active.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copilot AI 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.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

@kimsehwan96
kimsehwan96 force-pushed the fix/explore-results-pane-duplicate-query branch from 61ff26e to 875b08b Compare June 25, 2026 00:29
@kimsehwan96
kimsehwan96 force-pushed the fix/explore-results-pane-duplicate-query branch from 875b08b to 15f8ea3 Compare June 25, 2026 00:39
@bito-code-review

bito-code-review Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #0f5847

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx - 1
    • Type incompatibility in data field · Line 118-118
      `ChartDataResponseResult.data` is `Record[]` (flat objects), but `QueryResultInterface.data` is `Record[][]` (array of arrays). The `as unknown as` cast on line 128 bypasses TypeScript's check and propagates the shape mismatch to `SingleQueryResultPane` and `useGridColumns`. Verify downstream consumers handle both shapes correctly, or align the types.
  • superset-frontend/playwright/pages/ExplorePage.ts - 1
    • Inconsistent selector naming · Line 36-36
      The `data-test` value `'some-purposeful-instance'` appears to be placeholder-style naming. SqlLabPage.ts uses `'south-pane'` for its analogous south pane selector. Consider using a consistent, descriptive name for maintainability.
      Code suggestion
      --- a/superset-frontend/playwright/pages/ExplorePage.ts
      +++ b/superset-frontend/playwright/pages/ExplorePage.ts
       @@ -33,7 +33,7 @@ export class ExplorePage {
            DATASOURCE_CONTROL: '[data-test="datasource-control"]',
            VIZ_SWITCHER: '[data-test="fast-viz-switcher"]',
            CHART_CONTAINER: '[data-test="chart-container"]',
      -    // The bottom data panel (DataTablesPane / SouthPane) with Results/Samples tabs
      -    SOUTH_PANE: '[data-test="some-purposeful-instance"]',
      +    SOUTH_PANE: '[data-test="south-pane"]',
            EXPAND_DATA_PANEL: '[aria-label="Expand data panel"]',
            RESULTS_TAB: '[data-node-key="results"]',
            ACTIVE_TABPANE: '.ant-tabs-tabpane-active',
Review Details
  • Files reviewed - 9 · Commit Range: 862cad6..15f8ea3
    • superset-frontend/playwright/pages/ExplorePage.ts
    • superset-frontend/playwright/tests/experimental/explore/results-tab-reuse.spec.ts
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/test/fixture.tsx
    • superset-frontend/src/explore/components/DataTablesPane/test/useResultsPane.test.tsx
    • superset-frontend/src/explore/components/DataTablesPane/types.ts
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@kimsehwan96
kimsehwan96 force-pushed the fix/explore-results-pane-duplicate-query branch from 15f8ea3 to 8caf872 Compare June 25, 2026 04:57
@kimsehwan96
kimsehwan96 force-pushed the fix/explore-results-pane-duplicate-query branch from 8caf872 to e56eeed Compare June 25, 2026 05:32
@bito-code-review

bito-code-review Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #9a2949

Actionable Suggestions - 0
Additional Suggestions
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

Review Details
  • Files reviewed - 9 · Commit Range: 862cad6..e56eeed
    • superset-frontend/playwright/pages/ExplorePage.ts
    • superset-frontend/playwright/tests/experimental/explore/results-tab-reuse.spec.ts
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/test/fixture.tsx
    • superset-frontend/src/explore/components/DataTablesPane/test/useResultsPane.test.tsx
    • superset-frontend/src/explore/components/DataTablesPane/types.ts
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

devops-sewhan-kim and others added 2 commits July 2, 2026 15:53
The Results tab in DataTablesPane independently fires a separate
API request with resultType='results', which produces identical SQL
to the chart's resultType='full' request on the backend. This doubles
database load on every chart execution when the Results tab is open.

- Reset isRequest.results to false during chart loading to prevent
  race condition where both requests fire simultaneously
- Pass chart.queriesResponse from Redux through to useResultsPane
- Reuse chart data directly when available (v1 API), falling back
  to API call for legacy charts

Closes apache#38152
Address review feedback: destructure and forward the queriesResponse
prop to useResultsPane for interface contract consistency.
@rusackas
rusackas force-pushed the fix/explore-results-pane-duplicate-query branch from e56eeed to 56ea8e1 Compare July 2, 2026 23:13

@bito-code-review bito-code-review 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.

Code Review Agent Run #f57987

Actionable Suggestions - 2
  • superset-frontend/playwright/tests/experimental/explore/results-tab-reuse.spec.ts - 1
    • Extract duplicated chart creation code · Line 74-74
  • superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx - 1
    • Prop optimization unused by caller · Line 59-59
Additional Suggestions - 2
  • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx - 1
    • Missing test for loading behavior · Line 132-134
      The new `useEffect` block at lines 132-134 that resets `isRequest.results` when `panelOpen && chartStatus === 'loading'` has no test coverage in `DataTablesPane.test.tsx`. Existing tests use `chartStatus: 'rendered'`, so this loading-state branch is never exercised. Without a test, regression in the loading-to-results transition could go undetected.
  • superset-frontend/src/explore/components/DataTablesPane/test/useResultsPane.test.tsx - 1
    • Missing pre-API-state assertion · Line 107-107
      This test for the partial-v1-shape fallback path asserts the API populates 'Indie' but never verifies that the initial state (before the API resolves) is empty. Without checking the pre-API state, a regression where the component renders stale or uninitialized data would go undetected.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/playwright/pages/ExplorePage.ts - 1
  • superset-frontend/src/explore/components/DataTablesPane/test/fixture.tsx - 1
Review Details
  • Files reviewed - 9 · Commit Range: b838903..56ea8e1
    • superset-frontend/playwright/pages/ExplorePage.ts
    • superset-frontend/playwright/tests/experimental/explore/results-tab-reuse.spec.ts
    • superset-frontend/src/explore/components/DataTablesPane/DataTablesPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/ResultsPaneOnDashboard.tsx
    • superset-frontend/src/explore/components/DataTablesPane/components/useResultsPane.tsx
    • superset-frontend/src/explore/components/DataTablesPane/test/fixture.tsx
    • superset-frontend/src/explore/components/DataTablesPane/test/useResultsPane.test.tsx
    • superset-frontend/src/explore/components/DataTablesPane/types.ts
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

};
const chartResp = await apiPostChart(page, {
slice_name: `results_tab_reuse_${Date.now()}`,
viz_type: 'table',

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.

Extract duplicated chart creation code

The chart creation logic (14 lines) is duplicated across results-tab-reuse.spec.ts (line 74-87) and handlebars-format-date.spec.ts (line 74-87). Consider extracting into a helper function to improve maintainability. A similar 11-line duplication also exists in the same files (lines 54-64).

Code Review Run #f57987


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

dataSize = 50,
canDownload,
columnDisplayNames,
queriesResponse,

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.

Prop optimization unused by caller

The queriesResponse prop added at lines 59 and 72 enables useResultsPane to skip a redundant API call when chart results are already available (useResultsPane.tsx:109-129). However, the sole caller at dashboard/components/SliceHeaderControls/index.tsx:516-524 does not pass this prop, so the optimization never executes in practice.

Code Review Run #f57987


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @kimsehwan96, LGTM! The row-limit slicing on the reuse path settles my earlier concern, and the reuse-vs-fallback tests are just what I was hoping for.

@rusackas
rusackas merged commit 8229c01 into apache:master Jul 5, 2026
65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

explore:performance Related to performance of Explore size/L size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Charts tabs update chart execute same query simultaneously when results tab opened

4 participants