[MLv2] Handle nested "Zoom In" drills on binned columns (#40965)
The first time you zoom in on a bin in a binned query, it works fine. For example, Orders COUNT by SUBTOTAL auto-binned has a bin for 40-60. If you zoom in on that, it correctly shows the range 40 to 60 broken down into smaller bins which are 2.5 units wide. If you then try to zoom in on one of these smaller bins, say 50-52.5, there are two problems: 1. The filters from the first zoom (`>= 40` and `< 60`) are still there, and so are the new ones (`>= 50` and `< 52.5`). 2. The new filter is actually wrong; it uses the big width (20) from the original bins, not the width of the nested bins (2.5), so the new filters are `>= 50` and `< 70`. This PR fixes both issues, so nested bins (1) remove the old filters, and (2) use the correct width for the nested bins.
Showing
- src/metabase/lib/binning.cljc 16 additions, 6 deletionssrc/metabase/lib/binning.cljc
- src/metabase/lib/drill_thru/zoom_in_bins.cljc 12 additions, 6 deletionssrc/metabase/lib/drill_thru/zoom_in_bins.cljc
- test/metabase/lib/drill_thru/zoom_in_bins_test.cljc 38 additions, 0 deletionstest/metabase/lib/drill_thru/zoom_in_bins_test.cljc
Please register or sign in to comment