Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(native-filters): Reset column field for removed dataset #12519

Merged

Conversation

agatapst
Copy link
Contributor

SUMMARY

After removing dataset, which is used in some native filter, it was still possible to see field from this dataset. Dataset was removed, but field value was not removed from Filter Config Modal.
Described in #12457

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
First we set some native filter
remove_dataset_before
Then we remove used dataset and come back to native filter config
dataset_remove

After:
remove_dataset_after
dataset_remove_after

TEST PLAN

Set "DASHBOARD_NATIVE_FILTERS": True
Create new native filter with given dataset
Go to datasets and remove this dataset
Come back to native filter you have just created and check if you see 'Select' placeholder instead of field value from removed dataset

ADDITIONAL INFORMATION

@junlincc @rusackas @adam-stasiak

@agatapst agatapst changed the title Reset column field for removed dataset fix(native-filters): Reset column field for removed dataset Jan 14, 2021
@codecov-io
Copy link

codecov-io commented Jan 14, 2021

Codecov Report

Merging #12519 (0e2d4dc) into master (0de61df) will decrease coverage by 3.63%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12519      +/-   ##
==========================================
- Coverage   66.85%   63.22%   -3.64%     
==========================================
  Files        1018      486     -532     
  Lines       49776    29982   -19794     
  Branches     4869        0    -4869     
==========================================
- Hits        33280    18956   -14324     
+ Misses      16373    11026    -5347     
+ Partials      123        0     -123     
Flag Coverage Δ
cypress ?
javascript ?
python 63.22% <ø> (-0.80%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/db_engines/hive.py 0.00% <0.00%> (-85.72%) ⬇️
superset/sql_validators/postgres.py 50.00% <0.00%> (-50.00%) ⬇️
superset/db_engine_specs/hive.py 54.61% <0.00%> (-29.24%) ⬇️
superset/databases/commands/create.py 83.67% <0.00%> (-8.17%) ⬇️
superset/databases/commands/update.py 85.71% <0.00%> (-8.17%) ⬇️
superset/connectors/sqla/models.py 84.31% <0.00%> (-6.28%) ⬇️
superset/db_engine_specs/sqlite.py 90.62% <0.00%> (-6.25%) ⬇️
superset/databases/commands/test_connection.py 84.78% <0.00%> (-4.35%) ⬇️
superset/utils/celery.py 96.42% <0.00%> (-3.58%) ⬇️
superset/models/core.py 85.59% <0.00%> (-3.27%) ⬇️
... and 538 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0de61df...0e2d4dc. Read the comment docs.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@junlincc junlincc added dashboard:native-filters Related to the native filters of the Dashboard hold:testing! On hold for testing labels Jan 14, 2021
@adam-stasiak
Copy link
Contributor

First issue:
For dashboard I have two native filters for 2 different datasets
I remove one dataset and go back to native filters
I can see that for filter with removed dataset -> datasource and field are cleaned - OK!
I can see in the second native filter (without touched dataset) - I can se cleaned field but should not! - NOK!

@adam-stasiak
Copy link
Contributor

second issue:
After steps from issue#1 I set proper field for malformed filter
Change is applied
Refreshed page
Open filter configuration and scoping -> I can see cleaned FIELD for both -> but I think it is only on UI -> because left side of screenshot is showing available options :)
image

@agatapst
Copy link
Contributor Author

Thanks a lot Adam, I think these issues are connected with each other. I am working on them now!

@agatapst agatapst force-pushed the fix/native-filters-removed-dataset-field branch from ddfaa68 to 9ed7c78 Compare January 15, 2021 10:55
@adam-stasiak
Copy link
Contributor

Retest for your fixes -> it is ok 🟢

@junlincc junlincc self-requested a review January 16, 2021 05:18
@junlincc
Copy link
Member

junlincc commented Jan 16, 2021

I remove one dataset and go back to native filters

@adam-stasiak you are really the QA KING. thanks for taking care of the project while i was gone... 🙏👑

@junlincc
Copy link
Member

Thank you so much for the PR! @agatapst

