Skip to content

Commit 6c439fa

Browse files
committed
null strings fix
1 parent 96e209f commit 6c439fa

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dataframe-arrow/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/ArrowWriter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ public class ArrowWriter(
184184
private fun convertColumnToTarget(column: AnyCol?, targetFieldType: ArrowType): AnyCol? {
185185
if (column == null) return null
186186
return when (targetFieldType) {
187-
ArrowType.Utf8() -> column.map { it.toString() }
188-
ArrowType.LargeUtf8() -> column.map { it.toString() }
187+
ArrowType.Utf8() -> column.map { it?.toString() }
188+
ArrowType.LargeUtf8() -> column.map { it?.toString() }
189189
ArrowType.Binary(), ArrowType.LargeBinary() -> TODO("Saving var binary is currently not implemented")
190190
ArrowType.Bool() -> column.convertToBoolean()
191191
ArrowType.Int(8, true) -> column.convertToByte()

tests/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies {
2424
}
2525
testImplementation(libs.kotlin.datetimeJvm)
2626
testImplementation(libs.poi)
27+
testImplementation(libs.arrow.vector)
2728
}
2829

2930
kotlin.sourceSets {

0 commit comments

Comments
 (0)