scicloj / tablecloth

Dataset manipulation library built on the top of tech.ml.dataset
https://scicloj.github.io/tablecloth
MIT License
290 stars 25 forks source link

empty dataset throws exception on fold-by #8

Closed pdmct closed 3 years ago

pdmct commented 3 years ago

Tablecloth 4.04.1

Exception is thrown by fold-by if dataset has no rows.

It should just return the original empty dataset.

tablecloth> DS
_unnamed [3 2]:

| :a | :b |
|----|----|
|  1 | :a |
|  2 | :b |
|  9 | :c |
tablecloth> (api/select-rows DS (comp #(< % 1) :a))
_unnamed [0 2]:

| :a | :b |
|----|----|
tablecloth> (api/fold-by (api/select-rows DS (comp #(< % 1) :a)) :a)
Execution error (ArityException) at tablecloth.api.group-by/ungroup (group_by.clj:203).
Wrong number of args (0) passed to: tech.ml.dataset.base/concat
genmeblog commented 3 years ago

confirmed, fixing

genmeblog commented 3 years ago

fixed in 4.04.2 and 5.0-SNAPSHOT