apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.82k stars 13.88k forks source link

[native-filters]Default to first item in filter hierarchy does not respect prior default hierarchy selections #15515

Open rbruehlman opened 3 years ago

rbruehlman commented 3 years ago

Suppose you have a hierarchy of Animal -> Breed, and Breed is set to default to the first option.

Unfiltered, the first value of Breed is Abruzzenhund, a dog breed.

However, species is set to a default value of "Cat". The expected behavior is that the first default value for Breed should be Abyssian, a cat breed, but Abruzzenhund appears instead. This means the dashboard shows no data.

Expected results

The default selections in a hierarchy should influence the first item of filters below.

Actual results

The first item displayed ignores the default values of parent filters.

How to reproduce the bug

  1. Create two filters. Set the first to have a default value of some kind
  2. Set the second filter to be a child of the first, and set it to default to the first item
  3. Load the dashboard and see the first item may well not be logical

Environment

Checklist

Make sure to follow these steps before submitting your issue - thank you!

rbruehlman commented 3 years ago

@amitmiran137 not sure if this can be fixed for 1.3, but if it can, that would be super helpful!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

fred-hartman commented 1 year ago

I have this problem in multiple dashboards superset version: 2.1.0 release python version: Python 3.8.1 using chrome Version 114.0.5735.90 (Official Build) (arm64) as the dashboard browser I see no errors in the Developer Tools console.

rusackas commented 8 months ago

I'm not sure if this is still an issue in current versions of Superset (3.x). If it is, we can re-open this, or feel free to open a new issue with updated context and a reproducible case using example data. We're no longer supporting Superset 2.x or prior, and it's been a while since this thread saw any activity, so I'm closing this as stale.

fred-hartman commented 8 months ago

This is still a problem in Superset 3.0.2. What is the best way to facilitate reproducing the problem? I believe you need the following

Should I attach the files to this thread or create a pull request?

rusackas commented 8 months ago

Thanks for looking into it. Reopening. If you mean a pull request to fix the issue, that would be amazing. If you mean a PR to reproduce this issue (like an ephemeral workspace in a failing state), I guess that's plausible... but maybe not as simple as creating a failing dashboard and exporting it, then linking to the .zip here. Re-reading this, I think I get the issue... it's just a bit of an edge case that I think core contributors will have a hard time prioritizing. We could use some community help here if anyone wants to investigate a fix.

rusackas commented 2 months ago

Can anyone verify if this is still happening on the latest master? I feel like I saw a PR go by about this, but I'm not 100% sure.