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

Fast List(Nested) #1306

Merged
merged 4 commits into from Aug 2, 2019
Merged

Conversation

deckar01
Copy link
Member

@deckar01 deckar01 commented Jul 17, 2019

Allow List(Nested) to hit the schema.dump(many)/schema.load(many) fast paths that Nested(many) uses.

Helps #779

src/marshmallow/fields.py Outdated Show resolved Hide resolved
valid_data = self.schema.load(value, unknown=self.unknown, partial=partial)
many = self.many or many
valid_data = self.schema.load(
value, unknown=self.unknown, partial=partial, many=many
Copy link
Member Author

@deckar01 deckar01 Jul 17, 2019

Choose a reason for hiding this comment

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

I found it odd that load() wasn't actually passing many to schema.load() before, but dump() was. It turns out Nested sets schema.many when it builds its own schema instance, so the many in dump() was redundant before, but it is useful on both now.

@sloria sloria added this to the 3.0 milestone Aug 1, 2019
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.

None yet

3 participants