-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
migrate dashboard stored default filters to time range format #5556
migrate dashboard stored default filters to time range format #5556
Conversation
@john-bodley worked on backend legacy filter handling recently here #5525 , so he's probably the best person to review this. |
Codecov Report
@@ Coverage Diff @@
## master #5556 +/- ##
=======================================
Coverage 63.12% 63.12%
=======================================
Files 349 349
Lines 22167 22167
Branches 2462 2462
=======================================
Hits 13992 13992
Misses 8161 8161
Partials 14 14 Continue to review full report at Codecov.
|
|
||
metadata['default_filters'] = json.dumps(default_filters, indent=2) | ||
dashboard.json_metadata = json.dumps(metadata, indent=2) | ||
session.merge(dashboard) |
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.
You shouldn’t need to explicitly merge the updated dashboard object as SQLAlechemy is aware of these mutation.
metadata['default_filters'] = json.dumps(default_filters, indent=2) | ||
dashboard.json_metadata = json.dumps(metadata, indent=2) | ||
session.merge(dashboard) | ||
session.commit() |
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.
The commit should be outside of the for lool.
Thanks @john-bodley, updated |
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 |
Since #4981
__from
and__to
default filters from dashboards were treated as normal WHERE filters instead of being used to fill the time range options.An alternative to this would be some legacy function to handle the previous format.
Fixes #5553