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 have found, that if I use summarize on a table without any rows, an IllegalArgumentException will be thrown in tech.tablesaw.table.TableSliceGroup.aggregate(ListMultimap<String, AggregateFunction<?, ?>> functions)
I understand that something might break in the function if this check is not performed, but it seems odd to me that the function doesn't just return another empty table. Rather than throwing an error, why not have a check somewhere else that short-circuits the aggregation to always return 0 rows?
If this project is aiming for consistency with pandas for example, then the corresponding behavior would be:
Changing behaviour in this way should be backward compatible since users atm. is already checking for, and handling table.rowCount() == 0 before summarizing.
I would not expect anyone to depend on summarize() throwing an exception.
If there is support for such a change, I will write a PR.
The text was updated successfully, but these errors were encountered:
I'm not as familiar with the summarization and aggregation as @lwhite1 and @ryancerf, but returning an empty table probably makes more sense to me than throwing an exception, so I'd be open to a PR to change it. It's not a goal of ours to match what Pandas does exactly, but I don't mind taking some inspiration from them and doing what they do when it makes sense.
Dear Maintainers
I have found, that if I use summarize on a table without any rows, an
IllegalArgumentException
will be thrown intech.tablesaw.table.TableSliceGroup.aggregate(ListMultimap<String, AggregateFunction<?, ?>> functions)
I understand that something might break in the function if this check is not performed, but it seems odd to me that the function doesn't just return another empty table. Rather than throwing an error, why not have a check somewhere else that short-circuits the aggregation to always return 0 rows?
If this project is aiming for consistency with pandas for example, then the corresponding behavior would be:
This may need to be per-aggregation type since pandas will raise en exception in certain cases:
Changing behaviour in this way should be backward compatible since users atm. is already checking for, and handling
table.rowCount() == 0
before summarizing.I would not expect anyone to depend on
summarize()
throwing an exception.If there is support for such a change, I will write a PR.
The text was updated successfully, but these errors were encountered: