Bug description

Using the get_filters jinja macro inside of a virtual dataset does not get a filter if the operator is set to IS NULL or IS NOT NULL. Because of this it also does not remove them when remove_filter is set to true.

IS NULL and IS NOT NULL filters are the only SIMPLE filters that do not have a comparator. They fail this check.

Proposed fix: https://github.com/apache/superset/pull/33296

Screenshots/recordings

No response

Superset version

4.1.2

Python version

I don't know

Node version

I don't know

Browser

Not applicable

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.
  • [ ] 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.

Comment From: dosubot[bot]

Hello @Prokos! I'm Dosu, a bot here to help you with bugs, answer your questions, and assist you in becoming a contributor. I'm here while you wait for a human maintainer. Let's tackle this together!

The issue you're encountering with the get_filters Jinja macro in Apache Superset, where IS NULL and IS NOT NULL filters are ignored, is due to the fact that these filters are categorized as SIMPLE filters but do not have a comparator. This absence of a comparator leads to them being ignored during parsing from form_data, which prevents them from being retrieved or removed when remove_filter is set to true [1].

To address this, you might need to modify the logic in the code to ensure that filters without a comparator are correctly processed. This could involve adjusting the parsing logic to recognize IS NULL and IS NOT NULL operators as valid even without a comparator. You can refer to the line of code you identified in core.py for potential adjustments [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

Comment From: rusackas

Thanks for opening the PR to tackle this!

Comment From: Vitor-Avila

Closing this one as https://github.com/apache/superset/pull/33296 was merged