Skip to content

"Clear All Filters" sets required time filter to 'No filter', causing downstream filters to error #33361

Open
@harelorinctera

Description

@harelorinctera

Bug description

When using native filters with cascading dependencies in Apache Superset, clearing all filters using the "Clear All Filters" button causes the required time range filter (e.g., "Last week") to be set to No filter.

Because this time filter is marked as non-optional (enableEmptyFilter: false), and other filters depend on it via cascadeParentIds, this results in a backend query error when rendering dependent filters:

Error: INVALID_CAST_ARGUMENT: Value cannot be cast to timestamp: None

Steps to reproduce

  1. Create a native time filter (type Time range) and mark it as required.
  2. Add default value, 'Last Week'
  3. Create dependent value filters from dataset that reference this time filter in 'Values are dependent on other filters'.
  4. Go to the dashboard view, ensure filters are working as expected.
  5. Click "Clear All Filters".
  6. Observe that:
  • The time filter is cleared to No filter, even though it's marked as required.
  • Downstream filters immediately error with an invalid cast exception.
  • Expected behavior: the time filter should reset to its default value (defaultDataMask) instead of clearing entirely.

Screenshots/recordings

Image

Image

Image

Superset version

4.0.2

Python version

Not applicable

Node version

I don't know

Browser

Not applicable

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions