Disallow axis ranges with the same min/max, which causes divide by zero error (#27518)
* Disallow axis ranges with the same min/max, which causes divide by zero error The group-axes private fn is used to try group series axes together if the ranges of the series are 'close enough', which is calculated by determining the percentage overlap the ranges share. As the comparison is made, the first series in the list will always be compared with itself, and should have 1.0 (100%) overlap, as the ranges are going to be identical. The divide by zero issue arises when this first series, and potentially any other series, has a 'range' where the min and max are the same. This happens if the series has the same value in every row. With this change, these ranges are considered invalid, and we avoid the divide by zero. * Unskip e2e repro
Showing
- frontend/test/metabase/scenarios/visualizations/reproductions/27427-static-viz-divide-by-zero.cy.spec.js 1 addition, 1 deletion.../reproductions/27427-static-viz-divide-by-zero.cy.spec.js
- src/metabase/pulse/render/body.clj 4 additions, 2 deletionssrc/metabase/pulse/render/body.clj
- test/metabase/pulse/render/body_test.clj 17 additions, 1 deletiontest/metabase/pulse/render/body_test.clj
Loading
Please register or sign in to comment