Skip to content

frozenset[str] fields in API get shuffled #1348

@srabraham

Description

@srabraham

It's kind of unfortunate that we end up shuffling collections in API fields. For example, I noticed this in the ranger_handles field in the incidents endpoint (like this one: https://ranger-ims-staging.burningman.org/ims/api/events/2023/incidents/), and it's presumably the same for incident_types (https://ranger-ims-staging.burningman.org/ims/api/incident_types/).

Even if you start with sorted values in _db.py, they eventually get shuffled before encoding, because frozenset[str] are unordered, e.g. below

FYI @wsanchez

>>> for val in frozenset(("a","b","c")):
...     print(val)
...
a
c
b

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions