-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
chore: Refine native dashboard cleanup logic #24864
chore: Refine native dashboard cleanup logic #24864
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24864 +/- ##
==========================================
- Coverage 69.00% 69.00% -0.01%
==========================================
Files 1904 1906 +2
Lines 74107 74143 +36
Branches 8194 8208 +14
==========================================
+ Hits 51140 51160 +20
- Misses 20848 20860 +12
- Partials 2119 2123 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -368,17 +368,15 @@ def cleanup( | |||
json_metadata = json.loads(dashboard.json_metadata or "{}") | |||
position_json = json.loads(dashboard.position_json or "{}") | |||
|
|||
if "native_filter_migration" not in json_metadata: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a dashboard has no filters then this key wouldn't exit and thus it's a misnomer to say that the dashboard hadn't been upgraded.
|
||
for value in position_json.values(): | ||
if ( | ||
isinstance(value, dict) | ||
and value["type"] == "MARKDOWN" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all values in the the position_json
dictionary contain the meta
key.
|
||
for value in position_json.values(): | ||
if ( | ||
isinstance(value, dict) | ||
and value["type"] == "MARKDOWN" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and value["type"] == "MARKDOWN" | |
and "meta" in value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michael-s-molina I've updated the PR to use a variant of this (in the form of the walrus operator) throughout for consistency.
3237bb9
to
70e01f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit 3458664)
SUMMARY
Making a few minor refinements on the native dashboard filter cleanup logic.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
CI.
ADDITIONAL INFORMATION