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

   ### SUMMARY
   Fixes a regression where accessing a dashboard that uses a database with 
connection errors (missing credentials, unreachable DB, etc.) shows a fatal 
full-page error instead of loading the dashboard and showing per-chart error 
messages
   
   
   ####Root cause analysis
   `get_rls_filters()` in `security/manager.py` resolves the table ID by 
accessing `table.data["id"]`. While this returns the correct integer, it 
triggers the full .data property chain on `BaseDatasource`, which computes ~15 
fields — including `select_star`. That property calls `database.select_star() → 
get_sqla_engine() → create_engine()` , which requires a live connection to the 
external database. When that database is unreachable, the entire dashboard 
serialization fails:
   
   GET /api/v1/dashboard/{id}
     → schema.dump(dashboard)
       → thumbnail_url
         → digest
           → get_dashboard_digest()
             → _adjust_string_with_rls()
               → datasource.get_sqla_row_level_filters()
                 → security_manager.get_rls_filters(table)
                   → table.data["id"]      ← triggers data property
                     → self.select_star    ← requires DB engine
                       → create_engine()   ← connection error → 500
   
   The fix uses table.id directly — the same integer value, but as a simple ORM 
column attribute that requires no database connection.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   #### BEFORE
   <img width="3420" height="1568" alt="image (1)" 
src="https://github.com/user-attachments/assets/1a31e0bc-e5ce-4588-a46a-3d3aa86d5fc1";
 />
   
   #### AFTER
   <img width="1704" height="985" alt="image" 
src="https://github.com/user-attachments/assets/3d681abd-c89b-4cd0-bd91-acfb14d42aa6";
 />
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to