You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/21 17:36:39 UTC

[GitHub] [superset] anallani opened a new pull request, #19809: feat(charts): allow query mutator to mutate queries after splitting original sql

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

   <!---
   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 -->
   The changes allow a user to use the SQL_QUERY_MUTATOR function to add statements such as SET ROLE without breaking functionality. Currently, adding a statement like this works fine in the SQL Editor, but Charts run individual statements by splitting a passed in query and throw errors since SET ROLE does not return any data on its own. With the new MUTATE_AFTER_SPLIT variable, users can choose to apply the mutator function after the chart's query execution function splits a given query, allowing users to apply a change to all statements in a query and have Chart functionality not be interrupted.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   In the config file, update the SQL_QUERY_MUTATOR function to add a statement which does not return any results on its own and is something which should be run alongside all other statements in a given query. An example of this is adding a SET ROLE statement to the beginning of a query. Create a new Chart and see if queries return errors due to no data being fetched. Now in the config file, set the MUTATE_AFTER_SPLIT equal to True. Create a new Chart and make a query, and verify that the desired results are showing.
   
   ### 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
   - [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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] anallani closed pull request #19809: feat(charts): allow query mutator to update queries after splitting original sql

Posted by GitBox <gi...@apache.org>.
anallani closed pull request #19809: feat(charts): allow query mutator to update queries after splitting original sql
URL: https://github.com/apache/superset/pull/19809


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org