JetBrains / JetBrains/lets-plot-kotlin

error when depending on a library that includes latest version of `kotlinx.datetime`

Open
#303 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
486
Forks
39
PR merge metrics
No merged PRs in 30d

Description

Sample Notebook that exposes the bug is at the bottom of this description.

If I use `lets-plot` in a Kotlin Notebook and the notebook depends on a library that pulls in the latest `kotlinx.datetime`, I get

```
java.lang.NoSuchMethodError: 'kotlinx.datetime.LocalDateTime kotlinx.datetime.TimeZoneKt.toLocalDateTime(kotlinx.datetime.Instant, kotlinx.datetime.TimeZone)'
at org.jetbrains.letsPlot.commons.intern.datetime.Instant.toDateTime(Instant.kt:28)
at org.jetbrains.letsPlot.commons.formatting.datetime.DateTimeFormatUtil.format(DateTimeFormatUtil.kt:37)
```

even if I'm using `java.time.Instant` in my data. (See notebook details at the bottom.)

This Kotlin Notebook works fine if it does depend on the library with the latest `kotlinx.datetime`.

`lets-plot` currently uses `kotlinx.datetime` at 0.6.2.

There are incompatibilities between this and the latest version of `kotlinx.datetime` (currently 0.7.1).

This ticket is to upgrade `lets-plot` to the latest version of `kotlinx.datetime`.

Sample Notebook:

```
%use dataframe
%use lets-plot
---
import java.math.BigDecimal

val simple = dataFrameOf("a", "b")(java.time.Instant.parse("2026-04-05T00:00:00Z"), BigDecimal.valueOf(2.0))
simple.schema()
---
a: java.time.Instant
b: java.math.BigDecimal
---
letsPlot(simple.toMap()) { x = "a"; y = "b" } + geomLine()
```

The above Notebook works fine unless it depends on a library that pulls in the latest version of `kotlinx.datetime`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.