Skip to content

Commit ab9d21b

Browse files
committed
Correct warning logic (and text) for use.deprecated.format (confluentinc#1265)
1 parent d2667e9 commit ab9d21b

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Confluent's Python client for Apache Kafka
22

3+
## v1.8.3
4+
5+
v1.8.3 is a maintenance release with the following fixes:
6+
7+
- The warnings for `use.deprecated.format` (introduced in v1.8.2)
8+
had its logic reversed, which result in warning logs to be emitted when
9+
the property was correctly configured, and the log message itself also
10+
contained text that had it backwards.
11+
The warning is now only emitted when `use.deprecated.format` is set
12+
to the old legacy encoding (`True`). #1265
13+
14+
15+
316
## v1.8.2
417

518
v1.8.2 is a maintenance release with the following fixes and enhancements:

src/confluent_kafka/schema_registry/protobuf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,14 @@ def __init__(self, msg_type, schema_registry_client, conf=None):
258258
self._use_deprecated_format = conf_copy.pop('use.deprecated.format')
259259
if not isinstance(self._use_deprecated_format, bool):
260260
raise ValueError("use.deprecated.format must be a boolean value")
261-
if not self._use_deprecated_format:
261+
if self._use_deprecated_format:
262262
warnings.warn("ProtobufSerializer: the 'use.deprecated.format' "
263263
"configuration property, and the ability to use the "
264264
"old incorrect Protobuf serializer heading format "
265265
"introduced in confluent-kafka-python v1.4.0, "
266266
"will be removed in an upcoming release in 2021 Q2. "
267267
"Please migrate your Python Protobuf producers and "
268-
"consumers to 'use.deprecated.format':True as "
268+
"consumers to 'use.deprecated.format':False as "
269269
"soon as possible")
270270

271271
self._subject_name_func = conf_copy.pop('subject.name.strategy')
@@ -482,14 +482,14 @@ def __init__(self, message_type, conf=None):
482482
self._use_deprecated_format = conf_copy.pop('use.deprecated.format')
483483
if not isinstance(self._use_deprecated_format, bool):
484484
raise ValueError("use.deprecated.format must be a boolean value")
485-
if not self._use_deprecated_format:
485+
if self._use_deprecated_format:
486486
warnings.warn("ProtobufDeserializer: the 'use.deprecated.format' "
487487
"configuration property, and the ability to use the "
488488
"old incorrect Protobuf serializer heading format "
489489
"introduced in confluent-kafka-python v1.4.0, "
490490
"will be removed in an upcoming release in 2022 Q2. "
491491
"Please migrate your Python Protobuf producers and "
492-
"consumers to 'use.deprecated.format':True as "
492+
"consumers to 'use.deprecated.format':False as "
493493
"soon as possible")
494494

495495
descriptor = message_type.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