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

Format UUID was set the same UUID into __id and UUID into document #737

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mongo_connector/doc_managers/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def transform_value(self, value):
# Just include body of binary data without subtype
return base64.b64encode(value).decode()
elif isinstance(value, UUID):
return value.hex
return value
elif isinstance(value, (int, long, float)):
if isnan(value):
raise ValueError("nan")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_types(self):
self.assertEqual(trans(self.date), self.date)

# UUID
self.assertEqual(trans(self.xuuid), self.xuuid.hex)
self.assertEqual(trans(self.xuuid), self.xuuid)

# Other type
self.assertEqual(trans(self.oid), str(self.oid))
Expand Down