From 98b1ee182b0ac3f229dfdae5f7abb66accf47081 Mon Sep 17 00:00:00 2001 From: Robert Yokota Date: Fri, 23 May 2025 18:07:50 -0700 Subject: [PATCH 1/3] Raise an error if Protobuf deprecated format is specified --- .../schema_registry/protobuf.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/confluent_kafka/schema_registry/protobuf.py b/src/confluent_kafka/schema_registry/protobuf.py index 398393e58..f943d92a4 100644 --- a/src/confluent_kafka/schema_registry/protobuf.py +++ b/src/confluent_kafka/schema_registry/protobuf.py @@ -430,14 +430,7 @@ def __init__( if not isinstance(self._use_deprecated_format, bool): raise ValueError("use.deprecated.format must be a boolean value") if self._use_deprecated_format: - warnings.warn("ProtobufSerializer: the 'use.deprecated.format' " - "configuration property, and the ability to use the " - "old incorrect Protobuf serializer heading format " - "introduced in confluent-kafka-python v1.4.0, " - "will be removed in an upcoming release in 2021 Q2. " - "Please migrate your Python Protobuf producers and " - "consumers to 'use.deprecated.format':False as " - "soon as possible") + raise ValueError("use.deprecated.format is no longer supported") self._subject_name_func = conf_copy.pop('subject.name.strategy') if not callable(self._subject_name_func): @@ -732,14 +725,7 @@ def __init__( if not isinstance(self._use_deprecated_format, bool): raise ValueError("use.deprecated.format must be a boolean value") if self._use_deprecated_format: - warnings.warn("ProtobufDeserializer: the 'use.deprecated.format' " - "configuration property, and the ability to use the " - "old incorrect Protobuf serializer heading format " - "introduced in confluent-kafka-python v1.4.0, " - "will be removed in an upcoming release in 2022 Q2. " - "Please migrate your Python Protobuf producers and " - "consumers to 'use.deprecated.format':False as " - "soon as possible") + raise ValueError("use.deprecated.format is no longer supported") descriptor = message_type.DESCRIPTOR self._msg_class = GetMessageClass(descriptor) From c6279b78b1b8a0f19296c8c18d352d568c4c7de8 Mon Sep 17 00:00:00 2001 From: Robert Yokota Date: Sat, 24 May 2025 13:37:17 -0700 Subject: [PATCH 2/3] Minor cleanup --- src/confluent_kafka/schema_registry/protobuf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/confluent_kafka/schema_registry/protobuf.py b/src/confluent_kafka/schema_registry/protobuf.py index f943d92a4..6469c2d08 100644 --- a/src/confluent_kafka/schema_registry/protobuf.py +++ b/src/confluent_kafka/schema_registry/protobuf.py @@ -18,7 +18,6 @@ import io import sys import base64 -import warnings from collections import deque from decimal import Context, Decimal, MAX_PREC from typing import Set, List, Union, Optional, Any, Tuple From 54c91851c2ce737d0be61b92823ba8a09e0e9612 Mon Sep 17 00:00:00 2001 From: Robert Yokota Date: Sat, 24 May 2025 14:10:03 -0700 Subject: [PATCH 3/3] Minor cleanup --- .../schema_registry/protobuf.py | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/src/confluent_kafka/schema_registry/protobuf.py b/src/confluent_kafka/schema_registry/protobuf.py index 6469c2d08..99f8d36c8 100644 --- a/src/confluent_kafka/schema_registry/protobuf.py +++ b/src/confluent_kafka/schema_registry/protobuf.py @@ -318,18 +318,6 @@ class ProtobufSerializer(BaseSerializer): | ``schema.id.serializer`` | callable | Defines how the schema id/guid is serialized. | | | | Defaults to prefix_schema_id_serializer. | +-------------------------------------+----------+------------------------------------------------------+ - | ``use.deprecated.format`` | bool | Specifies whether the Protobuf serializer should | - | | | serialize message indexes without zig-zag encoding. | - | | | This option must be explicitly configured as older | - | | | and newer Protobuf producers are incompatible. | - | | | If the consumers of the topic being produced to are | - | | | using confluent-kafka-python <1.8 then this property | - | | | must be set to True until all old consumers have | - | | | have been upgraded. | - | | | | - | | | Warning: This configuration property will be removed | - | | | in a future version of the client. | - +-------------------------------------+----------+------------------------------------------------------+ Schemas are registered against subject names in Confluent Schema Registry that define a scope in which the schemas can be evolved. By default, the subject name @@ -657,17 +645,6 @@ class ProtobufDeserializer(BaseDeserializer): | ``schema.id.deserializer`` | callable | Defines how the schema id/guid is deserialized. | | | | Defaults to dual_schema_id_deserializer. | +-------------------------------------+----------+------------------------------------------------------+ - | ``use.deprecated.format`` | bool | Specifies whether the Protobuf deserializer should | - | | | deserialize message indexes without zig-zag encoding.| - | | | This option must be explicitly configured as older | - | | | and newer Protobuf producers are incompatible. | - | | | If Protobuf messages in the topic to consume were | - | | | produced with confluent-kafka-python <1.8 then this | - | | | property must be set to True until all old messages | - | | | have been processed and producers have been upgraded.| - | | | Warning: This configuration property will be removed | - | | | in a future version of the client. | - +-------------------------------------+----------+------------------------------------------------------+ See Also: