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

Message timestamp interface doesn't match confluent_kafka #74

Open
MrkGrgsn opened this issue Apr 24, 2024 · 2 comments
Open

Message timestamp interface doesn't match confluent_kafka #74

MrkGrgsn opened this issue Apr 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MrkGrgsn
Copy link
Contributor

Describe the bug
The Message class in confluent_kafka returns a tuple of timestamp type and the timestamp itself, I infer the type is tuple[int, int] but the corresponding class in mockafka returns int | None.

To Reproduce
Code designed for parsing the timestamp from a confluent_kafka Message will fail:

consumer = FakeConsumer()
consumer.subscribe(["my_topic"])
msg = consumer.poll()
timestamp_type, timestamp = msg.timestamp()  # Results in TypeError: cannot unpack non-iterable int/NoneType object

Expected behavior
I hope that compatibility with confluent_kafka can be maintained!

mockafka-py==0.1.55
confluent-kafka==2.3.0
Python 3.11.8

@MrkGrgsn MrkGrgsn added the bug Something isn't working label Apr 24, 2024
@alm0ra
Copy link
Owner

alm0ra commented Apr 27, 2024

@MrkGrgsn
Thanks for raising this issue,

I will fix it soon.

@massooti
Copy link

massooti commented Aug 15, 2024

Take a look #146

now it does supports and its fully compatible with confluent_kafka library timestamp method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants