rusackas opened a new pull request, #42928: URL: https://github.com/apache/superset/pull/42928
### SUMMARY Corrects several issues in how Superset parses and classifies SQL statements, and tightens the access-validation checks on SQL Lab entry points so they behave consistently with the main execute path. - Jinja-templated SQL is rendered a single time so the SQL that is validated is exactly the SQL that runs, and no-op template processors run the raw SQL unchanged. - Statement classification is more accurate: `COMMIT`, `EXEC`/`EXECUTE`, cross-dialect command fallbacks (`CALL`, `LOAD`), and `EXPLAIN ANALYZE` variants are recognised as state-changing; `USE` / `SET SCHEMA` / `search_path` changes are detected as rebinding unqualified-name resolution. - `SHOW CREATE TABLE`/`SHOW COLUMNS` targets are extracted for table-level checks, while metadata statements with no extractable target are treated as unparseable. - Partition macros whose table reference cannot be resolved statically are rejected rather than silently skipped. - The query-estimate, `format_sql`, and `validate_sql` endpoints now run the same table-level access check as execution, before template rendering; CTAS/CVAS grants are enforced server-side at submission. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Not applicable (backend behavior). ### TESTING INSTRUCTIONS `pytest tests/unit_tests/sql/parse_tests.py tests/unit_tests/db_engine_specs/test_postgres.py tests/unit_tests/commands/sql_lab/ tests/unit_tests/sqllab/ tests/unit_tests/sql_lab_execution_context.py` ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Changes UI - [ ] Includes DB Migration - [ ] Introduces new 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
