sha174n opened a new pull request, #40531:
URL: https://github.com/apache/superset/pull/40531
`ExtraCache.get_filters()` and `_get_filters_from_query_context()` now
expose a companion `escaped_val` key on each returned filter dict whenever a
SQL dialect is configured. The value is produced via
`String().literal_processor`, the same path already used by `url_param`, so the
quoting rules track the active dialect.
`val` continues to carry the raw value for non-SQL uses (comparison,
logging, `where_in`). The companion key is opt-in: only templates that read
`filter.get('escaped_val')` see the processed form, so existing templates and
downstream consumers are unaffected. The docstring example now demonstrates the
`LIKE` interpolation pattern with `escaped_val`, replacing the manual
`replace("'", "''")` snippet that worked only for a subset of dialects.
Unit tests cover the string, list-of-string, and `query_context_filters`
paths, plus a no-dialect case asserting the key is absent so the prior return
schema is preserved.
### Testing
- `pytest tests/unit_tests/jinja_context_test.py -k get_filters`
### Checklist
- [x] Has associated issue: N/A (incremental hardening, ride-along with
docstring update)
- [x] Required feature flags: N/A
- [x] Changes are backwards compatible
- [x] Relevant documentation has been updated
- [x] Unit tests have been added
--
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]