anupamme commented on code in PR #57778:
URL: https://github.com/apache/spark/pull/57778#discussion_r3719715606
##########
python/pyspark/sql/connect/client/reattach.py:
##########
@@ -109,7 +109,9 @@ def __init__(
# Initial iterator comes from ExecutePlan request.
# Note: This is not retried, because no error would ever be thrown
here, and GRPC will only
# throw error on first self._has_next().
- self._metadata = metadata
+ # Convert metadata to a list to ensure it remains re-iterable across
all RPCs
+ # (ReattachExecute, ReleaseExecute), so auth headers are always
present.
+ self._metadata = list(metadata)
Review Comment:
Two changes done:
1. reattach.py line 119: metadata=metadata → metadata=self._metadata — the
initial ExecutePlan now uses the already-materialised list, so all RPCs are
consistent regardless of what iterable the caller passes.
2. test_client.py: Extended the generator test to also assert
execute_metadata[0] contains the expected header, so a regression back to
metadata=metadata would be caught.
--
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]