feat: Adds Histogram chart migration logic#28780
Conversation
b7eeed8 to
687f159
Compare
| return buildQueryContext(formData, baseQueryObject => [ | ||
| { | ||
| ...baseQueryObject, | ||
| extras: { where: `${column} IS NOT NULL` }, |
There was a problem hiding this comment.
Given that column can only contain numeric values, we automatically exclude NULL values from the result. This also aligns better with the limit control.
|
|
||
| # calculate the histogram bin edges | ||
| bin_edges = np.histogram_bin_edges(df[column], bins=bins) | ||
| bin_edges = np.histogram_bin_edges(df[column].dropna(), bins=bins) |
There was a problem hiding this comment.
I added the dropna() to deal with NULL values independently of the query results.
| extras: { where: `${column} IS NOT NULL` }, | ||
| columns: [...groupby, column], | ||
| post_processing: [histogramOperator(formData, baseQueryObject)], | ||
| metrics: undefined, |
There was a problem hiding this comment.
metrics by default is [] but we need it to be undefined to avoid a GROUP BY.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #28780 +/- ##
==========================================
+ Coverage 60.48% 70.26% +9.77%
==========================================
Files 1931 1951 +20
Lines 76236 77607 +1371
Branches 8568 8756 +188
==========================================
+ Hits 46114 54528 +8414
+ Misses 28017 20954 -7063
- Partials 2105 2125 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
SUMMARY
This PR adds the Histogram chart migration logic (legacy ➡️ ECharts). Users can execute this migration using the CLI command and disable the legacy version with the VIZ_TYPE_DENYLIST configuration.
This PR also improves the Histogram chart to automatically handle
NULLvalues.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
1 - Upgrade a Histogram (legacy) chart using the CLI command
2 - Check the new chart
3 - Downgrade a Histogram (legacy) chart using the CLI command
4 - Check the legacy chart
ADDITIONAL INFORMATION