-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Closed
Description
When using sqloxide, the logic for testing if a CTE is a select statement doesn't account for set operations.
How to reproduce the bug
SQLLab: WITH t AS ( SELECT 1 UNION ALL SELECT 2 ) SELECT * FROM t
Python interpreter:
import superset.sql_parse as sql_parse
assert sql_parse.sqloxide_parse is not None, "The case only fails when sqloxide is used"
parsed_query = sql_parse.ParsedQuery("""WITH t AS (
SELECT 1 UNION ALL SELECT 2
)
SELECT * FROM t""")
print("Is select:", parsed_query.is_select())Expected results
Interpreter: Is select: True
Actual results
SQLLAb: Only SELECT statements are allowed against this database.
Interpreter: Is select: False
Environment
The problem arises only when sqloxide is installed.
Checklist
Make sure to follow these steps before submitting your issue - thank you!
- I have checked the superset logs for python stacktraces and included it here as text if there are any.
- I have reproduced the issue with at least the latest released version of superset.
- I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
mapledan and kadakia-sesame
Metadata
Metadata
Assignees
Labels
No labels