Skip to content

Commit c389948

Browse files
committed
add comment
1 parent 6d70859 commit c389948

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/system/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ def __init__(self, key, value):
311311

312312
def _add_request_metadata(self, client_call_details):
313313
if client_call_details.metadata is not None:
314+
# https://grpc.github.io/grpc/python/glossary.html#term-metadata.
315+
# For sync, `ClientCallDetails.metadata` is a list.
316+
# Whereas for async, `ClientCallDetails.metadata` is a mapping.
317+
# https://grpc.github.io/grpc/python/grpc_asyncio.html#grpc.aio.Metadata
314318
client_call_details.metadata.append((self._key, self._value))
315319
self.request_metadata = client_call_details.metadata
316320

@@ -362,6 +366,10 @@ def __init__(self, key, value):
362366

363367
async def _add_request_metadata(self, client_call_details):
364368
if client_call_details.metadata is not None:
369+
# https://grpc.github.io/grpc/python/grpc_asyncio.html#grpc.aio.Metadata
370+
# Note that for async, `ClientCallDetails.metadata` is a mapping.
371+
# Whereas for sync, `ClientCallDetails.metadata` is a list.
372+
# https://grpc.github.io/grpc/python/glossary.html#term-metadata.
365373
client_call_details.metadata[self._key] = self._value
366374
self.request_metadata = list(client_call_details.metadata)
367375

0 commit comments

Comments
 (0)