uros-b opened a new pull request, #57890:
URL: https://github.com/apache/spark/pull/57890

   ### What changes were proposed in this pull request?
   
   Adds `SparkStringUtilsSuite`, covering `isBlank`/`isNotBlank`, `leftPad`, 
both `rightPad` overloads, both `abbreviate` overloads, `strip`, and 
`stringToSeq`.
   
   ### Why are the changes needed?
   
   `SparkStringUtils` currently has no test suite, while the sibling utilities 
in the same module (`SparkErrorUtilsSuite`, `SparkFileUtilsSuite`, 
`VersionUtilsSuite`, ...) each have one. The helpers are not incidental: 
`leftPad`/`rightPad` format the column output of `Dataset.show`, and 
`abbreviate` is used to build Kubernetes application-name labels. The methods 
arrived across a series of changes that replaced Apache Commons and Guava 
equivalents, and none of those added direct tests.
   
   The three-argument `rightPad(str, width, padStr)` holds the most error-prone 
arithmetic in the file (pad repetition plus truncation of the final repetition) 
and currently has no caller, so it had no coverage of any kind.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Tests only.
   
   ### How was this patch tested?
   
   This is the test. Every expected value was derived by executing the current 
implementations rather than computed by hand, including the pad-truncation 
cases (`rightPad("a", 4, "xy")` is `"axyx"`) and the null pass-through paths. 
The suite was run locally: 6 tests, 27 assertions, all passing.
   
   The suite extends `AnyFunSuite` with the `scalastyle:ignore funsuite` 
marker, matching every sibling suite in this module; `common/utils` does not 
depend on `spark-core`, so `SparkFunSuite` is not available here.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to