-
- Downloads
[MLv2] Introduce `swap-clauses` to reorder aggregations, etc. (#39850)
This includes some generative testing, since that felt like a great way to try all kinds of permutations of swapping clauses. This also patches `metabase.types/assignable?` to memoize it. Deeply nested `assignable?` calls made 100 tests of swapping filters take 1600ms rather than the 50-60ms of the other clauses. I think this is safe and reasonable on memory to cache forever, but speak up if you're concerned. There's perhaps O(60) type keywords, so `type X type -> Boolean` is a small space impact. Fixes #39215.
Showing
- src/metabase/lib/core.cljc 3 additions, 0 deletionssrc/metabase/lib/core.cljc
- src/metabase/lib/js.cljs 11 additions, 0 deletionssrc/metabase/lib/js.cljs
- src/metabase/lib/swap.cljc 44 additions, 0 deletionssrc/metabase/lib/swap.cljc
- src/metabase/types.cljc 9 additions, 5 deletionssrc/metabase/types.cljc
- test/metabase/lib/swap_test.cljc 114 additions, 0 deletionstest/metabase/lib/swap_test.cljc
src/metabase/lib/swap.cljc
0 → 100644
test/metabase/lib/swap_test.cljc
0 → 100644
Please register or sign in to comment