Skip to content

Commit

Permalink
Sort json archive request
Browse files Browse the repository at this point in the history
  • Loading branch information
gmertes committed Jul 29, 2024
1 parent a01b90c commit 56297e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ai_models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ def finalise(self):
def json_default(obj):
if isinstance(obj, set):
if len(obj) > 1:
return list(obj)
return sorted(list(obj))
else:
return obj.pop()
return obj
raise TypeError

print(
json.dumps(json_requests, separators=(",", ":"), default=json_default),
json.dumps(json_requests, separators=(",", ":"), default=json_default, sort_keys=True),
file=f,
)

Expand Down

0 comments on commit 56297e1

Please sign in to comment.