Skip to content
Snippets Groups Projects
Unverified Commit cf59ad4f authored by Case Nelson's avatar Case Nelson Committed by GitHub
Browse files

[MLv2] Test for #31384 available aggregators updates from join (#35512)

Fixes #31384
parent 1b1b6194
No related branches found
No related tags found
No related merge requests found
(ns metabase.lib.aggregation-test
(:require
#?@(:cljs ([metabase.test-runner.assert-exprs.approximately-equal]))
[clojure.set :as set]
[clojure.test :refer [are deftest is testing]]
[medley.core :as m]
[metabase.lib.aggregation :as lib.aggregation]
......@@ -802,3 +803,15 @@
0 [:count {}]
1 [:count {}]
2 nil)))
(deftest ^:parallel aggregation-operators-update-after-join
(testing "available operators includes avg and sum once numeric fields are present (#31384)"
(let [query (lib/query meta/metadata-provider (meta/table-metadata :categories))]
(is (not (set/subset?
#{:avg :sum}
(set (mapv :short (lib/available-aggregation-operators query)))))
(is (set/subset?
#{:avg :sum}
(set (mapv :short (-> query
(lib/join (meta/table-metadata :venues))
lib/available-aggregation-operators)))))))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment