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

Use OrderedDict to maintain key order #614

Merged
merged 1 commit into from Sep 12, 2019
Merged

Conversation

ob-stripe
Copy link
Contributor

@ob-stripe ob-stripe commented Sep 12, 2019

r? @brandur-stripe
cc @stripe/api-libraries

Use OrderedDict instead of dict to maintain key order in API requests and responses. (This is not a breaking change because OrderedDict is a dict.)

Fixes #613.

Copy link
Contributor

@brandur-stripe brandur-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And tests even!

LGTM.

@ob-stripe
Copy link
Contributor Author

ob-stripe commented Sep 12, 2019

Thanks Brandur!

And tests even!

Haha yeah, this is somewhat difficult to test, you need to have dicts with enough elements that statistically the test would fail if order was not guaranteed.

@ob-stripe ob-stripe merged commit 3526083 into master Sep 12, 2019
@ob-stripe ob-stripe deleted the ob-use-ordereddict branch September 12, 2019 22:10
@ob-stripe
Copy link
Contributor Author

Released as 2.36.2.

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

Successfully merging this pull request may close these issues.

Feature request: Honor order of metadata keys
3 participants