Skip to content

Commit

Permalink
[SPARK-48578][SQL][FOLLOWUP] Fix dev/scalastyle error for `Expressi…
Browse files Browse the repository at this point in the history
…onImplUtilsSuite`

### What changes were proposed in this pull request?
The pr is following up apache#46845, to fix ` dev/scalastyle` check error.

### Why are the changes needed?
Make `sh dev/scalastyle` happy.

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

### How was this patch tested?
Manually test
```
sh dev/scakastyle
```

Before:
```
(base) ➜  spark-community git:(master) ✗ sh dev/scalastyle
-e Scalastyle checks failed at following occurrences:
[error] /Users/panbingkun/Developer/spark/spark-community/sql/catalyst/src/test/java/org/apache/spark/sql/catalyst/expressions/ExpressionImplUtilsSuite.scala:394:28: nonascii.message
[error] /Users/panbingkun/Developer/spark/spark-community/sql/catalyst/src/test/java/org/apache/spark/sql/catalyst/expressions/ExpressionImplUtilsSuite.scala:396:28: nonascii.message
[error] Total time: 23 s, completed Jun 26, 2024, 9:49:06 AM

```

After:
```
(base) ➜  spark-community git:(fix_scalastyle) ✗ sh dev/scalastyle
-e Scalastyle checks passed.
```

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

Closes apache#47094 from panbingkun/fix_scalastyle.

Authored-by: panbingkun <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
  • Loading branch information
panbingkun authored and cloud-fan committed Jun 26, 2024
1 parent c459afb commit 169346c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,12 @@ class ExpressionImplUtilsSuite extends SparkFunSuite {
UTF8String.fromString("A"), except = false)
validateUTF8(UTF8String.fromBytes(Array[Byte](0x61)),
UTF8String.fromString("a"), except = false)
// scalastyle:off nonascii
validateUTF8(UTF8String.fromBytes(Array[Byte](0x80.toByte)),
UTF8String.fromString("\uFFFD"), except = true)
validateUTF8(UTF8String.fromBytes(Array[Byte](0xFF.toByte)),
UTF8String.fromString("\uFFFD"), except = true)
// scalastyle:on nonascii
}

test("TryValidate UTF8 string") {
Expand Down

0 comments on commit 169346c

Please sign in to comment.