Skip to content

Commit

Permalink
Comment fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ognjen-j committed Oct 5, 2020
1 parent 4bf7e3e commit b3ab00e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion esque/messages/avromessage.py
@@ -1,3 +1,4 @@
import base64
import itertools as it
import json
import pathlib
Expand Down Expand Up @@ -80,7 +81,7 @@ def deserializer(value):
if isinstance(value, (datetime, date)):
return value.isoformat()
elif isinstance(value, bytes):
return "0x{}".format(value.hex())
return base64.b64encode(value).decode("ascii")


class AvroFileReader(FileReader):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_output.py
Expand Up @@ -57,5 +57,5 @@ def test_converting_unserializable_values_to_strings():
"simple": "some string",
"date": "2020-10-05",
"datetime": "2020-10-05T11:15:20",
"binary": "0x536f6d65206f7468657220737472696e67",
"binary": "U29tZSBvdGhlciBzdHJpbmc=",
}

0 comments on commit b3ab00e

Please sign in to comment.