Skip to content

fix(sqllab): add filterBySqlLab prop to decouple expose_in_sqllab filter from UI rendering mode#42440

Open
prathamesh04 wants to merge 2 commits into
apache:masterfrom
prathamesh04:fix/expose-in-sqllab-filter-sqllab-mode
Open

fix(sqllab): add filterBySqlLab prop to decouple expose_in_sqllab filter from UI rendering mode#42440
prathamesh04 wants to merge 2 commits into
apache:masterfrom
prathamesh04:fix/expose-in-sqllab-filter-sqllab-mode

Conversation

@prathamesh04

Copy link
Copy Markdown
Contributor

Summary

The expose_in_sqllab filter in DatabaseSelector was tied to sqlLabMode, which controls the UI rendering (compact button vs full dropdown). When the SQL Lab popover passed sqlLabMode={false} to render the dropdown, the expose_in_sqllab filter was also disabled, allowing databases with expose_in_sqllab=false to appear in SQL Lab.

Before / After

Before: The popover's DatabaseSelector in SQL Lab passed sqlLabMode={false} (to render the dropdown instead of a compact button). The loadDatabases function checked formMode || !sqlLabMode -- since sqlLabMode=false, this evaluated to true, skipping the expose_in_sqllab filter.

After: Added a new filterBySqlLab prop that controls the expose_in_sqllab filter independently from the UI rendering mode. The popover's DatabaseSelector now passes filterBySqlLab={true} to apply the filter while still rendering the dropdown.

Testing Instructions

  1. Create a database with expose_in_sqllab = false
  2. Create another database with expose_in_sqllab = true
  3. Open SQL Lab -- the database with expose_in_sqllab = false should NOT appear in the dropdown

Additional Information

Remove @has_access from the /language_pack/<lang>/ endpoint to allow
embedded dashboards to fetch translations without authentication.

Embedded dashboards use a bare fetch() without the guest-token header,
so the endpoint returned a 302 redirect to /login/ instead of the
translation catalog. This silently broke i18n for all embedded dashboards
using non-English locales.

The language pack contains only non-sensitive translation strings and
is safe to serve without authentication.

Closes apache#42433
…ter from UI rendering mode

The expose_in_sqllab filter in DatabaseSelector was tied to sqlLabMode,
which controls the UI rendering (compact button vs full dropdown).
When the SQL Lab popover passed sqlLabMode={false} to render the
dropdown, the expose_in_sqllab filter was also disabled, allowing
databases with expose_in_sqllab=false to appear in SQL Lab.

Added a new filterBySqlLab prop that controls the expose_in_sqllab
filter independently from the UI rendering mode. The popover's
DatabaseSelector now passes filterBySqlLab={true} to apply the filter
while still rendering the dropdown.

Fixes apache#40850
@dosubot dosubot Bot added change:frontend Requires changing the frontend data:connect Namespace | Anything related to db connections / integrations sqllab Namespace | Anything related to the SQL Lab labels Jul 26, 2026
@bito-code-review

bito-code-review Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #d7a11d

Actionable Suggestions - 0
Review Details
  • Files reviewed - 6 · Commit Range: dc80bb1..a9c8002
    • superset-frontend/src/SqlLab/components/SqlEditorLeftBar/index.tsx
    • superset-frontend/src/components/DatabaseSelector/DatabaseSelector.test.tsx
    • superset-frontend/src/components/DatabaseSelector/index.tsx
    • superset-frontend/src/components/DatabaseSelector/types.ts
    • superset/views/core.py
    • tests/unit_tests/views/test_base.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • 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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added the api Related to the REST API label Jul 26, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.60%. Comparing base (ba0900d) to head (a9c8002).

❗ There is a different number of reports uploaded between BASE (ba0900d) and HEAD (a9c8002). Click for more details.

HEAD has 124 uploads less than BASE
Flag BASE (ba0900d) HEAD (a9c8002)
python 86 3
presto 15 1
hive 15 1
unit 14 1
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #42440      +/-   ##
==========================================
- Coverage   65.23%   56.60%   -8.63%     
==========================================
  Files        2795     2795              
  Lines      157694   157694              
  Branches    36067    36068       +1     
==========================================
- Hits       102871    89268   -13603     
- Misses      52847    67601   +14754     
+ Partials     1976      825    -1151     
Flag Coverage Δ
hive 38.39% <ø> (-0.01%) ⬇️
javascript 71.27% <100.00%> (+<0.01%) ⬆️
mysql ?
postgres ?
presto 40.31% <ø> (-0.01%) ⬇️
python 41.55% <ø> (-17.47%) ⬇️
sqlite ?
unit 100.00% <ø> (ø)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the REST API change:frontend Requires changing the frontend data:connect Namespace | Anything related to db connections / integrations size/M sqllab Namespace | Anything related to the SQL Lab

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expose_in_sqllab flag ignored in SQL Lab database selector (6.1.0 regression)

1 participant