Skip to content

Update marshmallow to 3.3.0#188

Closed
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-marshmallow-3.2.1-to-3.3.0
Closed

Update marshmallow to 3.3.0#188
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-marshmallow-3.2.1-to-3.3.0

Conversation

@pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Dec 6, 2019

This PR updates marshmallow from 3.2.1 to 3.3.0.

Changelog

3.3.0

******************

Features:

- ``fields.Nested`` may take a callable that returns a schema instance.
Use this to resolve order-of-declaration issues when schemas nest each other (:issue:`1146`).

.. code-block:: python

  <3.3
 class AlbumSchema(Schema):
     title = fields.Str()
     artist = fields.Nested("ArtistSchema", only=("name",))


 class ArtistSchema(Schema):
     name = fields.Str()
     albums = fields.List(fields.Nested(AlbumSchema))


  >=3.3
 class AlbumSchema(Schema):
     title = fields.Str()
     artist = fields.Nested(lambda: ArtistSchema(only=("name",)))


 class ArtistSchema(Schema):
     name = fields.Str()
     albums = fields.List(fields.Nested(AlbumSchema))

Deprecations:

- Passing the string ``"self"`` to ``fields.Nested`` is deprecated.
Use a callable instead.

.. code-block:: python

 from marshmallow import Schema, fields

  <3.3
 class PersonSchema(Schema):
     partner = fields.Nested("self", exclude=("partner",))
     friends = fields.List(fields.Nested("self"))


  >=3.3
 class PersonSchema(Schema):
     partner = fields.Nested(lambda: PersonSchema(exclude=("partner")))
     friends = fields.List(fields.Nested(lambda: PersonSchema()))

Other changes:

- Fix typing for ``Number._format_num`` (:pr:`1466`). Thanks :user:`hukkinj1`.
- Make mypy stricter and remove dead code (:pr:`1467`). Thanks again, :user:`hukkinj1`.

3.2.2

******************

Bug fixes:

- Don't load fields for which ``load_only`` and ``dump_only`` are both ``True`` (:pr:`1448`).
- Fix types in ``marshmallow.validate`` (:pr:`1446`).

Support:

- Test against Python 3.8 (:pr:`1431`).
Links

@pyup-bot
Copy link
Collaborator Author

pyup-bot commented Feb 3, 2020

Closing this in favor of #206

@pyup-bot pyup-bot closed this Feb 3, 2020
@karma0 karma0 deleted the pyup-update-marshmallow-3.2.1-to-3.3.0 branch February 3, 2020 22:17
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.

1 participant