krangl
krangl copied to clipboard
Accessors?
Hello,
what about generating accessors?
That's not possible. Kotlin is a statically compiled language. We can not anticipate what columns will be contained in a csv, so it's not possible to create corresponding accessors.
In the jupyter context it's a slightly different situation because there the current state can be used to mess with class definitions at runtime in the next cell.
What about inferring it manually?
Kind of like this (or json):
@DataSchema
interface Person {
val name: String
val age: Int
}
This would need to be bound via a generic type to DataFrame I guess. However, it's not clear to me how this would then provide a better API. Ideas?