Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preprocess SQL Lab query prior to checking syntax #4686

Merged
merged 1 commit into from Mar 26, 2018
Merged

Preprocess SQL Lab query prior to checking syntax #4686

merged 1 commit into from Mar 26, 2018

Conversation

villebro
Copy link
Member

Syntax checking doesn't work if jinja templates haven't been prerendered.
Also remove unreachable return statement. Fixes #4288.

Syntax checking doesn't work if jinja templates haven't been prerendered.
Also remove unreachable return statement. Fixes #4288.
@villebro
Copy link
Member Author

villebro commented Mar 24, 2018

Testing for this would require calling sql_lab.execute_query(), as the error arises when syntax checking happens prior to calling the template processor. Currently there doesn't seem to be a unit test for this function. If the maintainers see the need for one for this specific case, I can add one.

@codecov-io
Copy link

Codecov Report

Merging #4686 into master will increase coverage by <.01%.
The diff coverage is 55.55%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4686      +/-   ##
=========================================
+ Coverage    71.4%   71.4%   +<.01%     
=========================================
  Files         190     190              
  Lines       14935   14934       -1     
  Branches     1102    1102              
=========================================
  Hits        10664   10664              
+ Misses       4268    4267       -1     
  Partials        3       3
Impacted Files Coverage Δ
superset/sql_lab.py 74.6% <55.55%> (+0.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9abc5c7...43a614b. Read the comment docs.

@mistercrunch mistercrunch merged commit 4ec8258 into apache:master Mar 26, 2018
@villebro villebro deleted the jinja_bug_in_sqllab branch March 26, 2018 18:15
john-bodley pushed a commit to john-bodley/superset that referenced this pull request Mar 29, 2018
Syntax checking doesn't work if jinja templates haven't been prerendered.
Also remove unreachable return statement. Fixes apache#4288.
(cherry picked from commit 4ec8258)
john-bodley pushed a commit to john-bodley/superset that referenced this pull request Mar 30, 2018
Syntax checking doesn't work if jinja templates haven't been prerendered.
Also remove unreachable return statement. Fixes apache#4288.
(cherry picked from commit 4ec8258)
john-bodley pushed a commit to john-bodley/superset that referenced this pull request Mar 30, 2018
Syntax checking doesn't work if jinja templates haven't been prerendered.
Also remove unreachable return statement. Fixes apache#4288.
(cherry picked from commit 4ec8258)
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
Syntax checking doesn't work if jinja templates haven't been prerendered.
Also remove unreachable return statement. Fixes apache#4288.
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
Syntax checking doesn't work if jinja templates haven't been prerendered.
Also remove unreachable return statement. Fixes apache#4288.
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query starting with jinja2 statement is rejected because "it's not a select"
3 participants