You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2026/09/03 04:57:24 UTC
[PR] [SPARK-59194] Use numeric Spark version comparison in tests [spark-connect-swift]
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-59194] Use numeric Spark version comparison in tests [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #508: [SPARK-59194] Use numeric Spark version comparison in tests
URL: https://github.com/apache/spark-connect-swift/pull/508
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-59194] Use numeric Spark version comparison in tests [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #508:
URL: https://github.com/apache/spark-connect-swift/pull/508#issuecomment-5520835977
Thank you again, @viirya ~
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-59194] Use numeric Spark version comparison in tests [spark-connect-swift]
Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #508:
URL: https://github.com/apache/spark-connect-swift/pull/508#issuecomment-5520998286
Merged to main
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org