-
Notifications
You must be signed in to change notification settings - Fork 17k
6.1.0rc1 SQL comments in Custom SQL filters are stripped from generated queries #39169
Copy link
Copy link
Open
Labels
explore:filterRelated to filters in ExploreRelated to filters in Explore
Description
Bug Description
When users add SQL filters with comments in the Custom SQL filter tab, the comments are stripped when the query is generated and executed.
Expected Behavior
SQL comments should be preserved in the generated query, as they are used for:
- Query hints and optimizer directives
- Annotation metadata
- Audit trail information
Actual Behavior
Comments are removed from the filter. For example:
- Input:
TRUE /* my_annotation*/ - Generated WHERE clause:
WHERE TRUE(comment is missing)
Steps to Reproduce
- Create or edit a chart in Explore
- Add a filter using the "Custom SQL" tab
- Enter a filter with a comment, e.g.:
TRUE /* my_annotation */ - Save the filter and run the query
- Click the kebab menu → "View query"
- Observe that the comment is missing from the WHERE clause
Environment
- Superset version: (all versions)
- Browser: N/A (backend issue)
Additional Context
This affects teams that rely on SQL comments for query annotations or database-specific hints passed through filter expressions.
Screenshots/recordings
Screen.Recording.2026-04-07.at.14.44.34.mov
Superset version
6.0.0
Python version
3.10
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- I have searched Superset docs and Slack and didn't find a solution to my problem.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
explore:filterRelated to filters in ExploreRelated to filters in Explore
Type
Fields
Give feedbackNo fields configured for issues without a type.