You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that all column selectors (other than arrays) should guarantee that the column order in the original table is preserved. One would certainly expect that to be the case for Between, though it's not explicitly mentioned in the docstring. It would be a bummer if you had foo(x, y) = 2x .+ y but Between(:x, :y) => foo happened to lower to [:y, :x] => foo instead of [:x, :y] => foo.
And I think it makes sense to guarantee column order preservation for the other selectors. E.g.
What you propose is exactly how it is implemented in DataFrames.jl
Agreed, that is how it is currently implemented in DataFrames.jl. I just thought it might be a good idea to make the order guarantee explicit in DataAPI.jl.
I think that all column selectors (other than arrays) should guarantee that the column order in the original table is preserved. One would certainly expect that to be the case for
Between
, though it's not explicitly mentioned in the docstring. It would be a bummer if you hadfoo(x, y) = 2x .+ y
butBetween(:x, :y) => foo
happened to lower to[:y, :x] => foo
instead of[:x, :y] => foo
.And I think it makes sense to guarantee column order preservation for the other selectors. E.g.
should be guaranteed to lower to
rather than
I'm not totally certain the best way to specify the column ordering properties of
Cols
, but I think this specification makes sense:Cols
are first lowered to (ordered) arrays.Cols
is then lowered as follows:Cols(A, B, C) ==> [A, B\A, C\(A ∪ B)]
(where the arguments on the right side are splatted into the array).Since
setdiff
on arrays preserves the order of the first argument tosetdiff
, we get the following behavior:The text was updated successfully, but these errors were encountered: