Skip to content

Commit 62b1dd8

Browse files
authored
Backport recent _sync changes into _async/protobuf.py (confluentinc#1987)
1 parent b36acf2 commit 62b1dd8

File tree

1 file changed

+2
-40
lines changed

1 file changed

+2
-40
lines changed

src/confluent_kafka/schema_registry/_async/protobuf.py

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# limitations under the License.
1717

1818
import io
19-
import warnings
2019
from typing import Set, List, Union, Optional, Tuple
2120

2221
from google.protobuf import json_format, descriptor_pb2
@@ -149,18 +148,6 @@ class AsyncProtobufSerializer(AsyncBaseSerializer):
149148
| ``schema.id.serializer`` | callable | Defines how the schema id/guid is serialized. |
150149
| | | Defaults to prefix_schema_id_serializer. |
151150
+-------------------------------------+----------+------------------------------------------------------+
152-
| ``use.deprecated.format`` | bool | Specifies whether the Protobuf serializer should |
153-
| | | serialize message indexes without zig-zag encoding. |
154-
| | | This option must be explicitly configured as older |
155-
| | | and newer Protobuf producers are incompatible. |
156-
| | | If the consumers of the topic being produced to are |
157-
| | | using confluent-kafka-python <1.8 then this property |
158-
| | | must be set to True until all old consumers have |
159-
| | | have been upgraded. |
160-
| | | |
161-
| | | Warning: This configuration property will be removed |
162-
| | | in a future version of the client. |
163-
+-------------------------------------+----------+------------------------------------------------------+
164151
165152
Schemas are registered against subject names in Confluent Schema Registry that
166153
define a scope in which the schemas can be evolved. By default, the subject name
@@ -260,14 +247,7 @@ async def __init__(
260247
if not isinstance(self._use_deprecated_format, bool):
261248
raise ValueError("use.deprecated.format must be a boolean value")
262249
if self._use_deprecated_format:
263-
warnings.warn("ProtobufSerializer: the 'use.deprecated.format' "
264-
"configuration property, and the ability to use the "
265-
"old incorrect Protobuf serializer heading format "
266-
"introduced in confluent-kafka-python v1.4.0, "
267-
"will be removed in an upcoming release in 2021 Q2. "
268-
"Please migrate your Python Protobuf producers and "
269-
"consumers to 'use.deprecated.format':False as "
270-
"soon as possible")
250+
raise ValueError("use.deprecated.format is no longer supported")
271251

272252
self._subject_name_func = conf_copy.pop('subject.name.strategy')
273253
if not callable(self._subject_name_func):
@@ -499,17 +479,6 @@ class AsyncProtobufDeserializer(AsyncBaseDeserializer):
499479
| ``schema.id.deserializer`` | callable | Defines how the schema id/guid is deserialized. |
500480
| | | Defaults to dual_schema_id_deserializer. |
501481
+-------------------------------------+----------+------------------------------------------------------+
502-
| ``use.deprecated.format`` | bool | Specifies whether the Protobuf deserializer should |
503-
| | | deserialize message indexes without zig-zag encoding.|
504-
| | | This option must be explicitly configured as older |
505-
| | | and newer Protobuf producers are incompatible. |
506-
| | | If Protobuf messages in the topic to consume were |
507-
| | | produced with confluent-kafka-python <1.8 then this |
508-
| | | property must be set to True until all old messages |
509-
| | | have been processed and producers have been upgraded.|
510-
| | | Warning: This configuration property will be removed |
511-
| | | in a future version of the client. |
512-
+-------------------------------------+----------+------------------------------------------------------+
513482
514483
515484
See Also:
@@ -566,14 +535,7 @@ async def __init__(
566535
if not isinstance(self._use_deprecated_format, bool):
567536
raise ValueError("use.deprecated.format must be a boolean value")
568537
if self._use_deprecated_format:
569-
warnings.warn("ProtobufDeserializer: the 'use.deprecated.format' "
570-
"configuration property, and the ability to use the "
571-
"old incorrect Protobuf serializer heading format "
572-
"introduced in confluent-kafka-python v1.4.0, "
573-
"will be removed in an upcoming release in 2022 Q2. "
574-
"Please migrate your Python Protobuf producers and "
575-
"consumers to 'use.deprecated.format':False as "
576-
"soon as possible")
538+
raise ValueError("use.deprecated.format is no longer supported")
577539

578540
descriptor = message_type.DESCRIPTOR
579541
self._msg_class = GetMessageClass(descriptor)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy