-
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
feat: Adds Histogram chart migration logic #28780
feat: Adds Histogram chart migration logic #28780
Conversation
b7eeed8
to
687f159
Compare
@@ -25,8 +25,10 @@ export default function buildQuery(formData: HistogramFormData) { | |||
return buildQueryContext(formData, baseQueryObject => [ | |||
{ | |||
...baseQueryObject, | |||
extras: { where: `${column} IS NOT NULL` }, |
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.
Given that column
can only contain numeric values, we automatically exclude NULL
values from the result. This also aligns better with the limit control.
@@ -53,7 +53,7 @@ def histogram( | |||
raise ValueError(f"The column '{column}' must be numeric.") | |||
|
|||
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the dropna()
to deal with NULL
values independently of the query results.
columns: [...groupby, column], | ||
post_processing: [histogramOperator(formData, baseQueryObject)], | ||
metrics: undefined, |
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.
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. |
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
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
NULL
values.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