Skip to content

Commit

Permalink
fix: when headers() returns None in AsyncConfluentParser, replace it …
Browse files Browse the repository at this point in the history
…with an empty tuple (#1460)
  • Loading branch information
andreaimprovised authored May 21, 2024
1 parent 13e46e9 commit 2d224ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions faststream/confluent/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def parse_message(
message: "Message",
) -> "StreamMessage[Message]":
"""Parses a Kafka message."""
headers = _parse_msg_headers(message.headers())
headers = _parse_msg_headers(message.headers() or ())

body = message.value()
offset = message.offset()
Expand Down Expand Up @@ -53,7 +53,7 @@ async def parse_message_batch(

for m in message:
body.append(m.value())
batch_headers.append(_parse_msg_headers(m.headers()))
batch_headers.append(_parse_msg_headers(m.headers() or ()))

headers = next(iter(batch_headers), {})

Expand Down

0 comments on commit 2d224ee

Please sign in to comment.