scicloj/tablecloth

reorder-columns on empty dataset returns nil

Closed this issue · 3 comments

It feels wrong. An empty dataset is "a dataset", so no operation on it should return nil,
I believe.

(tc/reorder-columns (tc/dataset {}) [:what-ever])
-> nil

reorder-columns relies on tech.v3.dataset/select-columns. Seems that TMD returns nil in this case. I need to check it and when it's true I'll fill an issue in TMD.

Confirmed:

(ds/select-columns (ds/->dataset {}) [])
;; => nil

btw. if you want an empty dataset with TC just call (tc/dataset)