Open phalt opened 2 weeks ago
Yeah, we should use ordered dicts instead of the standard dicts. Ideally implementing an order logic
Hmmm now you mention it, what version of python is it running on? Dicts should be ordered by default since like, 3.6 or something?
We are on the python installed here:
https://github.com/PokeAPI/api-data/blob/master/updater%2FDockerfile#L4
Which I think might be the latest.
But not 100% sure. I'll check when I have time
We had this discussion already in the past via email or GH issue, but we couldn't determine why they would get shuffled anyways
It should definitely be beyond the version we need.
I do remember the discussion, and reviewing a few of the diffs today made me realise it is still a pain point.
I opened the issue with a bit of hope that someone in the community could pick it up.
Sometimes the data gets scrambled even if there's no modification to it. This isn't the best also for caching purposes.
We could also look into tools that diff JSON files, such as https://github.com/josephburnett/jd
Related to this issue is the fact that ditto produces data but when it pushes it up - the ordering isn't maintained and the diff is very large and hard to read - with most of it just being existing content shuffled around.
Ideally we'd like to provide a
--sort
option to the ditto tool that orders the output of data somehow.