File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,17 @@ module Mondrian::REST::Formatters
11
11
# Generate 'tidy data' (http://vita.had.co.nz/papers/tidy-data.pdf)
12
12
# from a result set.
13
13
def self . tidy ( result , options )
14
+
14
15
cube = result . cube
15
16
16
17
add_parents = options [ :add_parents ]
17
18
properties = options [ :properties ]
18
19
rs = result . to_h ( add_parents , options [ :debug ] )
20
+
21
+ if rs [ :values ] . empty?
22
+ return [ ]
23
+ end
24
+
19
25
measures = rs [ :axes ] . first [ :members ]
20
26
dimensions = rs [ :axis_dimensions ] [ 1 ..-1 ]
21
27
columns = [ ]
Original file line number Diff line number Diff line change @@ -297,8 +297,14 @@ def app
297
297
298
298
expect ( JSON . parse ( last_response . body ) [ 'values' ] . size ) . to eql ( 0 )
299
299
300
- end
300
+ get '/cubes/Warehouse/aggregate.jsonrecords?drilldown[]=[Store+Type].[Store+Type]&cut[]=[Store].[Store].[Store+Country].%26[Mexico]&measures[]=Store+Invoice&nonempty=true&distinct=false&parents=false&debug=true'
301
+
302
+ expect ( JSON . parse ( last_response . body ) ) . to eql ( { "data" => [ ] } )
301
303
304
+ get '/cubes/Warehouse/aggregate.csv?drilldown[]=[Store+Type].[Store+Type]&cut[]=[Store].[Store].[Store+Country].%26[Mexico]&measures[]=Store+Invoice&nonempty=true&distinct=false&parents=false&debug=true'
305
+
306
+ expect ( last_response . body ) . to eql ( "" )
307
+ end
302
308
end
303
309
end
304
310
You can’t perform that action at this time.
0 commit comments