Skip to content

Commit

Permalink
better sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Jan 9, 2025
1 parent e0dc67d commit ccd2f33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cads_adaptors/adaptors/mars.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def use_cache(self) -> bool:
return "local" in ensure_list(fs.protocol)

def sort_requests(self, requests: list[Request]) -> list[Request]:
return sorted(requests, key=lambda request: json.dumps(request, sort_keys=True))
requests = [dict(sorted(request.items())) for request in requests]
return sorted(requests, key=lambda request: json.dumps(request))

@cacholote.cacheable
def cached_retrieve(self, requests: list[Request]) -> BinaryIO:
Expand Down

0 comments on commit ccd2f33

Please sign in to comment.