Skip to content

Commit ef27e70

Browse files
committed
Rename MessageStatus PersistenceStatus
1 parent b636dd0 commit ef27e70

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

confluent_kafka/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _resolve_plugins(plugins):
107107
return paths_sep.join(resolved)
108108

109109

110-
class MessageStatus(Enum):
110+
class PersistenceStatus(Enum):
111111
"""
112112
Returns the message's persistence status in the topic log.
113113

confluent_kafka/src/confluent_kafka.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static PyObject *Message_status (Message *self, PyObject *ignore) {
361361
PyObject *MessageStatus_Type, *message_status, *args;
362362

363363
MessageStatus_Type = cfl_PyObject_lookup("confluent_kafka",
364-
"MessageStatus");
364+
"PersistenceStatus");
365365

366366
if (!MessageStatus_Type) {
367367
/* class not found */

tests/integration/integration_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def verify_message_status():
215215
'not_persisted': 0}
216216

217217
def handle_dr(_, msg):
218-
if msg.status() is confluent_kafka.MessageStatus.STATUS_PERSISTED:
218+
if msg.status() is confluent_kafka.PersistenceStatus.STATUS_PERSISTED:
219219
results['persisted'] += 1
220220
return
221221
results['not_persisted'] += 1

tests/test_Producer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33
import pytest
44

5-
from confluent_kafka import Producer, KafkaError, KafkaException, libversion, MessageStatus
5+
from confluent_kafka import Producer, KafkaError, KafkaException, libversion, PersistenceStatus
66
from struct import pack
77

88

@@ -201,7 +201,7 @@ def test_dr_msg_status():
201201

202202
def handle_dr(_, msg):
203203
""" Message will timeout on the queue without actually being transmitted"""
204-
assert msg.status() == MessageStatus.NOT_PERSISTED
204+
assert msg.status() == PersistenceStatus.NOT_PERSISTED
205205

206206
p.produce('mytopic', "This is the message payload", on_delivery=handle_dr)
207207

tests/test_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def build_doctree(tree, prefix, parent):
3333
# Skip Enum derived class
3434
continue
3535

36-
if n.startswith("MSG_"):
36+
if n.startswith("MSG_STATUS"):
3737
continue
3838

3939
full = prefix + n

tests/test_enums.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ def test_offset_consts():
2727

2828
def test_message_status():
2929
""" Make sure librdkafka's message statuses are available. """
30-
print(confluent_kafka.MessageStatus.NOT_PERSISTED)
31-
print(confluent_kafka.MessageStatus.POSSIBLY_PERSISTED)
32-
print(confluent_kafka.MessageStatus.STATUS_PERSISTED)
30+
print(confluent_kafka.PersistenceStatus.NOT_PERSISTED)
31+
print(confluent_kafka.PersistenceStatus.POSSIBLY_PERSISTED)
32+
print(confluent_kafka.PersistenceStatus.STATUS_PERSISTED)

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