Open koperagen opened 1 month ago
Even bigger problem is that on older kernels %use dataframe(0.14.0)
will resolve only "dataframe", without jupyter integration.
So https://github.com/Kotlin/dataframe/pull/776.
And these should be re-open
https://github.com/Kotlin/dataframe/issues/241
https://github.com/Kotlin/dataframe/issues/700
Even bigger problem is that on older kernels
%use dataframe(0.14.0)
will resolve only "dataframe", without jupyter integration.
There can be a migration period when both core module and dataframe-jupyter apply the same integration (just making sure to do it once)
We could also tweak the .json descriptor file such that it resolves a different set of dependencies depending on the version.
https://github.com/Kotlin/kotlin-jupyter/blob/master/docs/libraries.md#descriptor-api-3
It's not the neatest, but in theory it could make sure the dataframe-jupyter dependency is added only when the version of dataframe is 0.14.0+. Something like:
{
"init": [
"if ($v >= 0.14.0) USE { dependencies(\"...dataframe-jupyter:$v\") }"
]
}
(not sure if we can get the $v, but there's probably a way)
Alternatively, we could just prompt users to update their kernel versions with: https://github.com/Kotlin/kotlin-jupyter/blob/master/docs/libraries.md#minimal-kernel-version-supported-by-the-library
@ileasile What do you think is the wisest solution?
Nice! Adding something like this works and could actually solve the issue I think :)
"init": [
"val (major, minor, patch) = \"$v\".split('.').map { it.filter { it.isDigit() }.toInt() }",
"if (minor >= 14) { USE { dependencies(\"org.jetbrains.kotlinx:dataframe-jupyter:$v\") }; println(\"adding jupyter!\") } else { println(\"not adding jupyter!\") }"
],
"dependencies": [
"org.jetbrains.kotlinx:dataframe:$v"
],
By default, the dataframe module is added as dependency, this is fine. However, we can make it so that for version X or higher, it automatically pulls the dataframe-jupyter module as well :)
@koperagen what was the friend module for btw? It seems to work fine if :dataframe-jupyter just depends on :core
New dataframe-jupyter module should be added here in dependencies https://github.com/Kotlin/kotlin-jupyter-libraries/blob/master/dataframe.json However, after kernel is updated in the Kotlin Notebook to use this descriptor (for example in 2024.2)![image](https://github.com/Kotlin/dataframe/assets/12936457/753de517-a2c2-4c8f-9e66-2460fe7adbec)
%use dataframe(0.13.1)
will produce an errorSo we either need to
version=
in gradle.properties. Then execute publishDataframe-jupyterPublicationToMavenRepository on teamcity