Skip to content

Commit ff833c1

Browse files
committed
json numbers will never be parsed as float if doubleOrNull is checked first...
1 parent a5991a4 commit ff833c1

File tree

1 file changed

+4
-4
lines changed
  • core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/io

1 file changed

+4
-4
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/io/readJson.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ internal fun fromJsonListAnyColumns(
229229

230230
v.longOrNull != null -> collector.add(v.long)
231231

232-
v.doubleOrNull != null -> collector.add(v.double)
233-
234232
v.floatOrNull != null -> collector.add(v.float)
235233

234+
v.doubleOrNull != null -> collector.add(v.double)
235+
236236
else -> error("Malformed JSON element ${v::class}: $v")
237237
}
238238
}
@@ -578,10 +578,10 @@ internal fun fromJsonListArrayAndValueColumns(
578578

579579
v.longOrNull != null -> collector.add(v.long)
580580

581-
v.doubleOrNull != null -> collector.add(v.double)
582-
583581
v.floatOrNull != null -> collector.add(v.float)
584582

583+
v.doubleOrNull != null -> collector.add(v.double)
584+
585585
else -> error("Malformed JSON element ${v::class}: $v")
586586
}
587587
}

0 commit comments

Comments
 (0)