Kotlin / Kotlin/dataframe

Aggregating an empty DF does not make aggregation columns appear

Open
#1,531 5 comments 0 reactions 1 assignee Claimed by @koperagen View on GitHub
bug Compiler plugin
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

Let's say we have

```kt
val df = dataFrameOf("a")("a")
val counted = df.drop(1).groupBy { a }.count()
```
or
```kt
val counted = df.drop(1).groupBy { a }.aggregate { count() into "count" }
```

In this case `counted` does not obtain the column `count`, it just has the empty column `a`.

This is an issue, because the compiler plugin cannot tell a dataframe is empty, so it will happily suggest `.count` and cause runtime exceptions:

Image

We should at least get an empty `Int` column `count` in this case.

Thanks for the find @Allex-Nik!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.