Skip to content

Commit 69b04b5

Browse files
ffissoreedenhill
authored andcommitted
Avoid raising an Exception when parsing a None reader_schema_obj
1 parent 30a514e commit 69b04b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/confluent_kafka/avro/serializer/message_serializer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ def _get_decoder_func(self, schema_id, payload, is_key=False):
177177
# try to use fast avro
178178
try:
179179
fast_avro_writer_schema = parse_schema(json.loads(str(writer_schema_obj)))
180-
fast_avro_reader_schema = parse_schema(json.loads(str(reader_schema_obj)))
180+
if reader_schema_obj is not None:
181+
fast_avro_reader_schema = parse_schema(json.loads(str(reader_schema_obj)))
182+
else:
183+
fast_avro_reader_schema = None
181184
schemaless_reader(payload, fast_avro_writer_schema)
182185

183186
# If we reach this point, this means we have fastavro and it can

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy