Kotlin / Kotlin/dataframe

Exception in documentation example of `maxByOrNull`

Open
#1,403 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

In [Operations/Access/Get Rows](https://kotlin.github.io/dataframe/getrow.html) we have:

```
df.maxByOrNull { weight }
```

Executing this in a Kotlin Notebook cell results in: `Type mismatch: inferred type is Int? but Int was expected`

Gradle settings:

```
plugins {
kotlin("jvm") version "2.2.20-Beta1"
kotlin("plugin.dataframe") version "2.2.20-Beta1"
}

dependencies {
implementation("org.jetbrains.kotlinx:dataframe:1.0.0-Beta2")
testImplementation(kotlin("test"))
}
```

Contributor guide

Open the contributing guide

Research direction

Open the Operations/Access/Get Rows page linked in the issue and reproduce the maxByOrNull example in a Kotlin Notebook using the provided Gradle settings. Update the documentation example so it executes without the reported type mismatch, then rerun the example to verify it.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.