marcosschroh / python-schema-registry-client

Python Rest Client to interact against Schema Registry confluent server
https://marcosschroh.github.io/python-schema-registry-client
MIT License
170 stars 55 forks source link

Cannot import MessageSerializer if Faust is not installed v1.9.0 #103

Closed volker48 closed 3 years ago

volker48 commented 3 years ago

Describe the bug If faust is not installed Codec is None and this code linked below attempts to inherit from None, which will not work https://github.com/marcosschroh/python-schema-registry-client/blob/master/schema_registry/serializers/faust_serializer.py#L14.

    from schema_registry.serializers import MessageSerializer
../../.virtualenvs/streaming-deduper/lib/python3.8/site-packages/schema_registry/serializers/__init__.py:4: in <module>
    from schema_registry.serializers.faust_serializer import FaustSerializer  # noqa
../../.virtualenvs/streaming-deduper/lib/python3.8/site-packages/schema_registry/serializers/faust_serializer.py:14: in <module>
    class Serializer(Codec):
E   TypeError: NoneType takes no arguments

To Reproduce Try and import MessageSerializer without having faust installed

Expected behavior Should be able to import MessageSerializer

volker48 commented 3 years ago

I have a PR here that will fix the issue. https://github.com/marcosschroh/python-schema-registry-client/pull/104. Let me know if you would like it fixed in a different way this is the first idea I came up with.