Skip to content
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.

Commit

Permalink
[Amit|Ashwin] Made changes in make_kafka_safe methodto make it work i…
Browse files Browse the repository at this point in the history
…n Kafka3
  • Loading branch information
Ashwin Sinha committed Apr 24, 2018
1 parent 75a55e6 commit 4bdc1a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
description="Messaging library ",
long_description=README,
keywords="apache kafka",
install_requires=['six', 'kafka-python', 'gevent'],
install_requires=['six', 'kafka', 'gevent'],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand Down
8 changes: 2 additions & 6 deletions woof/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ def make_kafka_safe(raw_data):
This function was written to avoid non-unicode
string data produced to Kafka
"""
if type(raw_data) != unicode:
raw_data = str(raw_data)
raw_data = raw_data.decode('utf-8')
return raw_data.encode('ascii', 'ignore')
else:
return raw_data.encode('ascii', 'ignore')
raw_data = str(raw_data)
return raw_data.encode('ascii', 'ignore')


class TransactionLogger(object):
Expand Down

0 comments on commit 4bdc1a6

Please sign in to comment.