michael-s-molina opened a new pull request, #34802: URL: https://github.com/apache/superset/pull/34802
### SUMMARY Fixes a bug where user-provided Jinja template parameters were not being properly threaded through the SQL processing pipeline, causing parsing errors and security validation failures. 🐛 Problem When users provided custom Jinja template parameters (e.g., {"table_name": "my_table"}), these parameters were not being passed to the Jinja template processor during SQL parsing and security validation. This caused: - SQL parsing errors when templates couldn't resolve variables - Security validation failures when table extraction failed -Inconsistent behavior between SQL execution and validation phases 🔧 Solution - Enhanced parameter threading: Added `template_params` parameter throughout the call stack from SQL execution to security validation - API improvements: Refactored `extract_tables_from_jinja_sql` → `process_jinja_sql` with structured return type for better maintainability ### TESTING INSTRUCTIONS 1. Open SQL Lab 2. Create a query with Jinja template variables: ``` SELECT * FROM {{ table_name }} WHERE status = '{{ status_filter }}' ``` 3. Add template parameters in the "Template Parameters" field: ``` { "table_name": "your_table_name", "status_filter": "active" } ``` 4. Expected: Query should execute successfully without parsing errors 5. Before fix: Would fail with parsing errors ### 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-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org