Skip to content

Commit

Permalink
[SPARK-49579][SQL][TESTS][FOLLOWUP] Use condition instead of `error…
Browse files Browse the repository at this point in the history
…Class` in `SparkThrowableSuite` and in `DateTimeFormatterHelperSuite`

### What changes were proposed in this pull request?
In the PR, I propose to use `condition` instead of `errorClass` in two test suites:
- SparkThrowableSuite
- DateTimeFormatterHelperSuite

### Why are the changes needed?
Because the changes from the PR apache#48027 conflict to apache#48058 and apache#48026, and tests in apache#48027 were passed earlier than the last PRs were merged to master.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
By compiling and running the following tests locally:
```
$ build/sbt "test:testOnly *org.apache.spark.sql.catalyst.util.DateTimeFormatterHelperSuite"
$ build/sbt "test:testOnly *SparkThrowableSuite"
```

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes apache#48061 from MaxGekk/fix-missing-errorClass.

Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
  • Loading branch information
MaxGekk authored and attilapiros committed Oct 4, 2024
1 parent 90a2474 commit 58ec9fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ class SparkThrowableSuite extends SparkFunSuite {
"details" -> "implicit cast"
))
},
errorClass = "INTERNAL_ERROR",
condition = "INTERNAL_ERROR",
parameters = Map(
"message" ->
("Found unused message parameters of the error class 'CANNOT_UP_CAST_DATATYPE'. " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class DateTimeFormatterHelperSuite extends SparkFunSuite {
exception = intercept[SparkIllegalArgumentException] {
createBuilderWithVarLengthSecondFraction(pattern)
},
errorClass = "INVALID_DATETIME_PATTERN.SECONDS_FRACTION",
condition = "INVALID_DATETIME_PATTERN.SECONDS_FRACTION",
parameters = Map("pattern" -> pattern))
}
}

0 comments on commit 58ec9fe

Please sign in to comment.