HyukjinKwon opened a new pull request, #909:
URL: https://github.com/apache/spark-connect-rust/pull/909

   ### What changes were proposed in this pull request?
   
   A follow-up of SPARK-62128 (#906):
   - The `-bin` values of the metadata of a response decode as gRPC core 
decodes them: of the standard alphabet, every trailing `=` dropped, whole 
groups of four, and a last group of two or three characters only if its unused 
bits are zero, so `YWJj=` is `abc`, as in grpcio. A value is rewritten to the 
standard encoding of those bytes before tonic reads it.
   - A `grpc-status-details-bin` that does not decode fails the call `INTERNAL` 
"Stream removed (Error parsing 'grpc-status-details-bin' metadata: illegal 
base64 encoding)" and passes the details on, empty, as gRPC core does, so 
PySpark's `rpc_status.from_call` raises "Code in Status proto (StatusCode.OK) 
doesn't match status code (StatusCode.INTERNAL)" whatever the code of the 
server. #906 kept the server's code and message there.
   - Empty details (``, `=`, `==`) keep the server's status, of the details 
present and empty, as grpcio passes them on.
   
   ### Why are the changes needed?
   
   To close these differences from grpcio, which pyspark-client 4.3.0 uses (the 
review of SPARK-62128). Only a broken server sends such values.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, as above.
   
   ### How was this patch tested?
   
   - New tests in the core crate (gRPC core's decoding of 28 values, and the 
failures, markers and rewrites) and in `python/tests/test_dropin_offline.py` 
against a raw HTTP/2 server, which fail without the change.
   - Probes of both clients against that server: 81 cases of details and other 
`-bin` values, trailers-only and after headers, unary and stream, of identical 
output.
   - The core tests (release and debug), clippy, rustdoc, and the offline suite 
under coverage.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code
   
   This pull request and its description were written by Isaac.
   


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