-
Notifications
You must be signed in to change notification settings - Fork 896
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
Update built-in partitioner options to include murmur2 #396
Conversation
Travis failure due to the lingering 0.11.4 version in |
There's no need for this anymore since librdkafka's partitioners can be configured directly in librdkafka through string properties, search for "partitioner" here: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md We should rather remove this code from the Python client |
Makes sense, hadn't considered the fall through to librdkafka. Update inbound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove all the partitioner functionality, just grep for partitioner and you'll find a horde of unused stuff.
tests/test_Producer.py
Outdated
@@ -168,3 +168,26 @@ def handle_dr(err, msg): | |||
p.produce('mytopic', "\xc2\xc2", on_delivery=handle_dr) | |||
|
|||
p.flush() | |||
|
|||
|
|||
def test_set_partioner_murmur2(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partitioner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still partioner
tests/test_Producer.py
Outdated
""" | ||
with pytest.raises(KafkaException) as e: | ||
Producer({'partitioner': 'murmur'}) | ||
assert e == 'unknown builtin partitioner: murmur' in e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you certain this works, referencing the exception from with the block?
I think it needs to go in the outer block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would fail otherwise no? I have tested it without checking for the raised exception at all and it raised the appropriate exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the assert is never reached since Producer() raises an exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep you are correct.
https://github.com/pytest-dev/pytest/blob/master/src/_pytest/python_api.py#L528-L547
fixing
@edenhill, I think I got it all this go around |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
tests/test_Producer.py
Outdated
@@ -168,3 +168,26 @@ def handle_dr(err, msg): | |||
p.produce('mytopic', "\xc2\xc2", on_delivery=handle_dr) | |||
|
|||
p.flush() | |||
|
|||
|
|||
def test_set_partioner_murmur2(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still partioner
Dont forget retarget for master before merging |
Custom partitioner was removed a long time ago having predefined set of partitioners from librdkafka (confluentinc#396) but 'known bug' note still exists. That note is misleading regarding the use of the 'partitioner' configuration property
Referenced in #231