Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with ktor-client #771

Open
koperagen opened this issue Jul 9, 2024 · 0 comments
Open

Integration with ktor-client #771

koperagen opened this issue Jul 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@koperagen
Copy link
Collaborator

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

@koperagen koperagen added the enhancement New feature or request label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant