dataframe
dataframe copied to clipboard
Column `hasNulls` property is actually isNullable
Hello
If I get some dataframe with some column and I want to check if it contains null values, I use hasNulls
property.
val nullable = DataColumn.create("nullable", listOf("a" as String?, "b" as String?, "c" as String?))
println(nullable.hasNulls)
expected: false actual: true
From another side, column can be marked as not nullable but contain null values (this behavior might be a critical issue itself)
val notNullable = DataColumn.create(
"notNullable",
listOf("a" as String?, "b" as String?, "c" as String?, null as String?),
typeOf<String>().withNullability(false)
)
println(notNullable.hasNulls)
expected: true or IllegalArgumentException actual: false