Skip to content
Snippets Groups Projects
Commit 7380efe4 authored by Cam Saul's avatar Cam Saul
Browse files

Don't try to expand GA metrics

parent fc96fae4
No related branches found
No related tags found
No related merge requests found
......@@ -69,8 +69,18 @@
;;; | METRICS |
;;; +----------------------------------------------------------------------------------------------------------------+
(defn- ga-metric?
"Is this metric clause not a Metabase Metric, but rather a GA one? E.g. something like [metric ga:users]. We want to
ignore those because they're not the same thing at all as MB Metrics and don't correspond to objects in our
application DB."
[[_ id]]
(boolean
(when ((some-fn string? keyword?) id)
(re-find #"^ga:" (name id)))))
(defn- metric? [aggregation]
(is-clause? #{:metric} aggregation))
(and (is-clause? #{:metric} aggregation)
(not (ga-metric? aggregation))))
(defn- metric-id [metric]
(when (metric? metric)
......
......@@ -179,3 +179,8 @@
:query {:source-table (data/id :venues)
:aggregation [["METRIC" (u/get-id metric)]]
:breakout [(ql/breakout (ql/field-id (data/id :venues :price)))]}})))))
;; make sure that we don't try to expand GA "metrics" (#6104)
(expect
{:query {:aggregation [[:metric :ga:users]]}}
(#'expand-macros/expand-metrics-and-segments {:query {:aggregation [[:metric :ga:users]]}}))
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