@@ -25,7 +25,6 @@ import org.jetbrains.kotlinx.dataframe.api.isColumnGroup
25
25
import org.jetbrains.kotlinx.dataframe.api.isFrameColumn
26
26
import org.jetbrains.kotlinx.dataframe.api.isSubtypeOf
27
27
import org.jetbrains.kotlinx.dataframe.api.map
28
- import org.jetbrains.kotlinx.dataframe.api.parse
29
28
import org.jetbrains.kotlinx.dataframe.api.to
30
29
import org.jetbrains.kotlinx.dataframe.columns.TypeSuggestion
31
30
import org.jetbrains.kotlinx.dataframe.columns.size
@@ -536,23 +535,29 @@ internal fun <T> DataFrame<T>.parseImpl(options: ParserOptions?, columns: Column
536
535
when {
537
536
// when a frame column is requested to be parsed,
538
537
// parse each value/frame column at any depth inside each DataFrame in the frame column
539
- col.isFrameColumn() -> col.map {
540
- it.parseImpl(options) {
541
- colsAtAnyDepth { ! it.isColumnGroup() }
538
+ col.isFrameColumn() -> {
539
+ col.map {
540
+ it.parseImpl(options) {
541
+ colsAtAnyDepth { ! it.isColumnGroup() }
542
+ }
542
543
}
543
544
}
544
545
545
546
// when a column group is requested to be parsed,
546
547
// parse each column in the group
547
- col.isColumnGroup() ->
548
+ col.isColumnGroup() -> {
548
549
col.parseImpl(options) { all() }
549
550
.asColumnGroup(col.name())
550
551
.asDataColumn()
552
+ }
551
553
552
554
// Base case, parse the column if it's a `String?` column
553
- col.isSubtypeOf<String ?>() ->
555
+ col.isSubtypeOf<String ?>() -> {
554
556
col.cast<String ?>().tryParseImpl(options)
557
+ }
555
558
556
- else -> col
559
+ else -> {
560
+ col
561
+ }
557
562
}
558
563
}
0 commit comments