Skip to content

Commit 3037a97

Browse files
committed
small fix for two failing tests in #713, where in implodeImpl a temporary column was created with nulls in a FrameColumn
1 parent cd3747f commit 3037a97

File tree

1 file changed

+8
-2
lines changed
  • core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api

1 file changed

+8
-2
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/api/implode.kt

+8-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ internal fun <T, C> DataFrame<T>.implodeImpl(dropNA: Boolean = false, columns: C
3030
first = false
3131
value
3232
} else {
33-
null
33+
// these rows will not be taken into account,
34+
// but we cannot leave them empty, as `map` creates a full column
35+
when (column.kind()) {
36+
ColumnKind.Value -> emptyList<Any?>()
37+
ColumnKind.Group -> DataFrame.empty()
38+
ColumnKind.Frame -> emptyList<AnyFrame>()
39+
}
3440
}
3541
}
36-
}[0..0]
42+
}[0..0] // takes only the first row
3743
}.concat()

0 commit comments

Comments
 (0)