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

Sort output of data #50

Open
phalt opened this issue Nov 8, 2024 · 6 comments
Open

Sort output of data #50

phalt opened this issue Nov 8, 2024 · 6 comments

Comments

@phalt
Copy link
Member

phalt commented Nov 8, 2024

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.

@Naramsim
Copy link
Member

Naramsim commented Nov 8, 2024

Yeah, we should use ordered dicts instead of the standard dicts. Ideally implementing an order logic

@phalt
Copy link
Member Author

phalt commented Nov 8, 2024

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?

@Naramsim
Copy link
Member

Naramsim commented Nov 8, 2024

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

@Naramsim
Copy link
Member

Naramsim commented Nov 8, 2024

We had this discussion already in the past via email or GH issue, but we couldn't determine why they would get shuffled anyways

@phalt
Copy link
Member Author

phalt commented Nov 8, 2024

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.

@Naramsim
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants