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 no-payload commit in consumer #833

Merged
merged 1 commit into from
Mar 5, 2024
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
5 changes: 4 additions & 1 deletion karapace/kafka/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ def commit( # type: ignore[override]
if message is not None:
return super().commit(message=message, asynchronous=False)

return super().commit(offsets=offsets, asynchronous=False)
if offsets is not None:
return super().commit(offsets=offsets, asynchronous=False)
Copy link
Contributor Author

@matyaskuti matyaskuti Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: because this is a C library, there is a difference between providing None and not providing a parameter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh this is not None being different from != None and different from bool(optional) stole me so much time in my life 😭


return super().commit(asynchronous=False)
except KafkaException as exc:
raise_from_kafkaexception(exc)

Expand Down
Loading