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(dashboard): make to filter the correct certified or non-certified… #19429

Merged
merged 3 commits into from
Apr 21, 2022

Conversation

prosdev0107
Copy link
Contributor

@prosdev0107 prosdev0107 commented Mar 30, 2022

SUMMARY

Non certified dashboards appear on dashboard list when filtering by certified

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE:
In case of certified filter is Yes
image

In case of certified filter is No
image

AFTER:
In case of certified filter is Yes
image

In case of certified filter is No
image

TESTING INSTRUCTIONS

How to reproduce the bug

  1. Certify some dashboards (This can be done from the dashboard CRUD view > edit > certified fields at the bottom of the modal)
  2. Go to the dashboard list
  3. Should show only certificated Dashboards when the filter option of certified is Yes.

Generally, You will not reproduce this issue anymore with dashboard CRUD. This issue is happened when the certified_by field value is empty string, not null value.(like following image). and so I had a test after changing this forcely into empty string in some dashboards value and then could catch this issue and fix it.
image

Or you can see this issue on the following workspace;
https://8bf970d2.us1a.app.preset.io/dashboard/list/?filters=(certified:(label:Yes,value:!t))&pageIndex=0&sortColumn=changed_on_delta_humanized&sortOrder=desc&viewMode=table

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Mar 30, 2022

Codecov Report

Merging #19429 (69fc5d8) into master (ac2c66c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #19429   +/-   ##
=======================================
  Coverage   66.51%   66.51%           
=======================================
  Files        1686     1686           
  Lines       64589    64589           
  Branches     6635     6635           
=======================================
  Hits        42959    42959           
  Misses      19931    19931           
  Partials     1699     1699           
Flag Coverage Δ
hive 52.69% <ø> (ø)
mysql 81.95% <ø> (ø)
postgres 82.00% <ø> (ø)
presto 52.54% <ø> (ø)
python 82.43% <ø> (ø)
sqlite 81.76% <ø> (ø)
unit 47.75% <ø> (ø)

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

Impacted Files Coverage Δ
superset/dashboards/filters.py 93.67% <ø> (ø)

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 ac2c66c...69fc5d8. Read the comment docs.

@prosdev0107
Copy link
Contributor Author

@rusackas
Would you like to merge this PR into master?

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

Added a couple of click-to-commit suggestions that should fix the Python linting issues blocking this PR.

superset/dashboards/filters.py Outdated Show resolved Hide resolved
superset/dashboards/filters.py Outdated Show resolved Hide resolved
Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this issue. For the short term, the fix is good. for the long term, I suggest adding todo notation in the codebase. We might set the certified_by to NULL in the Dashboard model when the user deactivates certified so that only keep is null in where clause.

@rusackas
Copy link
Member

Thanks for fixing this issue. For the short term, the fix is good. for the long term, I suggest adding todo notation in the codebase. We might set the certified_by to NULL in the Dashboard model when the user deactivates certified so that only keep is null in where clause.

@prosdev0107 do you want to add that TODO as suggested?

@prosdev0107
Copy link
Contributor Author

prosdev0107 commented Apr 21, 2022

@rusackas @zhaoyongjie
According to my local testing result, the certified_by is already keeping only null value when user creates new dashboard or deactivates existing certified on current codebase. So I am wondering if I should add this TODO.

I just added one more condition into where clause for filtering dashboards correctly that was saved before that is keeping only null value when user deactivates certified.

Anyway, I can add TODO as suggested for any unexpected case.

@rusackas rusackas merged commit 3ccfa56 into apache:master Apr 21, 2022
hughhhh pushed a commit to hve-labs/superset that referenced this pull request May 11, 2022
apache#19429)

* fix(dashboard): make to filter the correct certified or non-certified dashboards

* fix(dashboard): make to fix python lint issue
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
apache#19429)

* fix(dashboard): make to filter the correct certified or non-certified dashboards

* fix(dashboard): make to fix python lint issue
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 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 Preset-Patch size/XS 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants