Missing overloads for `Iterable<ArrayLike>.toDataFrame()`
Jolanrensen opened this issue · 2 comments
Currently, running
listOf(intArrayOf(1, 2, 3), intArrayOf(4, 5, 6)).toDataFrame()
results in:
No accessor found for property val kotlin.IntArray.size: kotlin.Int
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: No accessor found for property val kotlin.IntArray.size: kotlin.Int
This is because toDataFrame()
defaults to toDataFrame { properties() }
, so it tries to dissect the properties of the IntArray
class in this instance.
Instead, I believe this should create a DataFrame<ValueProperty<IntArray>>
, like for the other primitives.
There is a challenge to adding these though. I found adding the overload Iterable<BooleanArray>.toDataFrame()
breaks calls to Iterable<AnyBaseCol>.toDataFrame()
for some reason. And adding them like <B : BooleanArray?> Iterable<B>.toDataFrame()
is impossible, because arrays are illegal supertypes...
Actually, we might be missing overloads for other value-like types as well, like LocalDateTime
, LocalDate
, Duration
, Instant
, Enum
, Temporal
, maybe more
And align the behavior with unfold
: #677