dataframe icon indicating copy to clipboard operation
dataframe copied to clipboard

Column `hasNulls` property is actually isNullable

Open Kopilov opened this issue 1 year ago • 13 comments

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

Kopilov avatar Jul 22 '23 09:07 Kopilov