superset icon indicating copy to clipboard operation
superset copied to clipboard

Dependent Filter Issue :- If the parent Filter value is changed then the dependent filter with previous selected value is not getting removed if its not in the dependent filter data(options)

Open shubham1811 opened this issue 1 year ago • 9 comments

How to reproduce the bug

  1. Create a Filter Name A
  2. Create a Filter Name B
  3. Tick the checkbox the Values are dependent on other filters in Filter B and select A in VALUES DEPENDENT ON
  4. Click on Save
  5. Select some value in filter A
  6. Data API call will be done for Filter B and the option will be updated.
  7. Select some value in Filter B. For Example, Selected Asia.
  8. Remove the Filter Value in Filter A and select some other option.
  9. Data API call will be done for Filter B and the option will be updated.
  10. In Option of Filter B previously selected will be present and it's not coming from the Result of Data(API Call).

Expected results

If The Previously selected value is not present in the result of the dependent filter API call it shouldn't be present in the option or in the selected state.

Actual results

The previously selected value if it's not present in the result of the dependent filter API call its showing in the option or its getting selected also.

Screenshots

https://jam.dev/c/2e22ee9e-d1b2-48ba-a063-11dfe2584c8a Screenshot 2023-06-26 at 12 32 57 PM

https://jam.dev/c/54743133-2a1e-4d79-bfa4-30e0d8cdc95c Screenshot 2023-06-26 at 12 36 28 PM

https://jam.dev/c/bad93252-6c4c-4ade-bd7b-53108b245692

Screenshot 2023-06-26 at 12 40 19 PM

https://jam.dev/c/2e343713-d305-4b3d-b504-8c5d48b75647 Screenshot 2023-06-26 at 12 41 34 PM

https://jam.dev/c/5f3fa04b-c25f-4ea9-9108-c1059a3f9caf Screenshot 2023-06-26 at 12 44 10 PM

https://jam.dev/c/c963fc06-e234-422e-85f5-60a8b7592574 Screenshot 2023-06-26 at 12 46 59 PM

Environment

(please complete the following information):

  • browser type and version:
  • superset version: master
  • python version: python --version
  • node.js version: 16.15.0
  • any feature flags active:

Checklist

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

  • [Yes] I have checked the superset logs for Python stack traces and included them here as text if there are any.
  • [Yes] I have reproduced the issue with at least the latest released version of the superset.
  • [Yes] I have checked the issue tracker for the same issue and I haven't found one similar.

shubham1811 avatar Jun 26 '23 07:06 shubham1811

I can validate this in Superset 2.1.0 and agree that it would be better if when the user selects a new value in filter A, the value in filter B is reset. I thought this issue had already been filed but I'm not seeing another bug report so thanks for submitting this one.

The closest thing I see is this https://github.com/apache/superset/issues/22979 which is not identical.

sfirke avatar Jul 07 '23 16:07 sfirke

Having the same issue here in 2.1.0

I can add that :

  • if you have 'Select first filter value by default ' active on the filters and click on the 'CLEAR ALL' button while parent filter is loading, you'll get 'null' as a selected value in child filters
  • if you have 'Select first filter value by default ' active on the filters and then click on the 'CLEAR ALL' button while parent and child filters are set, it will reset the parent filter but not the children. another 'CLEAR ALL' will then clear the children.

It feels like any change in the parent should cascade in the child filter, and child filters should be loaded only when the parent filter has finished loading.

lchavas avatar Aug 25 '23 12:08 lchavas

Having the same issue here in 2.1.0

I can add that :

  • if you have 'Select first filter value by default ' active on the filters and click on the 'CLEAR ALL' button while parent filter is loading, you'll get 'null' as a selected value in child filters
  • if you have 'Select first filter value by default ' active on the filters and then click on the 'CLEAR ALL' button while parent and child filters are set, it will reset the parent filter but not the children. another 'CLEAR ALL' will then clear the children.

It feels like any change in the parent should cascade in the child filter, and child filters should be loaded only when the parent filter has finished loading.

Yes Correct child filters should be loaded only when the parent filter has finished loading.

shubham1811 avatar Aug 29 '23 16:08 shubham1811

Updated to 2.1.1 with high hopes, parent filter being adressed in the changelog. However the issue is unchanged, and we still have to clear the first null value manually and change the subfilters manually everytime the parent filter is changed.

lchavas avatar Sep 13 '23 10:09 lchavas

Does anyone know if this is addressed in SuperSet's latest update to version 3.0?

Lbostwick avatar Sep 22 '23 16:09 Lbostwick

This is still happening in superset 3.0

Ian2012 avatar Oct 12 '23 20:10 Ian2012

I'm assuming this is still happening in 3.1/4.0, but we'd appreciate verification of that almost as much as a PR :)

rusackas avatar Mar 21 '24 18:03 rusackas

@rusackas I can confirm it is still happening in 4.0.0 also

giacomochiarella avatar Apr 23 '24 14:04 giacomochiarella

Facing the same issue in 10.1.1

hk-the-analyst avatar May 06 '24 17:05 hk-the-analyst

I can confirm it is not fixed in 4.0.2

cmartinezdnn avatar Jul 15 '24 13:07 cmartinezdnn

This issue is very annoying. Does anybody know how to fix it?

cmartinezdnn avatar Jul 26 '24 15:07 cmartinezdnn