Skip to content

Commit d4500f2

Browse files
fix using strings in numeric field
1 parent 4fb9d0b commit d4500f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/scala/za/co/absa/standardization/TypeParserSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class TypeParserSuite extends AnyFunSuite with SparkTestBase {
3636

3737

3838
private val testData: DataFrame = spark.createDataFrame(Seq(
39-
(1,42.0,"2025-08-05","2025-08-05 12:34:56","250805"),
40-
(2,-42.0,"-INF","-INF","-INF"),
41-
(3,42.0,"INF","INF","INF")
39+
("1",42.0,"2025-08-05","2025-08-05 12:34:56","250805"),
40+
("2","-INF","-INF","-INF","-INF"),
41+
("3","INF","INF","INF","INF")
4242
)).toDF("id","numeric_double","date","timestamp","custom_date")
4343

4444
test("Test TypeParser infinity handling for date and timestamp"){
@@ -74,7 +74,7 @@ class TypeParserSuite extends AnyFunSuite with SparkTestBase {
7474
assert(results(2).getDate(2) == Date.valueOf("9999-12-31"))
7575
assert(results(2).getTimestamp(3) == Timestamp.valueOf("9999-12-31 23:59:59"))
7676
assert(results(2).getDate(4) == Date.valueOf("9999-12-31"))
77-
assert(results(1).getAs[Seq[ErrorMessage]](5).isEmpty)
77+
assert(results(2).getAs[Seq[ErrorMessage]](5).isEmpty)
7878

7979
}
8080
}

0 commit comments

Comments
 (0)