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

   ### What changes were proposed in this pull request?
   
   This PR aims to fix `SparkConnectClient.getConf`, `getConfWithDefault`, 
`getConfOption` and `isModifiable` to not crash when the server returns a 
`ConfigResponse` with no pairs.
   
   - `getConf` throws `SparkConnectError.sqlConfNotFound`.
   - `getConfWithDefault` returns the given default value.
   - `getConfOption` returns `nil`.
   - `isModifiable` returns `false`.
   
   ### Why are the changes needed?
   
   These methods read `response.pairs[0]` without a bounds check, so an empty 
response traps with an index-out-of-range error and crashes the client process.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, it fixes a bug. An empty `ConfigResponse` used to crash the process. 
Now it is handled as described above.
   
   ### How was this patch tested?
   
   Pass the CIs with the newly added test case 
(`SparkConnectClientTests.getConfValue`). The other three methods are not 
covered because an empty server response cannot be simulated without a mock 
server.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Sonnet 5.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