stevomitric opened a new pull request, #58548:
URL: https://github.com/apache/spark/pull/58548

   
   ### What changes were proposed in this pull request?
   
   Replace the locally-duplicated sub-microsecond truncation helpers 
`floorNanosToPrecision` (in `CastSuiteBase`) and `flooredNano` (in 
`TimestampNanosRenderingSuiteBase`) with the shared production helper 
`SparkDateTimeUtils.truncateNanosWithinMicroToPrecision`, and delete the 
comments that described the duplicated rule. Pure test-only refactor: no 
production code and no assertion values change.
   
   ### Why are the changes needed?
   
   Both suites re-implemented, inline, the same sub-microsecond truncation rule 
that the code under test uses, so the expected values drifted away from a 
single source of truth. Both local copies were also non-exhaustive 
(`MatchError` on a precision outside [7, 9]) whereas the shared helper raises a 
clear internal error.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Existing suites pass unchanged: `CastWithAnsiOnSuite` / 
`CastWithAnsiOffSuite` (270 tests) and `TimestampNanosRenderingAnsiOnSuite` / 
`TimestampNanosRenderingAnsiOffSuite` (10 tests).
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   Co-authored-by: Claude Opus 5
   


-- 
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