Skip to content

Murmur2Partitioner #1999

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

Closed
DrNickBailey opened this issue Feb 16, 2020 · 1 comment
Closed

Murmur2Partitioner #1999

DrNickBailey opened this issue Feb 16, 2020 · 1 comment

Comments

@DrNickBailey
Copy link

Since upgrading to 2.0.0 I'm now getting an import error:

---> from kafka.partitioner import Murmur2Partitioner
ImportError: cannot import name 'Murmur2Partitioner'

@jeffwidman
Copy link
Contributor

The murmur2 partitioner has always been the default for the KafkaConsumer: https://github.com/dpkp/kafka-python/blob/2.0.0/kafka/partitioner/default.py

The old SimpleConsumer which could explicitly use the named import Murmur2Partitioner was removed in #1193 which was released in 2.0.0.

You can still import the murmur2 function that backed both the Murmur2Partitioner and KafkaConsumer's DefaultPartitioner from here: https://github.com/dpkp/kafka-python/blob/2.0.0/kafka/partitioner/__init__.py.

Depending on your use case, you may find it helpful to read the diff of #1193 for how it changed the partitioning logic imports in order to figure out whether you can just update the name or if you need to wrap it in some way if you have some very custom use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants