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

code cleanup

parent 00d773c1
No related branches found
No related tags found
No related merge requests found
...@@ -522,7 +522,7 @@ ...@@ -522,7 +522,7 @@
;; ## CUMULATIVE SUM ;; ## CUMULATIVE SUM
;; TODO - Should we move this into IDataset? It's only used here, but the logic might get a little more compilcated when we add more drivers ;; TODO - Should we move this into IDataset? It's only used here, but the logic might get a little more compilcated when we add more drivers
(defn- ->sum-field-type (defn- ->sum-type
"Since summed integer fields come back as different types depending on which DB we're using, cast value V appropriately." "Since summed integer fields come back as different types depending on which DB we're using, cast value V appropriately."
[v] [v]
(case (id-field-type) (case (id-field-type)
...@@ -531,7 +531,7 @@ ...@@ -531,7 +531,7 @@
;; ### cum_sum w/o breakout should be treated the same as sum ;; ### cum_sum w/o breakout should be treated the same as sum
(qp-expect-with-all-datasets (qp-expect-with-all-datasets
{:rows [[(->sum-field-type 120)]] {:rows [[(->sum-type 120)]]
:columns ["sum"] :columns ["sum"]
:cols [{:base_type (id-field-type), :special_type :id, :name "sum", :id nil, :table_id nil, :description nil}]} :cols [{:base_type (id-field-type), :special_type :id, :name "sum", :id nil, :table_id nil, :description nil}]}
{:source_table (id :users) {:source_table (id :users)
...@@ -550,21 +550,21 @@ ...@@ -550,21 +550,21 @@
;; ### Cumulative sum w/ a different breakout field ;; ### Cumulative sum w/ a different breakout field
(qp-expect-with-all-datasets (qp-expect-with-all-datasets
{:rows [["Broen Olujimi" (->sum-field-type 14)] {:rows [["Broen Olujimi" (->sum-type 14)]
["Conchúr Tihomir" (->sum-field-type 21)] ["Conchúr Tihomir" (->sum-type 21)]
["Dwight Gresham" (->sum-field-type 34)] ["Dwight Gresham" (->sum-type 34)]
["Felipinho Asklepios" (->sum-field-type 36)] ["Felipinho Asklepios" (->sum-type 36)]
["Frans Hevel" (->sum-field-type 46)] ["Frans Hevel" (->sum-type 46)]
["Kaneonuskatew Eiran" (->sum-field-type 49)] ["Kaneonuskatew Eiran" (->sum-type 49)]
["Kfir Caj" (->sum-field-type 61)] ["Kfir Caj" (->sum-type 61)]
["Nils Gotam" (->sum-field-type 70)] ["Nils Gotam" (->sum-type 70)]
["Plato Yeshua" (->sum-field-type 71)] ["Plato Yeshua" (->sum-type 71)]
["Quentin Sören" (->sum-field-type 76)] ["Quentin Sören" (->sum-type 76)]
["Rüstem Hebel" (->sum-field-type 91)] ["Rüstem Hebel" (->sum-type 91)]
["Shad Ferdynand" (->sum-field-type 97)] ["Shad Ferdynand" (->sum-type 97)]
["Simcha Yan" (->sum-field-type 101)] ["Simcha Yan" (->sum-type 101)]
["Spiros Teofil" (->sum-field-type 112)] ["Spiros Teofil" (->sum-type 112)]
["Szymon Theutrich" (->sum-field-type 120)]] ["Szymon Theutrich" (->sum-type 120)]]
:columns [(format-name "name") :columns [(format-name "name")
"sum"] "sum"]
:cols [(users-col :name) :cols [(users-col :name)
...@@ -580,10 +580,10 @@ ...@@ -580,10 +580,10 @@
"sum"] "sum"]
:cols [(venue-col :price) :cols [(venue-col :price)
{:base_type (id-field-type), :special_type :id, :name "sum", :id nil, :table_id nil, :description nil}] {:base_type (id-field-type), :special_type :id, :name "sum", :id nil, :table_id nil, :description nil}]
:rows [[1 (->sum-field-type 1211)] :rows [[1 (->sum-type 1211)]
[2 (->sum-field-type 4066)] [2 (->sum-type 4066)]
[3 (->sum-field-type 4681)] [3 (->sum-type 4681)]
[4 (->sum-field-type 5050)]]} [4 (->sum-type 5050)]]}
{:source_table (id :venues) {:source_table (id :venues)
:breakout [(id :venues :price)] :breakout [(id :venues :price)]
:aggregation ["cum_sum" (id :venues :id)]}) :aggregation ["cum_sum" (id :venues :id)]})
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