-
Notifications
You must be signed in to change notification settings - Fork 935
Closed
Labels
component:schema-registryAny schema registry related isues rather than kafka isolated onesAny schema registry related isues rather than kafka isolated ones
Description
The migration from the "deprecated format" happened a few years ago. I don't think it's necessary to force user to explicitly add {"use.deprecated.format": False}
in their config.
Currently it's impossible to create a ProtobufSerializer / ProtobufDeserializer without specifying this property.
Maybe the check should be run after the given config is merged into the default config (which specify the flag), see
Steps to reproduce:
import pytest
from confluent_kafka.schema_registry.protobuf import (
ProtobufDeserializer,
ProtobufSerializer,
)
from google.protobuf.wrappers_pb2 import DoubleValue
def test_deprecated():
ProtobufDeserializer(DoubleValue, {"use.deprecated.format": False})
with pytest.raises(
RuntimeError,
match="the 'use.deprecated.format' configuration property must be explicitly"
" set due to backward incompatibility with older confluent-kafka-python"
" Protobuf producers and consumers."
" See the release notes for more details",
):
ProtobufDeserializer(DoubleValue, {})
with pytest.raises(
RuntimeError,
match="the 'use.deprecated.format' configuration property must be explicitly"
" set due to backward incompatibility with older confluent-kafka-python"
" Protobuf producers and consumers."
" See the release notes for more details",
):
ProtobufDeserializer(DoubleValue)
ProtobufSerializer(DoubleValue, None, {"use.deprecated.format": False})
with pytest.raises(
RuntimeError,
match="the 'use.deprecated.format' configuration property must be explicitly"
" set due to backward incompatibility with older confluent-kafka-python"
" Protobuf producers and consumers."
" See the release notes for more details",
):
ProtobufSerializer(DoubleValue, None, {})
with pytest.raises(
RuntimeError,
match="the 'use.deprecated.format' configuration property must be explicitly"
" set due to backward incompatibility with older confluent-kafka-python"
" Protobuf producers and consumers."
" See the release notes for more details",
):
ProtobufSerializer(DoubleValue, None)
if __name__ == "__main__":
test_deprecated()
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