Skip to content

Fix Marshmallow Schema's Meta exclude field error#431

Merged
lafrech merged 1 commit intomarshmallow-code:devfrom
blagasz:dev
Apr 18, 2019
Merged

Fix Marshmallow Schema's Meta exclude field error#431
lafrech merged 1 commit intomarshmallow-code:devfrom
blagasz:dev

Conversation

@blagasz
Copy link
Copy Markdown

@blagasz blagasz commented Apr 11, 2019

Mixing tuple and list when collecting fields in the Marshmallow extension may result in error.

@lafrech
Copy link
Copy Markdown
Member

lafrech commented Apr 12, 2019

Good.

Do you think you could test all combinations ([dump_only; exclude] x [tuple; list])?

Also, there are CI failures.

You should use a set, not a tuple, in the test, as the order doesn't matter (or perhaps better add ordered=True to the schema Meta).

(Note: no need to close/recreate a PR, you can amend/rebase and then push -f.)

@blagasz
Copy link
Copy Markdown
Author

blagasz commented Apr 12, 2019 via email

@blagasz
Copy link
Copy Markdown
Author

blagasz commented Apr 12, 2019

pyupgrade and black fails but I don't really know from the log what their problem is.

@lafrech
Copy link
Copy Markdown
Member

lafrech commented Apr 12, 2019

Yes, the log is not verbose enough.

If you're using Python 3.6+ you can install pre-commit to do that locally before pushing.
https://github.com/marshmallow-code/apispec/blob/dev/CONTRIBUTING.rst

@lafrech
Copy link
Copy Markdown
Member

lafrech commented Apr 18, 2019

Sorry, I was not notified on the force-push.

I'd be tempted to factorize the tests using some obfuscating pytest parametrization trickery, but that's just personal taste/obsession. I can do that later on if I have spare time to waste.

I think this is good to merge.

Thanks.

@blagasz
Copy link
Copy Markdown
Author

blagasz commented Apr 18, 2019 via email

@lafrech lafrech merged commit 9c12274 into marshmallow-code:dev Apr 18, 2019
@lafrech
Copy link
Copy Markdown
Member

lafrech commented Apr 18, 2019

I did the rework and released in 1.2.1.

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