dongjoon-hyun opened a new pull request, #508:
URL: https://github.com/apache/spark-connect-swift/pull/508

   ### What changes were proposed in this pull request?
   
   This PR replaces the lexicographic `String` comparisons in the test version 
gates with a numeric one.
   
   - Adds `isSparkVersionAtLeast(_:_:)` in a new 
`Tests/SparkConnectTests/SparkVersionUtils.swift`, covered by 
`SparkVersionUtilsTests`.
   - Migrates all 60 version gates across 12 test files to it.
   - Turns the prefix checks left over from SPARK-59177 into lower bounds: 
`starts(with: "4.")` becomes a `4.0` bound, and `starts(with: "4.1")` in 
`ConstraintTests` a `4.1` bound.
   
   ### Why are the changes needed?
   
   `String` comparison is lexicographic, so the gates break from Apache Spark 
4.10 on:
   
   ```swift
   "4.10" >= "4.2"              // false
   "4.10".starts(with: "4.1")   // true, for a 4.1-only gate
   ```
   
   Every `>= "4.2"` gate would silently skip its body on a 4.10 server, and the 
4.1 gates in `ConstraintTests` would incorrectly run. The lower-bound style 
from SPARK-59177 is right, but it only holds if the comparison is numeric. The 
remaining prefix checks match the 4.x line only, so they would also skip on 
Spark 5; each guards a feature available since Apache Spark 4.0.
   
   `SparkSessionTests.version()` keeps its `starts(with: "4.")`, which asserts 
the server is in the supported 4.x range rather than gating a test.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This is a test-only change.
   
   ### How was this patch tested?
   
   Pass the CIs.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-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