Skip to content

Commit

Permalink
Remove usage of TaggedFields
Browse files Browse the repository at this point in the history
TaggedFields doesn't seem to work properly at the moment. Maybe they
should be replaced by an implementation closer to the java client with
their "flexibleVersions"
  • Loading branch information
Vincent Maurin committed Jan 29, 2024
1 parent 927472e commit ccf8524
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 2 additions & 4 deletions aiokafka/admin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,7 @@ async def delete_records(
for leader, delete_request in requests.items():
request = req_cls(
self._convert_records_to_delete(delete_request),
timeout_ms or self._request_timeout_ms,
{},
timeout_ms or self._request_timeout_ms
)
response = await self._client.send(leader, request)
for topic, partitions in response.topics:
Expand All @@ -665,8 +664,7 @@ def _convert_records_to_delete(
return [
(
topic,
[(partition, rec.before_offset, {}) for partition, rec in records],
{},
[(partition, rec.before_offset) for partition, rec in records]
)
for topic, records in records_to_delete.items()
]
6 changes: 4 additions & 2 deletions aiokafka/protocol/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,11 +1389,13 @@ class DeleteRecordsRequest_v2(Request):
DeleteRecordsRequest = [
DeleteRecordsRequest_v0,
DeleteRecordsRequest_v1,
DeleteRecordsRequest_v2,
# FIXME: We have some problems with `TaggedFields`
# DeleteRecordsRequest_v2,
]

DeleteRecordsResponse = [
DeleteRecordsResponse_v0,
DeleteRecordsResponse_v1,
DeleteRecordsResponse_v2,
# FIXME: We have some problems with `TaggedFields`
# DeleteRecordsResponse_v2,
]
1 change: 1 addition & 0 deletions aiokafka/protocol/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ def encode(self, value):
return UnsignedVarInt32.encode(len(value) + 1) + value


# FIXME: TaggedFields doesn't seem to work properly so they should be avoided
class TaggedFields(AbstractType):
@classmethod
def decode(cls, data):
Expand Down

0 comments on commit ccf8524

Please sign in to comment.