kafka-python icon indicating copy to clipboard operation
kafka-python copied to clipboard

feat AdminClient: support delete_records

Open alfaix opened this issue 1 year ago • 0 comments

Hey!

This PR is based on https://github.com/dpkp/kafka-python/pull/2062 It implements delete_records for AdminClient. Thanks to @10101010 for the initial PR.

This PR contains the following improvements on that version:

  1. It fixes review comments: adds tests and removes formatting peculiarities
  2. It contains an optimization that is important to me: if multiple partitions live on the same broker, it sends one request, instead of one per partition. It is important because I use delete_records in integration tests, and this significantly improves test startup/teardown speed.
  3. It checks for errors as much as it can.

I tested it locally with 2.6.0 + py3.9, I'm assuming CI will check for everything else. Additionally, I would like some direction from maintainers on whether it is possible/required to test this with a multi-broker setup - I couldn't find an example in the tests that uses multiple brokers.

Resolves: #2344


This change is Reviewable

alfaix avatar Mar 19 '23 17:03 alfaix