Repro:
val l = (0..10).toDataFrame {
"id" from { it }
}
val r = (0..5).toDataFrame {
"id" from { it }
"frame" from {
(0..10).toDataFrame {
"col" from { it }
}
}
}
val res = l.leftJoin(r)
res.print()
Actual:
Throws exception at print.
Exception in thread "main" java.lang.NullPointerException: Parameter specified as non-null is null: method org.jetbrains.kotlinx.dataframe.DataFrameKt.getNrow, parameter <this>
at org.jetbrains.kotlinx.dataframe.DataFrameKt.getNrow(DataFrame.kt)
Culprit is this unchecked cast that sneaks AnyFrame? values into FrameColumn (we expect no nulls there):
|
ColumnKind.Frame -> DataColumn.createFrameColumn(srcColumn.name, columnValues.asList() as List<AnyFrame>) |
Expected:
At this point i'd expected frame column to have 5 DataFrames from r, and remaining 5 rows filled with empty dataframes with same schema: col: Int, but 0 rows
In that ColumnKind.Frame branch we should replace all nulls with "null object" dataframe:
|
public fun empty(schema: DataFrameSchema): AnyFrame = schema.createEmptyDataFrame() |
Repro:
Actual:
Throws exception at
print.Culprit is this unchecked cast that sneaks AnyFrame? values into FrameColumn (we expect no nulls there):
dataframe/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/join.kt
Line 235 in 1232fd1
Expected:
At this point i'd expected
framecolumn to have 5 DataFrames fromr, and remaining 5 rows filled with empty dataframes with same schema:col: Int, but 0 rowsIn that ColumnKind.Frame branch we should replace all nulls with "null object" dataframe:
dataframe/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/DataFrame.kt
Line 61 in 06990d0