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

Dev #9

Merged
merged 4 commits into from
Jul 4, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
sort keys when using the default json serialisers
  • Loading branch information
JJ11teen committed Jan 7, 2022
commit fdd710a7b21496af77479d4f5e32c85812be1f82
4 changes: 2 additions & 2 deletions src/cloudmappings/cloudstoragemapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def with_json(cls, encoding="utf-8", *args, **kwargs) -> "CloudMapping":
import json

return cls.with_serialisers(
[json.dumps, partial(bytes, encoding=encoding)],
[partial(json.dumps, sort_keys=True), partial(bytes, encoding=encoding)],
[partial(str, encoding=encoding), json.loads],
*args,
**kwargs,
Expand Down Expand Up @@ -311,7 +311,7 @@ def with_json_zlib(cls, encoding="utf-8", *args, **kwargs) -> "CloudMapping":
import zlib

return cls.with_serialisers(
[json.dumps, partial(bytes, encoding=encoding), zlib.compress],
[partial(json.dumps, sort_keys=True), partial(bytes, encoding=encoding), zlib.compress],
[zlib.decompress, partial(str, encoding=encoding), json.loads],
*args,
**kwargs,
Expand Down