Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

[spec] Prevent t2.transformed/in-transforms from throwing on :model/ModelIndexValue (#79634)

Oleksandr Yakushev16bd231ba7e8
diff --git a/src/metabase/search/spec.clj b/src/metabase/search/spec.clj
index c92c5ce328f..136f973db55 100644
--- a/src/metabase/search/spec.clj
+++ b/src/metabase/search/spec.clj
@@ -456,8 +456,11 @@
"Given a transformed toucan map, get back a mapping to the raw db values that we can use in a query."
[instance]
(let [xforms (try
- (#'t2.transformed/in-transforms (t2/model instance))
- (catch Exception _ ; this happens for :model/ModelIndexValue, which has no transforms
+ (let [model (t2/model instance)]
+ ;; We know ModelIndexValue to have no transforms.
+ (when-not (and (keyword? model) (= (name model) "ModelIndexValue"))
+ (#'t2.transformed/in-transforms model)))
+ (catch Exception _ ; may happen for other models that have no transforms
nil))]
(reduce-kv
(fn [m k v]