Kotlin / dataframe

Structured data processing in Kotlin
https://kotlin.github.io/dataframe/overview.html
Apache License 2.0
767 stars 48 forks source link

K2 #649

Open mgroth0 opened 3 months ago

mgroth0 commented 3 months ago

Is there any branch or PR working on a K2 update? I started working on this and it seems like a heavy task so I'm wondering if anyone else has started.

koperagen commented 2 months ago

We'll update KSP plugin and it should be enough for library users to use dataframe in their K2 builds as a dependency. As for updating to K2 compiler in our project itself, no one has started working on it yet.

Jolanrensen commented 2 months ago

There's also the Jupyter dependency. Atm Jupyter tests don't run if we compile the integration classes with Kotlin 2.0. I hope this will work once it is not in preview anymore, but I'm not sure.

Edit: From Kotlin 2.0.0-RC1 upwards, in theory, Jupyter tests work :)

Jolanrensen commented 2 months ago

It's important to note that DataFrame will likely work fine as a library in your Kotlin 2.0+ project btw, as Kotlin is inherently backwards compatible.

jsjeon commented 2 months ago

I'd like to point out: https://youtrack.jetbrains.com/issue/KT-65676/K2-type-checking-has-run-into-a-recursive-problem-for-property-with-same-name-as-class-on-classpath#focus=Comments-27-9726934.0-0

Jolanrensen commented 1 month ago

A small fix regarding this was merged here. More fixes are on the way here: https://github.com/Kotlin/dataframe/pull/708

Jolanrensen commented 1 month ago

One final thing that currently stops us to update is our outdated linter: https://github.com/Kotlin/dataframe/issues/364 It officially only supports Kotlin up to 1.4 or something... Well it finally broke at 2.0.

Kantis commented 2 weeks ago

It seems possible to use K2 and Dataframe 0.13 together. Documenting it here in case anyone else is interested in trying it out.

You need to force KSP to a K2 compatible version and apply the KSP gradle plugin yourself.

// in build.gradle.kts
plugins {
   id("org.jetbrains.kotlinx.dataframe") version "0.13.1"
   id("com.google.devtools.ksp") version "2.0.0-1.0.21"
}

// in /settings.gradle.kts
buildscript {
   configurations.all {
      resolutionStrategy {
         force("com.google.devtools.ksp:symbol-processing-api:2.0.0-1.0.21")
         force("com.google.devtools.ksp:symbol-processing-gradle-plugin:2.0.0-1.0.21")
      }
   }
}

Disclaimer: Not sure if this might cause unexpected issues. My builds are passing though.

Jolanrensen commented 2 weeks ago

@Kantis Nice! You could probably even skip the force() with setting kotlin.dataframe.add.ksp=false, like here.