Skip to content

Commit ba70d97

Browse files
committed
Raise an error if Protobuf deprecated format is specified
1 parent 76dfb6b commit ba70d97

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/confluent_kafka/schema_registry/protobuf.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,7 @@ def __init__(
430430
if not isinstance(self._use_deprecated_format, bool):
431431
raise ValueError("use.deprecated.format must be a boolean value")
432432
if self._use_deprecated_format:
433-
warnings.warn("ProtobufSerializer: the 'use.deprecated.format' "
434-
"configuration property, and the ability to use the "
435-
"old incorrect Protobuf serializer heading format "
436-
"introduced in confluent-kafka-python v1.4.0, "
437-
"will be removed in an upcoming release in 2021 Q2. "
438-
"Please migrate your Python Protobuf producers and "
439-
"consumers to 'use.deprecated.format':False as "
440-
"soon as possible")
433+
raise ValueError("use.deprecated.format is no longer supported")
441434

442435
self._subject_name_func = conf_copy.pop('subject.name.strategy')
443436
if not callable(self._subject_name_func):
@@ -732,14 +725,7 @@ def __init__(
732725
if not isinstance(self._use_deprecated_format, bool):
733726
raise ValueError("use.deprecated.format must be a boolean value")
734727
if self._use_deprecated_format:
735-
warnings.warn("ProtobufDeserializer: the 'use.deprecated.format' "
736-
"configuration property, and the ability to use the "
737-
"old incorrect Protobuf serializer heading format "
738-
"introduced in confluent-kafka-python v1.4.0, "
739-
"will be removed in an upcoming release in 2022 Q2. "
740-
"Please migrate your Python Protobuf producers and "
741-
"consumers to 'use.deprecated.format':False as "
742-
"soon as possible")
728+
raise ValueError("use.deprecated.format is no longer supported")
743729

744730
descriptor = message_type.DESCRIPTOR
745731
self._msg_class = GetMessageClass(descriptor)

0 commit comments

Comments
 (0)