Skip to content

Commit

Permalink
Return empty collection for empty TS query.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Bakken committed Jan 13, 2016
1 parent 5767ee8 commit 53dc97f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/riak/client/beefcake/time_series_query_operator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ def query(base, interpolations = { })
p.expect :TsQueryResp, TsQueryResp, empty_body_acceptable: true
end

return nil if :empty == result
return [] if :empty == result

codec = TsCellCodec.new

return [] if :empty == result

collection = Riak::TimeSeries::Collection.
new(result.rows.map do |row|
Riak::TimeSeries::Row.new codec.scalars_for row.cells
Expand Down
3 changes: 2 additions & 1 deletion spec/integration/riak/time_series_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
#{now_range_str}
SQL
end
let(:no_data_query) do

let(:no_data_query) do
<<-SQL
SELECT * FROM #{table_name}
WHERE
Expand Down

0 comments on commit 53dc97f

Please sign in to comment.