cccs-Dustin opened a new pull request, #20056:
URL: https://github.com/apache/superset/pull/20056

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   In Superset's config file, there is a config option called 
`DEFAULT_VIZ_TYPE` which you can use to define which viz you would like to use 
in the chart explorer by default. This is a very useful config option, 
especially when you have a custom viz you would like to use instead of the 
Superset `Table` viz. However, when you are in SQL Lab and you want to create 
and explore a dataset, there is currently no way to to change the default viz 
which will be used. 
   
   This PR allows for the `DEFAULT_VIZ_TYPE` config option to also be used by 
SQL Lab when you want to explore a dataset. This allows for consistency between 
the chart explorer, and exploring through SQL Lab.
   
   The changes include modifying the front-end index file so that instead of 
hard coding the `table` viz, it uses a blank string for `viz_type`. This allows 
the back-end to change the viz_type to be whatever the `DEFAULT_VIZ_TYPE` 
config option is.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   N/A
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   1. Modify the config file so that the `DEFAULT_VIZ_TYPE` is a different viz 
from the standard `Table`.
   2. Within Superset, select "SQL Lab" from the top menu.
   3. Select "SQL Editor" from the drop down menu which was opened during step 
2.
   4. On the left side of the page, select a database and schema that you would 
like to run the test query on.
   5. For testing purposes, add some basic SQL to run against a table (e.g., 
`SELECT * FROM table_1;`).
   6. Select the `Run` button which will run the query.
   7. Once the results are displayed under the "Results" tab, select the 
`Explore` button to explore the result set in the data exploration view.
   8. Once the exploration view opens, you should see the viz type you defined 
in step 1 selected in the "Visualization Type" section.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [X] 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
   - [X] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   I also created a new discussion for this feature, it can be found here: 


-- 
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