krangl icon indicating copy to clipboard operation
krangl copied to clipboard

Accessors?

Open elect86 opened this issue 4 years ago • 3 comments

Hello,

what about generating accessors?

elect86 avatar Sep 10 '21 13:09 elect86

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.

holgerbrandl avatar Sep 10 '21 19:09 holgerbrandl

What about inferring it manually?

Kind of like this (or json):

@DataSchema
interface Person {
    val name: String
    val age: Int 
}

elect86 avatar Sep 11 '21 06:09 elect86

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?

holgerbrandl avatar Oct 23 '21 09:10 holgerbrandl