for some reasons, I'm not seeing changes described above. but a spinning sign for the filter with deleted dataset.. not sure if I tested correctly? @adam-stasiak
https://user-images.githubusercontent.com/67837651/104804152-c7d3b100-577d-11eb-859e-e65880270444.mov

@adam-stasiak
Copy link
Contributor

@junlincc I saw this spinner in situation od removed dataset - > I consulted this with Agata and good idea is to raise new issue for this as it needs design for not available filters. I left this on Friday and forgot to raise : | I will create an issue for this.

@agatapst agatapst force-pushed the fix/native-filters-removed-dataset-field branch from cad78d6 to 6141130 Compare January 18, 2021 14:43
@agatapst
Copy link
Contributor Author

agatapst commented Jan 18, 2021

@junlincc yes, actually @adam-stasiak asked me about that spinner and at first I thought about making separate issue - but if this PR is still not merged, let's improve it in this PR.
Below I am attaching screenshot when there is something wrong with filter (i.e. dataset was removed). There is a text instead of spinner. Any suggestions about the copy are welcomed. 🙂
error_filter

@junlincc junlincc added the need:design-review Requires input/approval from a Designer label Jan 19, 2021
@junlincc
Copy link
Member

this error msg definitely need design 🙏 @mihir174

thanks for the change! @agatapst

@mihir174
Copy link
Contributor

@agatapst @adam-stasiak @junlincc

This might be a bit of a heavy treatment, but here's the standard error component in the Superset design system -
We can have the body text = the cause of the error

Screen Shot 2021-01-20 at 12 42 25 AM

@agatapst
Copy link
Contributor Author

agatapst commented Jan 20, 2021

Thanks @mihir174 🙂
Could we make this message more generic, universal? We could show it for all errors connected with a given filter in the Filter Bar. Right now it is impossible to distinguish if the error comes exactly from removing dataset. It may be one of the reasons that loading filter is not possible - but for example the reason may be that some used in this filter field was removed from dataset. So it won't be the same as 'dataset removed'.
Maybe we can just tell the user to 'check configuration'? In the Config Modal the user is "taken" to this filter and can see what is going on.
Zrzut ekranu 2021-01-20 o 14 46 00

cc @junlincc

Update: I have implemented the design. The copy is as above (but of course it can be changed).

@agatapst agatapst force-pushed the fix/native-filters-removed-dataset-field branch from 6141130 to 5226b9a Compare January 20, 2021 14:21
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 20, 2021
@adam-stasiak
Copy link
Contributor

Can we make the spacing bigger? It looks very tight. @agatapst @junlincc @mihir174
image

@adam-stasiak
Copy link
Contributor

Issue: After I fixed filter (Change dataset to existing one) I can see error remains :(

fil.mov

@agatapst
Copy link
Contributor Author

Thanks a lot Adam! @adam-stasiak
Could you check it once again? It seems ok now on my side:
error_alert

I have also made the margin slightly bigger:
Zrzut ekranu 2021-01-21 o 09 31 06

@agatapst agatapst force-pushed the fix/native-filters-removed-dataset-field branch from b50e1f3 to 0e2d4dc Compare January 21, 2021 09:57
@junlincc junlincc removed the hold:testing! On hold for testing label Jan 23, 2021
@junlincc
Copy link
Member

@rusackas @mistercrunch please help merge this PR, LGTM with code reviews and few rounds of changes...

@junlincc junlincc added need:merge The PR is ready to be merged and removed need:design-review Requires input/approval from a Designer labels Jan 23, 2021
@zhaoyongjie zhaoyongjie merged commit 0c38134 into apache:master Jan 23, 2021
@junlincc
Copy link
Member

thank you everyone for the PR, testing, design input, reviewing and merging. @agatapst @mihir174 @adam-stasiak @zhaoyongjie @villebro 🙏

@mistercrunch Max, just want to use this PR as an example to show how much work the team put into each single PR before merging.

@junlincc junlincc removed the need:merge The PR is ready to be merged label Jan 23, 2021
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels dashboard:native-filters Related to the native filters of the Dashboard size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[dashboard]Native filter FIELD loops when dataset in usewas removed
8 participants