liebke/incanter — pull request #143 by farrellm (2013-05-15 04:57:35+00:00)
Title: in sel for dataset, return a dataset unless :rows is numeric

There are two different ways to select 1 row from a dataset:

(def d (dataset [:a :b :c] [[1 2 3][4 5 6][7 8 9]]))
(sel d :rows 1) ; (a)
(sel d :rows [1]) ; (b)
(sel d :rows [1 2]) ; (c)

As expected, case (a) returns a list of just the elements in row 1. However, unexpectedly, case (b) is equivalent and also returns a list of the elements in row 1.

The expected behivior is for (b) to behave more like case (c) and return a dataset. In particular, (b) should return a dataset with 1 row.

The same problematic behavior is seen when selecting :all rows from a dataset with only 1 row.