Skip to content

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions