Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix keyerror #20

Merged
merged 1 commit into from
Feb 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aiokafka/consumer/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ async def fetched_records(self, partitions, timeout=0, max_records=None):
if not self._subscriptions.is_assigned(tp):
del self._records[tp]
continue
res_or_error = self._records[tp]
res_or_error = self._records.get(tp)
if type(res_or_error) == FetchResult:
records = res_or_error.getall(max_records)
if not res_or_error.has_more():
Expand All @@ -1101,9 +1101,9 @@ async def fetched_records(self, partitions, timeout=0, max_records=None):
return drained
else:
# Remove error, so we can fetch on partition again
del self._records[tp]
self._records.pop(tp, None)
self._notify(self._wait_consume_future)
res_or_error.check_raise()
getattr(res_or_error, 'check_raise', lambda: None)()

if drained or not timeout:
return drained
Expand Down