Skip to content
Snippets Groups Projects
Commit 45841f94 authored by Ryan Senior's avatar Ryan Senior
Browse files

Added min/max values to binning_info

parent 2ff0b9fb
No related branches found
No related tags found
No related merge requests found
......@@ -46,10 +46,12 @@
fields))
metabase.query_processor.interface.BinnedField
(let [nested-field (:field this)]
(let [{{:keys [min-value max-value] :as nested-field} :field} this]
[(assoc nested-field :binning_info {:binning_strategy "num-bins"
:bin_width (:bin-width this)
:num_bins (:num-bins this)})])
:num_bins (:num-bins this)
:min_value min-value
:max_value max-value})])
metabase.query_processor.interface.Field
(if-let [parent (:parent this)]
......
......@@ -100,7 +100,7 @@
;;; ## ------------------------------------------------------------ FIELD PLACEHOLDER ------------------------------------------------------------
(defn calculate-bin-width [field num-bins]
(defn- calculate-bin-width [field num-bins]
(u/round-to-decimals 5 (/ (- (:max-value field)
(:min-value field))
num-bins)))
......
......@@ -284,7 +284,7 @@
"Spiros Teofil"
"Szymon Theutrich"]}
:created_at $}))
#spy/d ((user->client :rasta) :get 200 (format "table/%d/query_metadata?include_sensitive_fields=true" (id :users))))
((user->client :rasta) :get 200 (format "table/%d/query_metadata?include_sensitive_fields=true" (id :users))))
;;; GET api/table/:id/query_metadata
;;; Make sure that getting the User table does *not* include password info
......
......@@ -115,7 +115,8 @@
(expect-with-non-timeseries-dbs
(merge (venues-col :latitude)
{:min_value 10.0646, :source :breakout,
:max_value 40.7794, :binning_info {:binning_strategy "num-bins", :bin_width 10.23827, :num_bins 3}})
:max_value 40.7794, :binning_info {:binning_strategy "num-bins", :bin_width 10.23827, :num_bins 3
:min_value 10.0646, :max_value 40.7794}})
(tu/with-temporary-setting-values [breakout-bins-num 3]
(-> (data/run-query venues
(ql/aggregation (ql/count))
......
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