akedrou opened a new pull request #14768:
URL: https://github.com/apache/superset/pull/14768


   ### SUMMARY
   This PR adds a new per-database configuration option to disable data preview 
queries in SQL Lab. This setting is exposed in the database API as 
`preview_data`. I decided to add the feature to the database API and pass the 
database as a parameter to `addTable` rather than adding a database setting 
into a table API response (the proposed solution in #14726). As a result the 
data preview query was moved up to `addTable` as well. To my eye that looks 
cleaner since I don't think that previewing data should be a part of "table 
metadata" anyway.
   
   There is no UI change, though the UX changes when data preview is disabled 
to not show the data preview pane (or results) when getting table metadata.
   
   ### TESTING INSTRUCTIONS
   1. In the database configuration settings, add `"preview_data": false` to 
the "Extra" JSON object.
   2. In SQL Editor, select the database you have configured, and then any 
schema or table.
       - Alternately, trigger metadata to load from the editor textbox itself.
   3. Table metadata should load as normal, but no data preview query should 
run.
   4. When `preview_data` is true (or the key does not exist), a data preview 
query should run when selecting a table from the dropdown or triggering 
metadata to be loaded from the editor.
    
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: Resolves #14726 
   - [ ] 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
   - [x] 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.

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