diff options
author | Dana Powers <dana.powers@gmail.com> | 2018-01-12 09:38:32 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2018-01-12 09:38:32 -0800 |
commit | 8c6ac80fa368732cac061993a81c363fbbad662c (patch) | |
tree | 31023dc599ed90ce7fc67a0dbb7cd1665a9102b7 | |
parent | 47869c2d790922ef84f07c75466894bf63dcd1af (diff) | |
download | kafka-python-fetchable_key_error.tar.gz |
set.discard is much betterfetchable_key_error
-rw-r--r-- | kafka/consumer/fetcher.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kafka/consumer/fetcher.py b/kafka/consumer/fetcher.py index 0c3b84c..afb8f52 100644 --- a/kafka/consumer/fetcher.py +++ b/kafka/consumer/fetcher.py @@ -638,11 +638,9 @@ class Fetcher(six.Iterator): def _fetchable_partitions(self): fetchable = self._subscriptions.fetchable_partitions() if self._next_partition_records: - if self._next_partition_records.topic_partition in fetchable: - fetchable.remove(self._next_partition_records.topic_partition) + fetchable.discard(self._next_partition_records.topic_partition) for fetch in self._completed_fetches: - if fetch.topic_partition in fetchable: - fetchable.remove(fetch.topic_partition) + fetchable.discard(fetch.topic_partition) return fetchable def _create_fetch_requests(self): |