You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "prathamesh04 (via GitHub)" <gi...@apache.org> on 2026/07/18 10:13:30 UTC

[PR] fix(sqllab): merge databases state instead of replacing in SET_DATABASES reducer [superset]

prathamesh04 opened a new pull request, #42197:
URL: https://github.com/apache/superset/pull/42197

   ### SUMMARY
   
   Fixes #41245
   
   The `SET_DATABASES` reducer was **replacing** the entire `databases` state object with only the newly fetched results. When SQL Lab initializes, it fetches databases via the API (default `page_size=20` from FAB), and the reducer would overwrite the full databases map with just those 20 results. This caused the "database not found" warning for any saved tab referencing a database outside the first page of results.
   
   The fix changes the reducer to **merge** new databases into the existing state, preserving any previously loaded database entries. This is a one-line change:
   
   ```diff
   - return { ...state, databases };
   + return { ...state, databases: { ...state.databases, ...databases } };
   ```
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (state management fix, no visual change)
   
   ### TESTING INSTRUCTIONS
   
   1. Create a Superset instance with >20 databases
   2. Save a SQL Lab tab with a database whose ID is not in the first 20 results
   3. Reload SQL Lab — the "database not found" warning should no longer appear
   4. Run the new unit tests: `npx jest src/SqlLab/reducers/sqlLab.test.ts`
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: #41245
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(sqllab): merge databases state instead of replacing in SET_DATABASES reducer [superset]

Posted by "prathamesh04 (via GitHub)" <gi...@apache.org>.
prathamesh04 closed pull request #42197: fix(sqllab): merge databases state instead of replacing in SET_DATABASES reducer
URL: https://github.com/apache/superset/pull/42197


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(sqllab): merge databases state instead of replacing in SET_DATABASES reducer [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42197:
URL: https://github.com/apache/superset/pull/42197#issuecomment-5010878053

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(sqllab): merge databases state instead of replacing in SET_DATABASES reducer [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #42197:
URL: https://github.com/apache/superset/pull/42197#issuecomment-5010908615

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/42197?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 65.08%. Comparing base ([`8299e7f`](https://app.codecov.io/gh/apache/superset/commit/8299e7f87c09a83c618016d4b86d76316e127668?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`b7fbb22`](https://app.codecov.io/gh/apache/superset/commit/b7fbb22df935c3c97b12ddfd1589a253a39f6e70?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 5 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #42197   +/-   ##
   =======================================
     Coverage   65.08%   65.08%           
   =======================================
     Files        2758     2758           
     Lines      155229   155229           
     Branches    35572    35572           
   =======================================
   + Hits       101026   101028    +2     
   + Misses      52288    52286    -2     
     Partials     1915     1915           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/42197/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/42197/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.77% <100.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/42197?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(sqllab): merge databases state instead of replacing in SET_DATABASES reducer [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #42197:
URL: https://github.com/apache/superset/pull/42197#issuecomment-5010882157

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | b7fbb22df935c3c97b12ddfd1589a253a39f6e70 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a5b51caaf8c5b00089b65b2 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-42197--superset-docs-preview.netlify.app](https://deploy-preview-42197--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQyMTk3LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.C0wfeccnXe2KAQR0RPWbunPyakkKDchFCiN70Yybrnc)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DctBDgIhDAXQu3RtI5owGb2Bx_iFoiYMIHQSjfHusnub96XW69aMrkQHko4SHtPp-T6OV84QjjAIhnKpxqnuJfKm_a48DKYzRW25fm5xtgVe_CkAaQ1enHPrRRYvZ_r9AQ) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-42197--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org