You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2023/10/12 14:05:26 UTC

[PR] fix(sqllab): template validation error within comments [superset]

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

   ### SUMMARY
   SQL Lab throws an error for undefined parameters even when those parameters are commented out of/not used by the query.
   Template validation within comments is unnecessary because [comments are cleared](https://github.com/apache/superset/blob/17792a507c7245c9e09c6eb98a774f2ef4ec8568/superset/sql_lab.py#L407)  when SQL is executed.
   This commit passes parsed_query to the template validation that can ignore the missing parameter validation error within comments.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   |Before|After|
   |--|--|
   |<img width="567" alt="Screenshot 2023-10-11 at 6 03 34 PM" src="https://github.com/apache/superset/assets/1392866/c8d701b9-31e7-4356-b094-4c3ba18902e6">|<img width="563" alt="Screenshot 2023-10-11 at 6 02 01 PM" src="https://github.com/apache/superset/assets/1392866/42e15289-899d-4d67-8a74-638815940ab9">|
   
   ### TESTING INSTRUCTIONS
   Go to sqllab and then run a query including a template string within comment-out block like select 123 --,{{ds}} 
   
   ### ADDITIONAL INFORMATION
   - [ ] 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: 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


Re: [PR] fix(sqllab): template validation error within comments [superset]

Posted by "justinpark (via GitHub)" <gi...@apache.org>.
justinpark commented on PR #25626:
URL: https://github.com/apache/superset/pull/25626#issuecomment-1760379579

   > Seeing this is about stripping of comments and SELECT commands, #25527 comes to mind -- if that's unrelated, no worries, but thought I'd flag it in case this would have an impact on that issue.
   
   This change isn't related to the issue #25527 because the change only applies on jinja template validation.


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


Re: [PR] fix(sqllab): template validation error within comments [superset]

Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on PR #25626:
URL: https://github.com/apache/superset/pull/25626#issuecomment-1760262021

   Seeing this is about stripping of comments and SELECT commands, https://github.com/apache/superset/issues/25527 comes to mind -- if that's unrelated, no worries, but thought I'd flag it in case this would have an impact on that issue.


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


Re: [PR] fix(sqllab): template validation error within comments [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #25626:
URL: https://github.com/apache/superset/pull/25626


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