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

Closed
phalt opened this issue Nov 8, 2024 · 10 comments
Closed

Sort output of data #50

phalt opened this issue Nov 8, 2024 · 10 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

@Naramsim
Copy link
Member

Naramsim commented Jan 7, 2025

interestingly, the issue seems resolved. I updated Python and now it's two build that everything works as expected:

last one: https://app.circleci.com/pipelines/github/PokeAPI/pokeapi/1470/workflows/af8e58bc-8622-4872-982a-acadbfddc559/jobs/3285 No CSVs were modified and the regeneration of the JSONs didn't bring any updates.

previous to last one: https://github.com/PokeAPI/api-data/pull/271/files Only the changed values were effectively updated

@phalt
Copy link
Member Author

phalt commented Jan 13, 2025

Which version of Python did you update to? This is a cool side effect if that solved it.

@Naramsim
Copy link
Member

Apparently from 3.10.9 to 3.12.8. And with 3.13 pokeapi doesn't work!

@phalt
Copy link
Member Author

phalt commented Jan 13, 2025

No idea what could've caused that improvement but happy to take it.

@phalt phalt closed this as completed Jan 13, 2025
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