Kotlin / Kotlin/dataframe

Integration with ktor-client

Open
#771 4 comments 0 reactions 1 assignee Assigned to @koperagen View on GitHub
enhancement
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

We should provide a function to get DataFrame from NotebookHttpResponse
I tried to add a compileOnly dependency on ktor-client, declared a function in dataframe-jupyter module. Due to classloading conflicts its work is unstable.
If you execute cell with `%use dataframe` first, then `%use ktor-client`, there's this exception:
```
Line_12.jupyter.kts (1:15 - 18) Cannot access class 'org.jetbrains.kotlinx.jupyter.ktor.client.core.NotebookHttpResponse'. Check your module classpath for missing or conflicting dependencies
```
It happens because `NotebookHttpResponse.bodyAsDataFrame` is loaded with classloader that doesn't know anything about NotebookHttpResponse.
So instead of declaring this function in a library, we can combine afterCellExecution + executeCode to declare it when dataframe is added and ktor-client is already on the classpath or when ktor-client is added to the classpath. This way the function will be executed in a cell with both ktor-client and dataframe classloaders available

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.