rusackas opened a new pull request, #40224:
URL: https://github.com/apache/superset/pull/40224

   ### SUMMARY
   
   This is a **test-only PR** opened as a TDD-style validation of issue #25839.
   
   #25839 (filed 2023-11) reports that clicking *SYNC COLUMNS FROM SOURCE* on a 
virtual dataset containing Jinja (e.g. \`{{ from_dttm }}\`) produces an 
*Invalid SQL* error because Jinja is not rendered before the SQL parser sees it.
   
   This PR adds one regression test on \`get_virtual_table_metadata\`:
   
   1. **\`test_get_virtual_table_metadata_renders_jinja\`** — constructs a 
virtual dataset with \`'{{ from_dttm }}'\` in its SQL, mocks the template 
processor to return rendered SQL, calls \`get_virtual_table_metadata\`, and 
asserts that (a) no exception is raised, (b) the template processor was called 
with the raw Jinja SQL.
   
   ### How to interpret CI
   
   - **CI green** → \`get_virtual_table_metadata\` correctly runs the template 
processor before SQL parsing; merging closes #25839 and locks in the regression 
guard.
   - **CI red** → Jinja-rendering step is missing or out of order. Likely fix 
region: \`superset/connectors/sqla/utils.py::get_virtual_table_metadata\` lines 
105–110.
   
   ### TESTING INSTRUCTIONS
   
   \`\`\`bash
   pytest 
tests/unit_tests/connectors/sqla/utils_test.py::test_get_virtual_table_metadata_renders_jinja
 -v
   \`\`\`
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: closes #25839
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to