@@ -230,13 +230,13 @@ def test_need_rejoin(coordinator):
230
230
def test_refresh_committed_offsets_if_needed (mocker , coordinator ):
231
231
mocker .patch .object (ConsumerCoordinator , 'fetch_committed_offsets' ,
232
232
return_value = {
233
- TopicPartition ('foobar' , 0 ): OffsetAndMetadata (123 , b '' , - 1 ),
234
- TopicPartition ('foobar' , 1 ): OffsetAndMetadata (234 , b '' , - 1 )})
233
+ TopicPartition ('foobar' , 0 ): OffsetAndMetadata (123 , '' , - 1 ),
234
+ TopicPartition ('foobar' , 1 ): OffsetAndMetadata (234 , '' , - 1 )})
235
235
coordinator ._subscription .assign_from_user ([TopicPartition ('foobar' , 0 )])
236
236
assert coordinator ._subscription .needs_fetch_committed_offsets is True
237
237
coordinator .refresh_committed_offsets_if_needed ()
238
238
assignment = coordinator ._subscription .assignment
239
- assert assignment [TopicPartition ('foobar' , 0 )].committed == OffsetAndMetadata (123 , b '' , - 1 )
239
+ assert assignment [TopicPartition ('foobar' , 0 )].committed == OffsetAndMetadata (123 , '' , - 1 )
240
240
assert TopicPartition ('foobar' , 1 ) not in assignment
241
241
assert coordinator ._subscription .needs_fetch_committed_offsets is False
242
242
@@ -303,8 +303,8 @@ def test_close(mocker, coordinator):
303
303
@pytest .fixture
304
304
def offsets ():
305
305
return {
306
- TopicPartition ('foobar' , 0 ): OffsetAndMetadata (123 , b '' , - 1 ),
307
- TopicPartition ('foobar' , 1 ): OffsetAndMetadata (234 , b '' , - 1 ),
306
+ TopicPartition ('foobar' , 0 ): OffsetAndMetadata (123 , '' , - 1 ),
307
+ TopicPartition ('foobar' , 1 ): OffsetAndMetadata (234 , '' , - 1 ),
308
308
}
309
309
310
310
@@ -594,27 +594,27 @@ def test_send_offset_fetch_request_success(patched_coord, partitions):
594
594
595
595
596
596
@pytest .mark .parametrize ('response,error,dead' , [
597
- (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , b '' , 14 ), (1 , 234 , b '' , 14 )])]),
597
+ (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , '' , 14 ), (1 , 234 , '' , 14 )])]),
598
598
Errors .GroupLoadInProgressError , False ),
599
- (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , b '' , 16 ), (1 , 234 , b '' , 16 )])]),
599
+ (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , '' , 16 ), (1 , 234 , '' , 16 )])]),
600
600
Errors .NotCoordinatorForGroupError , True ),
601
- (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , b '' , 25 ), (1 , 234 , b '' , 25 )])]),
601
+ (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , '' , 25 ), (1 , 234 , '' , 25 )])]),
602
602
Errors .UnknownMemberIdError , False ),
603
- (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , b '' , 22 ), (1 , 234 , b '' , 22 )])]),
603
+ (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , '' , 22 ), (1 , 234 , '' , 22 )])]),
604
604
Errors .IllegalGenerationError , False ),
605
- (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , b '' , 29 ), (1 , 234 , b '' , 29 )])]),
605
+ (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , '' , 29 ), (1 , 234 , '' , 29 )])]),
606
606
Errors .TopicAuthorizationFailedError , False ),
607
- (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , b '' , 0 ), (1 , 234 , b '' , 0 )])]),
607
+ (OffsetFetchResponse [0 ]([('foobar' , [(0 , 123 , '' , 0 ), (1 , 234 , '' , 0 )])]),
608
608
None , False ),
609
- (OffsetFetchResponse [1 ]([('foobar' , [(0 , 123 , b '' , 0 ), (1 , 234 , b '' , 0 )])]),
609
+ (OffsetFetchResponse [1 ]([('foobar' , [(0 , 123 , '' , 0 ), (1 , 234 , '' , 0 )])]),
610
610
None , False ),
611
- (OffsetFetchResponse [2 ]([('foobar' , [(0 , 123 , b '' , 0 ), (1 , 234 , b '' , 0 )])], 0 ),
611
+ (OffsetFetchResponse [2 ]([('foobar' , [(0 , 123 , '' , 0 ), (1 , 234 , '' , 0 )])], 0 ),
612
612
None , False ),
613
- (OffsetFetchResponse [3 ](0 , [('foobar' , [(0 , 123 , b '' , 0 ), (1 , 234 , b '' , 0 )])], 0 ),
613
+ (OffsetFetchResponse [3 ](0 , [('foobar' , [(0 , 123 , '' , 0 ), (1 , 234 , '' , 0 )])], 0 ),
614
614
None , False ),
615
- (OffsetFetchResponse [4 ](0 , [('foobar' , [(0 , 123 , b '' , 0 ), (1 , 234 , b '' , 0 )])], 0 ),
615
+ (OffsetFetchResponse [4 ](0 , [('foobar' , [(0 , 123 , '' , 0 ), (1 , 234 , '' , 0 )])], 0 ),
616
616
None , False ),
617
- (OffsetFetchResponse [5 ](0 , [('foobar' , [(0 , 123 , - 1 , b '' , 0 ), (1 , 234 , - 1 , b '' , 0 )])], 0 ),
617
+ (OffsetFetchResponse [5 ](0 , [('foobar' , [(0 , 123 , - 1 , '' , 0 ), (1 , 234 , - 1 , '' , 0 )])], 0 ),
618
618
None , False ),
619
619
])
620
620
def test_handle_offset_fetch_response (patched_coord , offsets ,
0 commit comments