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

Remove ordered class Meta option #2704

Merged
merged 6 commits into from
Jan 1, 2025
Merged

Remove ordered class Meta option #2704

merged 6 commits into from
Jan 1, 2025

Conversation

sloria
Copy link
Member

@sloria sloria commented Dec 30, 2024

close #2146

@sloria sloria requested a review from lafrech December 30, 2024 20:32
Copy link
Member

@lafrech lafrech left a comment

Choose a reason for hiding this comment

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

Nice cleanup!

Should we add a test where OrderedDict is used as dict_class?

We may want to rename schema classes in test_options as they don't make much sense when everything schema is ordered. This is something I should have done in #1896 but I lazily postponed. It can wait a little more...

CHANGELOG.rst Outdated
@@ -35,6 +35,9 @@ As a consequence of this change:

Thanks :user:`ddelange` for the PR.

- The `ordered` class Meta option is removed. Set `Schema.dict_class` to `OrderedDict` to maintain the previous behavior.
Note that field order already preserved by default (:issue:`2146`).
Copy link
Member

Choose a reason for hiding this comment

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

s/field order already preserved/field order is already preserved

@lafrech lafrech added this to the 4.0 milestone Dec 30, 2024
@sloria
Copy link
Member Author

sloria commented Dec 31, 2024

Should we add a test where OrderedDict is used as dict_class?

looks like we already have one here

@pytest.mark.parametrize("dict_cls", (dict, OrderedDict))
def test_set_dict_class(dict_cls):

We may want to rename schema classes in test_options as they don't make much sense when everything schema is ordered.

good idea. done

@sloria sloria requested a review from lafrech December 31, 2024 19:43
@sloria sloria merged commit 4d3810c into 4.0 Jan 1, 2025
9 checks passed
@sloria sloria deleted the api-cleanup branch January 1, 2025 22:38
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.

2 participants