Is there a way to get the dataframe compiler plugi...
# datascience
y
Is there a way to get the dataframe compiler plugin inside notebooks? As far as I remember, dataframe had this technical limitation where you need multiple cells for new properties and such to be available (because it's using some notebook hook to generate classes in-between cells), but the compiler plugin doesn't suffer from that
a
Those are different things. DataFrame notebook staged compilation uses not the compile-time data, but runtime data. The main feature is that it takes a table in runtime and creates type-safe accessors for its columns like gradle.kts does. It is not possible to do that with compiler plugin because those accessors are specific for a table that is available only in runtime.
y
sure, but when I e.g. add a column in notebook, as far as I remember, I can't use the accessors in the same cell. Using the compiler plugin in a normal project, I can, so I was wondering if I can turn on the plugin inside the notebook
a
You can turn on plugins inside the notebook or any other scripting by using -Xplugin flag like it is mentioned here: https://youtrack.jetbrains.com/issue/KT-47384
thank you color 1
j
@altavir is correct 🙂 You need to jump through some hoops to enable compiler plugins in notebooks. This is highly experimental and untested territory, so it might not work as expected. We're currently focusing on making the compiler plugin work best inside Kotlin projects (and the debugger) as those files benefits the most from it.
Do let us know if you get it to work! I'm curious too