From 815baa91062cbb1b96fa172db811bbef638c9b14 Mon Sep 17 00:00:00 2001 From: Jayson Reis Date: Mon, 5 Dec 2022 17:04:53 +0100 Subject: [PATCH] fix: make sure that the fallback avro class has the signature as fastravro's This makes sure that the user get the information about avro support not being installed instead of a TypeError if the schema defitnition is not supplied --- pulsar/schema/schema_avro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulsar/schema/schema_avro.py b/pulsar/schema/schema_avro.py index 05ceb8e2..3e629fb2 100644 --- a/pulsar/schema/schema_avro.py +++ b/pulsar/schema/schema_avro.py @@ -85,7 +85,7 @@ def decode(self, data): else: class AvroSchema(Schema): - def __init__(self, _record_cls, _schema_definition): + def __init__(self, _record_cls, _schema_definition=None): raise Exception("Avro library support was not found. Make sure to install Pulsar client " + "with Avro support: pip3 install 'pulsar-client[avro]'")