Marshmallow

Latest version: v3.21.2

Safety actively analyzes 623248 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 30

3.5.0

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

Bug fixes:

- Fix list of nullable nested fields ``List(Nested(Field, allow_none=True)``
(:issue:`1497`). Because this fix reverts an optimization introduced to
speed-up serialization and deserialization of lists of nested fields, a
negative impact on performance in this specific case is expected.

3.4.0

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

Features:

- Improve type coverage (:issue:`1479`). Thanks :user:`Reskov`.

Bug fixes:

- Fix typing for ``data`` param of ``Schema.load`` and ``ValidationError`` (:issue:`1492`).
Thanks :user:`mehdigmira` for reporting and thanks :user:`dfirst` for the PR.

Other changes:

- Remove unnecessary typecasts (:pr:`1500`). Thanks :user:`hukkinj1`.
- Remove useless ``_serialize`` override in ``UUID`` field (:pr:`1489`).

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`).

3.2.1

++++++++++++++++++

Bug fixes:

- Fix typing for ``Schema.dump[s]`` (:pr:`1416`).

3.2.0

++++++++++++++++++

Features:

- Add type annotations to ``marshmallow.schema`` and ``marshmallow.validate`` (:pr:`1407`, :issue:`663`).

Bug fixes:

- Fix compatibility with Python < 3.5.3 (:issue:`1409`). Thanks :user:`lukaszdudek-silvair` for reporting.

Refactoring:

- Remove unnecessary ``BaseSchema`` superclass (:pr:`1406`).

Page 6 of 30

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.