Skip to content

Commit 3cb4080

Browse files
committed
target assignment declaration
1 parent c99fc8c commit 3cb4080

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

examples/adminapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def example_describe_consumer_groups(a, args):
552552
if member.target_assignment:
553553
print(" Target Assignments:")
554554
for toppar in member.target_assignment.topic_partitions:
555-
print(" {} [{}]".format(toppar.topic, toppar.partition))
555+
print(f" {toppar.topic} [{toppar.partition}]")
556556
if (include_auth_ops):
557557
print(" Authorized operations: ")
558558
op_string = ""

src/confluent_kafka/admin/_group.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class MemberDescription:
100100
The instance id of the group member.
101101
"""
102102

103-
def __init__(self, member_id, client_id, host, assignment, target_assignment, group_instance_id=None):
103+
def __init__(self, member_id, client_id, host, assignment, group_instance_id=None, target_assignment=None):
104104
self.member_id = member_id
105105
self.client_id = client_id
106106
self.host = host
@@ -135,7 +135,7 @@ class ConsumerGroupDescription:
135135
"""
136136

137137
def __init__(self, group_id, is_simple_consumer_group, members, partition_assignor, state,
138-
type, coordinator, authorized_operations=None):
138+
coordinator, authorized_operations=None, type=ConsumerGroupType.UNKNOWN):
139139
self.group_id = group_id
140140
self.is_simple_consumer_group = is_simple_consumer_group
141141
self.members = members

src/confluent_kafka/src/Admin.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3857,6 +3857,7 @@ static PyObject *Admin_c_MemberDescription_to_py(const rd_kafka_MemberDescriptio
38573857
PyObject *args = NULL;
38583858
PyObject *kwargs = NULL;
38593859
PyObject *assignment = NULL;
3860+
PyObject *target_assignment = NULL;
38603861
const rd_kafka_MemberAssignment_t *c_assignment;
38613862
const rd_kafka_MemberAssignment_t *c_target_assignment;
38623863

@@ -3895,7 +3896,7 @@ static PyObject *Admin_c_MemberDescription_to_py(const rd_kafka_MemberDescriptio
38953896

38963897
c_target_assignment = rd_kafka_MemberDescription_target_assignment(c_member);
38973898
if(c_target_assignment) {
3898-
PyObject *target_assignment = Admin_c_MemberAssignment_to_py(c_target_assignment);
3899+
target_assignment = Admin_c_MemberAssignment_to_py(c_target_assignment);
38993900
if (!target_assignment) {
39003901
goto err;
39013902
}
@@ -3910,6 +3911,7 @@ static PyObject *Admin_c_MemberDescription_to_py(const rd_kafka_MemberDescriptio
39103911
Py_DECREF(kwargs);
39113912
Py_DECREF(MemberDescription_type);
39123913
Py_DECREF(assignment);
3914+
Py_XDECREF(target_assignment);
39133915
return member;
39143916

39153917
err:
@@ -3918,6 +3920,7 @@ static PyObject *Admin_c_MemberDescription_to_py(const rd_kafka_MemberDescriptio
39183920
Py_XDECREF(kwargs);
39193921
Py_XDECREF(MemberDescription_type);
39203922
Py_XDECREF(assignment);
3923+
Py_XDECREF(target_assignment);
39213924
Py_XDECREF(member);
39223925
return NULL;
39233926
}

0 commit comments

Comments
 (0)