-
Notifications
You must be signed in to change notification settings - Fork 919
Closed
Labels
component:schema-registryAny schema registry related isues rather than kafka isolated onesAny schema registry related isues rather than kafka isolated ones
Description
Similar issue reported in #1939 but for AvroDeserializer...
So when avro deserializer is called without (optional) parameter named ctx
following Attribute Error is raised:
AttributeError: 'NoneType' object has no attribute 'topic'
in here:
def topic_subject_name_strategy(ctx, record_name: Optional[str]) -> Optional[str]:
"""
Constructs a subject name in the form of {topic}-key|value.
Args:
ctx (SerializationContext): Metadata pertaining to the serialization
operation.
record_name (Optional[str]): Record name.
"""
> return ctx.topic + "-" + ctx.field
E AttributeError: 'NoneType' object has no attribute 'topic'
Steps to reproduce:
schema_registry_client = SchemaRegistryClient(...)
local_schema = '''
{
"type": "record",
"name": "FooRecord",
"namespace": "com.confluent_kafka.issue",
"fields": [
{
"name": "foo",
"type": ["string"]
}
]
}
'''
deserializer = AvroDeserializer(schema_registry_client, local_schema)
msg = deserializer(b'\x00\x00\x00\x10\x00\bar')
Metadata
Metadata
Assignees
Labels
component:schema-registryAny schema registry related isues rather than kafka isolated onesAny schema registry related isues rather than kafka isolated ones