Superset is adding the escape character for '\' character in filter value, resulting to zero records filtered
- Dominant language
- Python
- Stars
- 74.8k
- Forks
- 18.3k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 685
Description
### Bug description
Using
- Superset 6.0
- Duckdb 1.3.0
- Duckdb Engine 0.17.0
We have data, in that one column that is columnA, which is having back slash in value (name\email)
1. When user add a filter for columnA
2. when user select the value from the columnA filter (Value will be name\email)
3. click on apply
4. Chart load with zero records, but records exist with value name\email in columnA
5. When we inspect the query, query add escape character in the filtered value, query looks as below
Query: SELECT ColumnA, ColumnB from TABLE where columnA IN ("name\\\\email")
ISSUE:
Because of adding the one more backslash to the value, query is returning zero records, even though values exist.
Please let us know, how we can resolve this issue
Thanks in advance
Nagaraj M M
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Contributor guide
Research direction
Reproduce the filter flow with Superset 6.0, DuckDB 1.3.0, DuckDB Engine 0.17.0, and a value such as name\email, then inspect the generated query shown in the report. Trace where the selected filter value becomes the SQL IN value; done means the query preserves the stored backslash and the chart returns the matching record.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100