Vitor-Avila opened a new pull request, #31948:
URL: https://github.com/apache/superset/pull/31948

   ### SUMMARY
   The `get_all_table_names_in_schema` and `get_all_view_names_in_schema` 
methods might return data from cache (if `force` isn't set to `True`). Metadata 
is serialized before getting cached, so currently if cached results are 
returned, the logic would throw an error as it would try to access these as 
`DatasourceName` named tuples directly.
   
   This PR changes the logic so that the result of these methods are then 
loaded as `DatasourceName`s, so that cached results can be used properly.
   
   I also added the catalog name to the `schema_list` cache key.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   **Before**
   An error is displayed when trying to load cached table list:
   
![image](https://github.com/user-attachments/assets/33a78164-ba53-42c0-8e43-5ae4f7f4e4d0)
   
   
   **After**
   List loads properly.
   
   ### TESTING INSTRUCTIONS
   1. Create a DB connection.
   2. Set a cache timeout for table metadata.
   3. Load tables from a schema.
   4. Refresh the browser.
   5. The list should load properly.
   
   ### 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