Skip to content
Snippets Groups Projects
Commit 221a677e authored by Simon Belak's avatar Simon Belak
Browse files

Correctly parse fk-> field references + Ensure time is 1st dimension

parent 63d25083
No related branches found
No related tags found
No related merge requests found
......@@ -145,8 +145,8 @@ cards:
title: "[[this]] per [[GenericCategorySmall]] over time"
metrics: this
dimensions:
- GenericCategorySmall
- Timestamp
- GenericCategorySmall
visualization:
area:
stackable.stack_type: stacked
......
......@@ -12,7 +12,7 @@
[(s/one (s/constrained su/KeywordOrString
(comp #{:field-id :fk-> :field-literal} qp.util/normalize-token))
"head")
(s/cond-pre s/Int su/KeywordOrString)])
(s/cond-pre s/Int su/KeywordOrString (s/recursive #'FieldReference))])
(def ^:private ^{:arglists '([form])} field-reference?
"Is given form an MBQL field reference?"
......@@ -31,7 +31,9 @@
(defmethod field-reference->id :fk->
[[_ _ id]]
id)
(if (sequential? id)
(field-reference->id id)
id))
(defmethod field-reference->id :field-literal
[[_ name _]]
......@@ -42,7 +44,9 @@
form."
[form]
(->> form
(tree-seq (some-fn sequential? map?) identity)
(tree-seq (every-pred (some-fn sequential? map?)
(complement field-reference?))
identity)
(filter field-reference?)))
(def ^{:arglists '([field])} periodic-datetime?
......
......@@ -73,7 +73,7 @@
(s/defn ^:private resolve-default-strategy :- [(s/one (s/enum :bin-width :num-bins) "strategy")
(s/one {:bin-width s/Num, :num-bins su/IntGreaterThanZero} "opts")]
"Determine the approprate strategy & options to use when `:default` strategy was specified."
[metadata :- {:special_type su/FieldType, s/Any s/Any}, min-value :- s/Num, max-value :- s/Num]
[metadata :- {:special_type (s/maybe su/FieldType), s/Any s/Any}, min-value :- s/Num, max-value :- s/Num]
(if (isa? (:special_type metadata) :type/Coordinate)
(let [bin-width (public-settings/breakout-bin-width)]
[:bin-width
......
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