feat(sqllab): use sqlglot instead of sqlparse#33542
Conversation
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Missing Predicate Parsing for Kusto KQL ▹ view | 🧠 Not in scope | |
| Uncached RLS Predicate Lookups ▹ view | 🧠 Incorrect | |
| Inefficient Repeated Predicate Parsing ▹ view | ✅ Fix detected |
Files scanned
| File Path | Reviewed |
|---|---|
| superset/exceptions.py | ✅ |
| superset/sql/parse.py | ✅ |
| superset/sql_lab.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
e913e28 to
71eed5a
Compare
There was a problem hiding this comment.
I've completed my review and didn't find any issues.
Files scanned
| File Path | Reviewed |
|---|---|
| superset/sqllab/sqllab_execution_context.py | ✅ |
| superset/exceptions.py | ✅ |
| superset/models/sql_lab.py | ✅ |
| superset/sql/parse.py | ✅ |
| superset/sql_lab.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
4af8cab to
50ea702
Compare
23572f5 to
3b70bb4
Compare
| if is_feature_enabled("RLS_IN_SQLLAB"): | ||
| for statement in parsed_script.statements: | ||
| apply_rls(query, statement) |
There was a problem hiding this comment.
Is RLS going to be applied to a CTA/CVA statement that's executed later on as well? I didn't know we would inject these into these as well.
There was a problem hiding this comment.
(Not saying this shouldn't happen, just genuinely asking)
There was a problem hiding this comment.
It should, right? Otherwise a user could bypass RLS by running a CTAS and looking at the table they created.
mistercrunch
left a comment
There was a problem hiding this comment.
LGTM, improving coverage is great in this area!
|
hey @betodealmeida I've been manually testing this, and noticed 1 issue (could be specific to MS SQL Server). I've created an RLS that's It does work on |
|
@Vitor-Avila nice catch! Just fixed it and added 2 unit tests to cover it. |
|
that's awesome! Thank you so much for these improvements 🙏 the flow is much easier to follow now |



SUMMARY
Part of #26786, stacked on:
Hooks SQL Lab to use the new
SQLScript, instead ofParsedQuery. I also cleaned up theexecute_sql_statementfunction, which did way more than executing a SQL statement — it included RLs modifications, adding limits, CTAS/CVAS, etc.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION