Skip to content

fix: Missing ownState and isCached props in Chart.jsx#34259

Merged
kgabryje merged 1 commit into
apache:masterfrom
kgabryje:fix/chart-own-state
Jul 22, 2025
Merged

fix: Missing ownState and isCached props in Chart.jsx#34259
kgabryje merged 1 commit into
apache:masterfrom
kgabryje:fix/chart-own-state

Conversation

@kgabryje
Copy link
Copy Markdown
Member

@kgabryje kgabryje commented Jul 21, 2025

SUMMARY

After changes from PR #31241, props.ownState and props.isCached were undefined. This PR fixes the issue by using ownState and isCached values calculated within the component.

Thanks @rad-pat for spotting the problem!

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

@kgabryje kgabryje requested a review from rusackas July 21, 2025 19:29
Copy link
Copy Markdown

@korbit-ai korbit-ai Bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Performance Unnecessary Memoization of Simple Calculation ▹ view 🧠 Not in scope
Files scanned
File Path Reviewed
superset-frontend/src/dashboard/components/gridComponents/Chart.jsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines +169 to +173
const isCached = useMemo(
// eslint-disable-next-line camelcase
() => queriesResponse?.map(({ is_cached }) => is_cached) || [],
[queriesResponse],
);

This comment was marked as resolved.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not unnecessary, .map creates a new array every time, so every usage of isCached in dependency arrays would break memoizations

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You're right - the memoization is needed here to maintain referential equality of the mapped array. I retract my suggestion.

@github-actions
Copy link
Copy Markdown
Contributor

@kgabryje Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

@github-actions
Copy link
Copy Markdown
Contributor

@kgabryje Ephemeral environment spinning up at http://35.92.236.9:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.

@kgabryje kgabryje merged commit f4f516c into apache:master Jul 22, 2025
82 of 83 checks passed
LisaHusband pushed a commit to LisaHusband/superset that referenced this pull request Aug 17, 2025
dankor pushed a commit to dankor/superset that referenced this pull request Aug 18, 2025
@github-actions github-actions Bot added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 6.0.0 First shipped in 6.0.0 labels Dec 18, 2025
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 6.0.0 First shipped in 6.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants