Kotlin / dataframe

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

Jupyter integration conflicts with variable type converters from other integrations. #640

Closed ark-1 closed 2 months ago

ark-1 commented 3 months ago

Steps to reproduce

Cell 1:

notebook.fieldsHandlersProcessor.register(
    // replacing all byte array variables with lists
    extension = FieldHandlerFactory.createUpdateHandler<ByteArray>(TypeDetection.COMPILE_TIME) { _, prop ->
        execute("${prop.name}.toList()").name
    },
)

Cell 2:

%use dataframe
val x = ByteArray(1)

Cell 3:

x.javaClass

Expected output:

class java.util.Collections$SingletonList (that means that the byte array was transformed into a list as we asked it to in the fieldsHandlersProcessor). You can also get this output by commenting out %use dataframe, restarting the kernel and rerunning the notebook.

Actual output:

class [B (the byte array stayed byte array).

Jolanrensen commented 3 months ago

probably related to https://github.com/Kotlin/dataframe/pull/401