Skip to content

Made the dicts being serialized ordered. #2162

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

Closed

Conversation

KOLANICH
Copy link
Contributor

@KOLANICH KOLANICH commented Nov 1, 2022

Fixes #2161

Description of the changes being introduced by the pull request:

  • Sort the dicts being serialized by their keys to enforce the same ordering all the time.
  • Use OrderedDict type. I know that just dict is also ordered in modern versions of Python, but OrderedDict is more future-proof.

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature - not needed
  • Docs have been added for the bug fix or new feature - not needed

@KOLANICH KOLANICH force-pushed the sort_dicts branch 2 times, most recently from 166eeac to dee07cc Compare November 1, 2022 14:36
@coveralls
Copy link

coveralls commented Nov 2, 2022

Pull Request Test Coverage Report for Build 3385835271

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 98.175%

Totals Coverage Status
Change from base Build 3385214379: -0.01%
Covered Lines: 1164
Relevant Lines: 1177

💛 - Coveralls

@jku
Copy link
Member

jku commented Nov 22, 2022

closing as #2161 was closed

When this was designed sorting was intentionally left to the serializer. Change of behaviour now is not worth the small risk when the benefit is also so small: serializers are supposed to choose their serialization format, this includes potentially sorting dicts.

@jku jku closed this Nov 22, 2022
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

Successfully merging this pull request may close these issues.

Sort roles dict by keys when serializing
3 participants