ModelChimp / modelchimp

Experiment tracking for machine and deep learning projects
https://www.modelchimp.com/
BSD 2-Clause "Simplified" License
126 stars 12 forks source link

Update marshmallow to 3.20.1 #1186

Open pyup-bot opened 1 year ago

pyup-bot commented 1 year ago

This PR updates marshmallow from 2.19.5 to 3.20.1.

Changelog ### 3.20.1 ``` ******************* Bug fixes: - Fix call to ``get_declared_fields``: pass ``dict_cls`` again (:issue:`2152`). Thanks :user:`Cheaterman` for reporting. ``` ### 3.20.0 ``` ******************* Features: - Add ``absolute`` parameter to ``URL`` validator and ``Url`` field (:pr:`2123`). Thanks :user:`sirosen` for the PR. - Use Abstract Base Classes to define ``FieldABC`` and ``SchemaABC`` (:issue:`1449`). Thanks :user:`aditkumar72` for the PR. - Use `OrderedSet` as default `set_class`. Schemas are now ordered by default. (:issue:`1744`) Bug fixes: - Handle ``OSError`` and ``OverflowError`` in ``utils.from_timestamp`` (:pr:`2102`). Thanks :user:`TheBigRoomXXL` for the PR. - Fix the default inheritance of nested partial schemas (:issue:`2149`). Thanks :user:`matejsp` for reporting. Other changes: - Officially support Python 3.11 (:pr:`2067`). - Drop support for Python 3.7 (:pr:`2135`). ``` ### 3.19.0 ``` ******************* Features: - Add ``timestamp`` and ``timestamp_ms`` formats to ``fields.DateTime`` (:issue:`612`). Thanks :user:`vgavro` for the suggestion and thanks :user:`vanHoi` for the PR. ``` ### 3.18.0 ``` ******************* Features: - Add ``Enum`` field (:pr:`2017`) and (:pr:`2044`). Bug fixes: - Fix typing in ``Field._serialize`` signature (:pr:`2046`). ``` ### 3.17.1 ``` ******************* Bug fixes: - Add return type to ``fields.Email.__init__`` (:pr:`2018`). Thanks :user:`kkirsche` for the PR. - Add missing type hint to IPInterface __init__ (:pr:`2036`). ``` ### 3.17.0 ``` ******************* Features: - Support serialization as float in ``TimeDelta`` field (:pr:`1998`). Thanks :user:`marcosatti` for the PR. - Add ``messages_dict`` property to ``ValidationError`` to facilitate type checking (:pr:`1976`). Thanks :user:`sirosen` for the PR. ``` ### 3.16.0 ``` ******************* Features: - Raise ``ValueError`` if an invalid value is passed to the ``unknown`` argument (:issue:`1721`, :issue:`1732`). Thanks :user:`sirosen` for the PR. Other changes: - Set lower bound for ``packaging`` requirement (:issue:`1957`). Thanks :user:`MatthewNicolTR` for reporting and thanks :user:`sirosen` for the PR. - Improve warning messages by passing ``stacklevel`` (:pr:`1986`). Thanks :user:`tirkarthi` for the PR. ``` ### 3.15.0 ``` ******************* Features: - Allow passing a ``dict`` to ``fields.Nested`` (:pr:`1935`). Thanks :user:`sirosen` for the PR. Other changes: - Address distutils deprecation warning in Python 3.10 (:pr:`1903`). Thanks :user:`kkirsche` for the PR. - Add py310 to black target-version (:pr:`1921`). - Drop support for Python 3.6 (:pr:`1923`). - Use postponed evaluation of annotations (:pr:`1932`). Thanks :user:`Isira-Seneviratne` for the PR. ``` ### 3.14.1 ``` ******************* Bug fixes: - Fix publishing type hints per `PEP-561 <https://www.python.org/dev/peps/pep-0561/>`_ (:pr:`1905`). Thanks :user:`bwindsor` for the catch and patch. ``` ### 3.14.0 ``` ******************* Bug fixes: - Fix ``fields.TimeDelta`` serialization precision (:issue:`1865`). Thanks :user:`yarsanich` for reporting. Other changes: - Fix type-hints for ``data`` arg in ``Schema.validate`` to accept list of dictionaries (:issue:`1790`, :pr:`1868`). Thanks :user:`yourun-proger` for PR. - Improve warning when passing metadata as keyword arguments (:pr:`1882`). Thanks :user:`traherom` for the PR. - Don't build universal wheels. We don't support Python 2 anymore. (:issue:`1860`) Thanks :user:`YKdvd` for reporting. - Make the build reproducible (:pr:`1862`). - Drop support for Python 3.5 (:pr:`1863`). - Test against Python 3.10 (:pr:`1888`). ``` ### 3.13.0 ``` ******************* Features: - Replace ``missing``/``default`` field parameters with ``load_default``/``dump_default`` (:pr:`1742`). Thanks :user:`sirosen` for the PR. Deprecations: - The use of ``missing``/``default`` field parameters is deprecated and will be removed in marshmallow 4. ``load_default``/``dump_default`` should be used instead. ``` ### 3.12.2 ``` ******************* Bug fixes: - Don't expose ``Field``\s as ``Schema`` attributes. This reverts a change introduced in 3.12.0 that causes issues when field names conflict with ``Schema`` attributes or methods. ``Fields``\s are still accessible on a ``Schema`` instance through the ``fields`` attribute. (:pr:`1843`) ``` ### 3.12.1 ``` ******************* Bug fixes: - Fix bug that raised an ``AttributeError`` when instantiating a ``Schema`` with a field named ``parent`` (:issue:`1808`). Thanks :user:`flying-sheep` for reporting and helping with the fix. ``` ### 3.12.0 ``` ******************* Features: - Add ``validate.And`` (:issue:`1768`). Thanks :user:`rugleb` for the suggestion. - Add type annotations to ``marshmallow.decorators`` (:issue:`1788`, :pr:`1789`). Thanks :user:`michaeldimchuk` for the PR. - Let ``Field``\s be accessed by name as ``Schema`` attributes (:pr:`1631`). Other changes: - Improve types in ``marshmallow.validate`` (:pr:`1786`). - Make ``marshmallow.validate.Validator`` an abstract base class (:pr:`1786`). - Remove unnecessary list cast (:pr:`1785`). ``` ### 3.11.1 ``` ******************* Bug fixes: - Fix treatment of dotted keys when ``unknown=INCLUDE`` (:issue:`1506`). Thanks :user:`rbu` for reporting and thanks :user:`sirosen` for the fix (:pr:`1745`). ``` ### 3.11.0 ``` ******************* Features: - Add ``fields.IPInterface``, ``fields.IPv4Interface``, and ``IPv6Interface`` (:issue:`1733`). Thanks :user:`madeinoz67` for the suggestion and the PR. - Raise ``AttributeError`` for missing methods when using ``fields.Method`` (:pr:`1675`). Thanks :user:`lassandroan`. Other changes: - Remove unnecessary ``hasattr`` and ``getattr`` checks in ``Field`` (:pr:`1770`). ``` ### 3.10.0 ``` ******************* Deprecations: - Passing field metadata via keyword arguments is deprecated and will be removed in marshmallow 4 (:issue:`1350`). Use the explicit ``metadata=...`` argument instead. Thanks :user:`sirosen`. ``` ### 3.9.1 ``` ****************** Bug fixes: - Cast to mapping type in ``Mapping.serialize`` and ``Mapping.deserialize`` (:pr:`1685`). - Fix bug letting ``Dict`` pass invalid dict on deserialization when no key or value ``Field`` is specified (:pr:`1685`). ``` ### 3.9.0 ``` ****************** Features: - Add ``format`` argument to ``fields.Time`` and ``timeformat`` ``class Meta`` option (:issue:`686`). Thanks :user:`BennyAlex` for the suggestion and thanks :user:`infinityxxx` for the PR. Other changes: - Remove usage of implicit ``typing.Optional`` (:issue:`1663`). Thanks :user:`nadega` for the PR. ``` ### 3.8.0 ``` ****************** Features: - Add ``fields.IP``, ``fields.IPv4`` and ``fields.IPv6`` (:pr:`1485`). Thanks :user:`mgetka` for the PR. Bug fixes: - Fix typing in ``AwareDateTime`` (:pr:`1658`). Thanks :user:`adithyabsk` for reporting. ``` ### 3.7.1 ``` ****************** Bug fixes: - ``fields.Boolean`` correctly serializes non-hashable types (:pr:`1633`). Thanks :user:`jun0jang` for the PR. ``` ### 3.7.0 ``` ****************** Deprecations: - ``marshmallow.pprint`` is deprecated and will be removed in marshmallow 4 (:issue:`1588`). Support: - Document ``default_error_messages`` on field classes (:pr:`1619`). Thanks :user:`weeix`. Bug fixes: - Fix passing ``only`` and ``exclude`` to ``Nested`` with an ordered ``Schema`` (:pr:`1627`). Thanks :user:`juannorris` for the PR. ``` ### 3.6.1 ``` ****************** No code changes--only docs and contributor-facing updates in this release. Support: - Documentation: improve custom fields example (:issue:`1538`). Thanks :user:`pablospizzamiglio` for reporting the problem with the old example and thanks :user:`Resinderate` for the PR. - Documentation: Split up API reference into multiple pages and add summary tables (:pr:`1587`). Thanks :user:`EpicWink` for the PR. ``` ### 3.6.0 ``` ****************** Features: - Add ``validate.ContainsNoneOf`` (:issue:`1528`). Thanks :user:`Resinderate` for the suggestion and the PR. ``` ### 3.5.2 ``` ****************** Bug fixes: - Fix typing in ``class_registry`` (:pr:`1574`). Thanks :user:`mahenzon`. ``` ### 3.5.1 ``` ****************** Bug fixes: - Includes bug fix from 2.21.0. ``` ### 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`). ``` ### 3.1.1 ``` ++++++++++++++++++ Bug fixes: - Restore inheritance hierarchy of ``Number`` fields (:pr:`1403`). ``fields.Integer`` and ``fields.Decimal`` inherit from ``fields.Number``. - Fix bug that raised an uncaught error when a nested schema instance had an unpickleable object in its context (:issue:`1404`). Thanks :user:`metheoryt` for reporting. ``` ### 3.1.0 ``` ++++++++++++++++++ Features: - Add more type annotations (:issue:`663`). Type information is distributed per `PEP 561 <https://www.python.org/dev/peps/pep-0561/>`_ . Thanks :user:`fuhrysteve` for helping with this. Bug fixes: - Includes bug fix from 2.20.5. ``` ### 3.0.5 ``` ++++++++++++++++++ Bug fixes: - Fix bug that raised an uncaught error when passing both a schema instance and ``only`` to ``Nested`` (:pr:`1395`). This bug also affected passing a schema instance to ``fields.Pluck``. ``` ### 3.0.4 ``` ++++++++++++++++++ Bug fixes: - Fix propagating dot-delimited ``only`` and ``exclude`` parameters to nested schema instances (:issue:`1384`). - Includes bug fix from 2.20.4 (:issue:`1160`). ``` ### 3.0.3 ``` ++++++++++++++++++ Bug fixes: - Handle when ``data_key`` is an empty string (:issue:`1378`). Thanks :user:`jtrakk` for reporting. ``` ### 3.0.2 ``` ++++++++++++++++++ Bug fixes: - Includes bug fix from 2.20.3 (:pr:`1376`). - Fix incorrect ``super()`` call in ``SchemaMeta.__init__`` (:pr:`1362`). ``` ### 3.0.1 ``` ++++++++++++++++++ Bug fixes: - Fix bug when nesting ``fields.DateTime`` within ``fields.List`` or ``fields.Tuple`` (:issue:`1357`). This bug was introduced in 3.0.0rc9. Thanks :user:`zblz` for reporting. ``` ### 3.0.0 ``` ++++++++++++++++++ Features: - Optimize ``List(Nested(...))`` (:issue:`779`). - Minor performance improvements and cleanup (:pr:`1328`). - Add ``Schema.from_dict`` (:issue:`1312`). Deprecations/Removals: - ``Field.fail`` is deprecated. Use ``Field.make_error`` instead. - Remove UUID validation from ``fields.UUID``, for consistency with other fields (:issue:`1132`). Support: - Various docs improvements (:pr:`1329`). ``` ### 3.0.0rc9 ``` +++++++++++++++++++++ Features: - *Backwards-incompatible*: Validation does not occur on serialization (:issue:`1132`). This significantly improves serialization performance. - *Backwards-incompatible*: ``DateTime`` does not affect timezone information on serialization and deserialization (:issue:`1234`, :pr:`1278`). - Add ``NaiveDateTime`` and ``AwareDateTime`` to enforce timezone awareness (:issue:`1234`, :pr:`1287`). - *Backwards-incompatible*: ``List`` does not wrap single values in a list on serialization (:pr:`1307`). - *Backwards-incompatible*: ``Schema.handle_error`` receives ``many`` and ``partial`` as keyword arguments (:pr:`1321`). - Use ``raise from`` more uniformly to improve stack traces (:pr:`1313`). - Rename ``Nested.__schema`` to ``Nested._schema`` to prevent name mangling (:issue:`1289`). - Performance improvements (:pr:`1309`). Deprecations/Removals: - ``LocalDateTime`` is removed (:issue:`1234`). - ``marshmallow.utils.utc`` is removed. Use ``datetime.timezone.utc`` instead. Bug fixes: - Fix behavior of ``List(Nested("self"))`` (`779 (comment) <https://github.com/marshmallow-code/marshmallow/issues/779#issuecomment-396354987>`_). Support: - Document usage of ``validate.Regexp``'s usage ``re.search`` (:issue:`1285`). Thanks :user:`macdonaldezra`. ``` ### 3.0.0rc8 ``` +++++++++++++++++++++ Features: - Propagate ``only`` and ``exclude`` parameters to ``Nested`` fields within ``List`` and ``Dict`` (:issue:`779`, :issue:`946`). - Use ``email.utils.parsedate_to_datetime`` instead of conditionally using dateutil for parsing RFC dates (:pr:`1246`). - Use internal util functions instead of conditionally using dateutil for parsing ISO 8601 datetimes, dates and times. Timezone info is now correctly deserialized whether or not dateutil is installed. (:pr:`1265`) - Improve error messages for ``validate.Range``. - Use ``raise from error`` for better stack traces (:pr:`1254`). Thanks :user:`fuhrysteve`. - python-dateutil is no longer used. This resolves the inconsistent behavior based on the presence of python-dateutil (:issue:`497`, :issue:`1234`). Bug fixes: - Fix method resolution for ``__init__`` method of ``fields.Email`` and ``fields.URL`` (:issue:`1268`). Thanks :user:`dursk` for the catch and patch. - Includes bug fixes from 2.19.4 and 2.19.5. Other changes: - *Backwards-incompatible*: Rename ``fields.List.container`` to ``fields.List.inner``, ``fields.Dict.key_container`` to ``fields.Dict.key_field``, and ``fields.Dict.value_container`` to ``fields.Dict.value_field``. - Switch to Azure Pipelines for CI (:issue:`1261`). ``` ### 3.0.0rc7 ``` +++++++++++++++++++++ Features: - *Backwards-incompatible*: ``many`` is passed as a keyword argument to methods decorated with ``pre_load``, ``post_load``, ``pre_dump``, ``post_dump``, and ``validates_schema``. ``partial`` is passed as a keyword argument to methods decorated with ``pre_load``, ``post_load`` and ``validates_schema``. ``**kwargs`` should be added to all decorated methods. - Add ``min_inclusive`` and ``max_exclusive`` parameters to ``validate.Range`` (:issue:`1221`). Thanks :user:`kdop` for the PR. Bug fixes: - Fix propagation of ``partial`` to ``Nested`` containers (part of :issue:`779`). - Includes bug fix from 2.19.3. Other changes: - *Backwards-incompatible*: Use keyword-only arguments (:issue:`1216`). ``` ### 3.0.0rc6 ``` +++++++++++++++++++++ Support: - *Backwards-incompatible*: Remove support for Python 2 (:issue:`1120`). Only Python>=3.5 is supported. Thank you :user:`rooterkyberian` for the suggestion and the PR. - *Backwards-incompatible*: Remove special-casing in ``fields.List`` and ``fields.Tuple`` for accessing nested attributes (:pr:`1188`). Use ``fields.List(fields.Pluck(...))`` instead. - Add ``python_requires`` to ``setup.py`` (:pr:`1194`). Thanks :user:`hugovk`. - Upgrade syntax with ``pyupgrade`` in pre-commit (:pr:`1195`). Thanks again :user:`hugovk`. ``` ### 3.0.0rc5 ``` +++++++++++++++++++++ Features: - Allow input value to be included in error messages for a number of fields (:pr:`1129`). Thanks :user:`hdoupe` for the PR. - Improve default error messages for ``OneOf`` and ``ContainsOnly`` (:issue:`885`). Thanks :user:`mcgfeller` for the suggestion and :user:`maxalbert` for the PR. Deprecations/Removals: - Remove ``fields.FormattedString`` (:issue:`1141`). Use ``fields.Function`` or ``fields.Method`` instead. Bug fixes: - Includes bug fix from 2.19.2. ``` ### 3.0.0rc4 ``` +++++++++++++++++++++ Features: - Add ``fields.Tuple`` (:issue:`1103`) Thanks :user:`zblz` for the PR. - Add ``fields.Mapping``, which makes it easier to support other mapping types (e.g. ``OrderedDict``) (:issue:`1092`). Thank :user:`sayanarijit` for the suggestion and the PR. ``` ### 3.0.0rc3 ``` +++++++++++++++++++++ Features: - Make the error messages for "unknown fields" and "invalid data type" configurable (:issue:`852`). Thanks :user:`Dunstrom` for the PR. - ``fields.Boolean`` parses ``"yes"``/``"no"`` values (:pr:`1081`). Thanks :user:`r1b`. Other changes: - *Backwards-incompatible with previous 3.x versions*: Change ordering of ``keys`` and ``values`` arguments to ``fields.Dict``. - Remove unused code in ``marshmallow.utils``: ``is_indexable_but_not_string``, ``float_to_decimal``, ``decimal_to_fixed``, ``from_iso`` (:pr:`1088`). - Remove unused ``marshmallow.compat.string_types``. Bug fixes: - Includes bug fix from 2.18.0. ``` ### 3.0.0rc2 ``` +++++++++++++++++++++ Features: - Add ``register`` *class Meta* option to allow bypassing marshmallow's internal class registry when memory usage is critical (:issue:`660`). Bug fixes: - Fix serializing dict-like objects with properties (:issue:`1060`). Thanks :user:`taion` for the fix. - Fix populating ``ValidationError.valid_data`` for ``List`` and ``Dict`` fields (:issue:`766`). Other changes: - Add ``marshmallow.__version_info__`` (:pr:`1074`). - Remove the ``marshmallow.marshalling`` internal module (:pr:`1070`). - A ``ValueError`` is raised when the ``missing`` parameter is passed for required fields (:issue:`1040`). - Extra keyword arguments passed to ``ValidationError`` in validators are no longer passed to the final ``ValidationError`` raised upon validation completion (:issue:`996`). ``` ### 3.0.0rc1 ``` +++++++++++++++++++++ Features: - *Backwards-incompatible*: Rework ``ValidationError`` API. It now expects a single field name, and error structures are merged in the final ``ValidationError`` raised when validation completes. This allows schema-level validators to raise errors for individual fields (:issue:`441`). Thanks :user:`maximkulkin` for writing the original ``merge_errors`` implementation in :pr:`442` and thanks :user:`lafrech` for completing the implementation in :pr:`1026`. Bug fixes: - Fix ``TypeError`` when serializing ``None`` with ``Pluck`` (:pr:`1049`). Thanks :user:`toffan` for the catch and patch. ``` ### 3.0.0b20 ``` +++++++++++++++++++++ Bug fixes: - Includes bug fixes from 2.16.2 and 2.16.3. ``` ### 3.0.0b19 ``` +++++++++++++++++++++ Features: - Support partial loading of nested fields (:pr:`438`). Thanks :user:`arbor-dwatson` for the PR. *Note*: Subclasses of ``fields.Nested`` now take an additional ``partial`` parameter in the ``_deserialize`` method. Bug fixes: - Restore ``Schema.TYPE_MAPPING``, which was removed in 3.0.0b17 (:issue:`1012`). Other changes: - *Backwards-incompatible*: ``_serialize`` and ``_deserialize`` methods of all ``fields.Field`` subclasses must accept ``**kwargs`` (:pr:`1007`). ``` ### 3.0.0b18 ``` +++++++++++++++++++++ Bug fixes: - Fix ``Date`` deserialization when using custom format (:issue:`1001`). Thanks :user:`Ondkloss` for reporting. Deprecations/Removals: - ``prefix`` parameter or ``Schema`` class is removed (:issue:`991`). The same can be achieved using a ``post_dump`` method. ``` ### 3.0.0b17 ``` +++++++++++++++++++++ Features: - Add ``format`` option to ``Date`` field (:pr:`869`). - *Backwards-incompatible*: Rename ``DateTime``'s ``dateformat`` Meta option to ``datetimeformat``. ``dateformat`` now applies to ``Date`` (:pr:`869`). Thanks :user:`knagra` for implementing these changes. - Enforce ISO 8601 when deserializing date and time (:issue:`899`). Thanks :user:`dushr` for the report and the work on the PR. - *Backwards-incompatible*: Raise ``ValueError`` on ``Schema`` instantiation in case of ``attribute`` or ``data_key`` collision (:pr:`992`). Bug fixes: - Fix inconsistencies in field inference by refactoring the inference feature into a dedicated field (:issue:`809`). Thanks :user:`taion` for the PR. - When ``unknown`` is not passed to ``Nested``, default to nested ``Schema`` ``unknown`` meta option rather than ``RAISE`` (:pr:`963`). Thanks :user:`vgavro` for the PR. - Fix loading behavior of ``fields.Pluck`` (:pr:`990`). - Includes bug fix from 2.16.0. ``` ### 3.0.0b16 ``` +++++++++++++++++++++ Bug fixes: - Fix ``root`` attribute for nested container fields on inheriting schemas (:issue:`956`). Thanks :user:`bmcbu` for reporting. ``` ### 3.0.0b15 ``` +++++++++++++++++++++ Bug fixes: - Raise ``ValidationError`` instead of ``TypeError`` when non-iterable types are validated with ``many=True`` (:issue:`851`). - ``many=True`` no longer iterates over ``str`` and ``collections.abc.Mapping`` objects and instead raises a ``ValidationError`` with ``{'_schema': ['Invalid input type.']}`` (:issue:`930`). - Return ``[]`` as ``ValidationError.valid_data`` instead of ``{}`` when ``many=True`` (:issue:`907`). Thanks :user:`tuukkamustonen` for implementing these changes. ``` ### 3.0.0b14 ``` +++++++++++++++++++++ Features: - Add ``fields.Pluck`` for serializing a single field from a nested object (:issue:`800`). Thanks :user:`timc13` for the feedback and :user:`deckar01` for the implementation. - *Backwards-incompatible*: Passing a string argument as ``only`` to ``fields.Nested`` is no longer supported. Use ``fields.Pluck`` instead (:issue:`800`). - Raise a ``StringNotCollectionError`` if ``only`` or ``exclude`` is passed as a string to ``fields.Nested`` (:pr:`931`). - *Backwards-incompatible*: ``Float`` takes an ``allow_nan`` parameter to explicitly allow serializing and deserializing special values (``nan``, ``inf`` and ``-inf``). ``allow_nan`` defaults to ``False``. Other changes: - *Backwards-incompatible*: ``Nested`` field now defaults to ``unknown=RAISE`` instead of ``EXCLUDE``. This harmonizes behavior with ``Schema`` that already defaults to ``RAISE`` (:issue:`908`). Thanks :user:`tuukkamustonen`. - Tested against Python 3.7. ``` ### 3.0.0b13 ``` +++++++++++++++++++++ Bug fixes: - Errors reported by a schema-level validator for a field in a ``Nested`` field are stored under corresponding field name, not ``_schema`` key (:pr:`862`). - Includes bug fix from 2.15.4. Other changes: - *Backwards-incompatible*: The ``unknown`` option now defaults to ``RAISE`` (`524 (comment) <https://github.com/marshmallow-code/marshmallow/issues/524#issuecomment-397165731>`_, :issue:`851`). - *Backwards-incompatible*: When a schema error is raised with a ``dict`` as payload, the ``dict`` overwrites any existing error list. Before this change, it would be appended to the list. - Raise a `StringNotCollectionError` if ``only`` or ``exclude`` is passed as a string (:issue:`316`). Thanks :user:`paulocheque` for reporting. ``` ### 3.0.0b12 ``` +++++++++++++++++++++ Features: - The behavior to apply when encountering unknown fields while deserializing can be controlled with the ``unknown`` option (:issue:`524`, :issue:`747`, :issue:`127`). It makes it possible to either "include", "exclude", or "raise". Thanks :user:`tuukkamustonen` for the suggestion and thanks :user:`ramnes` for the PR. .. warning:: The default for ``unknown`` will be changed to ``RAISE`` in the next release. Other changes: - *Backwards-incompatible*: Pre/Post-processors MUST return modified data. Returning ``None`` does not imply data were mutated (:issue:`347`). Thanks :user:`tdevelioglu` for reporting. - *Backwards-incompatible*: ``only`` and ``exclude`` are bound by declared and additional fields. A ``ValueError`` is raised if invalid fields are passed (:issue:`636`). Thanks :user:`jan-23` for reporting. Thanks :user:`ikilledthecat` and :user:`deckar01` for the PRs. - Format code using pre-commit (:pr:`855`). Deprecations/Removals: - ``ValidationError.fields`` is removed (:issue:`840`). Access field instances from ``Schema.fields``. ``` ### 3.0.0b11 ``` +++++++++++++++++++++ Features: - Clean up code for schema hooks (:pr:`814`). Thanks :user:`taion`. - Minor performance improvement from simplifying ``utils.get_value`` (:pr:`811`). Thanks again :user:`taion`. - Add ``require_tld`` argument to ``fields.URL`` (:issue:`749`). Thanks :user:`DenerKup` for reporting and thanks :user:`surik00` for the PR. - ``fields.UUID`` deserializes ``bytes`` strings using ``UUID(bytes=b'...')`` (:pr:`625`). Thanks :user:`JeffBerger` for the suggestion and the PR. Bug fixes: - Fields nested within ``Dict`` correctly inherit context from their parent schema (:issue:`820`). Thanks :user:`RosanneZe` for reporting and :user:`deckar01` for the PR. - Includes bug fix from 2.15.3. ``` ### 3.0.0b10 ``` +++++++++++++++++++++ Bug fixes: - Includes bugfixes from 2.15.2. ``` ### 3.0.0b9 ``` ++++++++++++++++++++ Features: - *Backwards-incompatible*: ``missing`` and ``default`` values are passed in deserialized form (:issue:`378`). Thanks :user:`chadrik` for the suggestion and thanks :user:`lafrech` for the PR. Bug fixes: - Includes the bugfix from 2.15.1. ``` ### 3.0.0b8 ``` ++++++++++++++++++++ Features: - *Backwards-incompatible*: Add ``data_key`` parameter to fields for specifying the key in the input and output data dict. This parameter replaces both ``load_from`` and ``dump_to`` (:issue:`717`). Thanks :user:`lafrech`. - *Backwards-incompatible*: When ``pass_original=True`` is passed to one of the decorators and a collection is being (de)serialized, the ``original_data`` argument will be a single object unless ``pass_many=True`` is also passed to the decorator (:issue:`315`, :issue:`743`). Thanks :user:`stj` for the PR. - *Backwards-incompatible*: Don't recursively check nested required fields when the ``Nested`` field's key is missing (:issue:`319`). This reverts :pr:`235`. Thanks :user:`chekunkov` reporting and thanks :user:`lafrech` for the PR. - *Backwards-incompatible*: Change error message collection for ``Dict`` field (:issue:`730`). Note: this is backwards-incompatible with previous 3.0.0bX versions. Thanks :user:`shabble` for the report and thanks :user:`lafrech` for the PR. ``` ### 3.0.0b7 ``` ++++++++++++++++++++ Features: - *Backwards-incompatible*: Schemas are always strict (:issue:`377`). The ``strict`` parameter is removed. - *Backwards-incompatible*: ``Schema().load`` and ``Schema().dump`` return ``data`` instead of a ``(data, errors)`` tuple (:issue:`598`). - *Backwards-incomaptible*: ``Schema().load(None)`` raises a ``ValidationError`` (:issue:`511`). See :ref:`upgrading_3_0` for a guide on updating your code. Thanks :user:`lafrech` for implementing these changes. Special thanks to :user:`MichalKononenko`, :user:`douglas-treadwell`, and :user:`maximkulkin` for the discussions on these changes. Other changes: - *Backwards-incompatible*: Field name is not checked when ``load_from`` is specified (:pr:`714`). Thanks :user:`lafrech`. Support: - Add `Code of Conduct <https://marshmallow.readthedocs.io/en/dev/code_of_conduct.html>`_. ``` ### 3.0.0b6 ``` ++++++++++++++++++++ Bug fixes: - Fixes ``ValidationError.valid_data`` when a nested field contains errors (:issue:`710`). This bug was introduced in 3.0.0b3. Thanks :user:`lafrech`. Other changes: - *Backwards-incompatible*: ``Email`` and ``URL`` fields don't validate on serialization (:issue:`608`). This makes them more consistent with the other fields and improves serialization performance. Thanks again :user:`lafrech`. - ``validate.URL`` requires square brackets around IPv6 URLs (:issue:`707`). Thanks :user:`harlov`. ``` ### 3.0.0b5 ``` ++++++++++++++++++++ Features: - Add support for structured dictionaries by providing values and keys arguments to the ``Dict`` field's constructor. This mirrors the ``List`` field's ability to validate its items (:issue:`483`). Thanks :user:`deckar01`. Other changes: - *Backwards-incompatible*: ``utils.from_iso`` is deprecated in favor of ``utils.from_iso_datetime`` (:issue:`694`). Thanks :user:`sklarsa`. ``` ### 3.0.0b4 ``` ++++++++++++++++++++ Features: - Add support for millisecond, minute, hour, and week precisions to ``fields.TimeDelta`` (:issue:`537`). Thanks :user:`Fedalto` for the suggestion and the PR. - Includes features from release 2.14.0. Support: - Copyright year in docs uses ``CHANGELOG.rst``'s modified date for reproducible builds (:issue:`679`). Thanks :user:`bmwiedemann`. - Test against Python 3.6 in tox. Thanks :user:`Fedalto`. - Fix typo in exception message (:issue:`659`). Thanks :user:`wonderbeyond` for reporting and thanks :user:`yoichi` for the PR. ``` ### 3.0.0b3 ``` ++++++++++++++++++++ Features: - Add ``valid_data`` attribute to ``ValidationError``. - Add ``strict`` parameter to ``Integer`` (:issue:`667`). Thanks :user:`yoichi`. Deprecations/Removals: - Deprecate ``json_module`` option in favor of ``render_module`` (:issue:`364`, :issue:`130`). Thanks :user:`justanr` for the suggestion. Bug fixes: - Includes bug fixes from releases 2.13.5 and 2.13.6. - *Backwards-incompatible*: ``Number`` fields don't accept booleans as valid input (:issue:`623`). Thanks :user:`tuukkamustonen` for the suggestion and thanks :user:`rowillia` for the PR. Support: - Add benchmark script. Thanks :user:`rowillia`. ``` ### 3.0.0b2 ``` ++++++++++++++++++++ Features: - Add ``truthy`` and ``falsy`` params to ``fields.Boolean`` (:issue:`580`). Thanks :user:`zwack` for the PR. Note: This is potentially a breaking change if your code passes the `default` parameter positionally. Pass `default` as a keyword argument instead, e.g. ``fields.Boolean(default=True)``. Other changes: - *Backwards-incompatible*: ``validate.ContainsOnly`` allows empty and duplicate values (:issue:`516`, :issue:`603`). Thanks :user:`maximkulkin` for the suggestion and thanks :user:`lafrech` for the PR. Bug fixes: - Includes bug fixes from release 2.13.4. ``` ### 3.0.0b1 ``` ++++++++++++++++++++ Features: - ``fields.Nested`` respects ``only='field'`` when deserializing (:issue:`307`). Thanks :user:`erlingbo` for the suggestion and the PR. - ``fields.Boolean`` parses ``"on"``/``"off"`` (:issue:`580`). Thanks :user:`marcellarius` for the suggestion. Other changes: - Includes changes from release 2.13.2. - *Backwards-incompatible*: ``skip_on_field_errors`` defaults to ``True`` for ``validates_schema`` (:issue:`352`). ``` ### 3.0.0a1 ``` ++++++++++++++++++++ Features: - ``dump_only`` and ``load_only`` for ``Function`` and ``Method`` are set based on ``serialize`` and ``deserialize`` arguments (:issue:`328`). Other changes: - *Backwards-incompatible*: ``fields.Method`` and ``fields.Function`` no longer swallow ``AttributeErrors`` (:issue:`395`). Thanks :user:`bereal` for the suggestion. - *Backwards-incompatible*: ``validators.Length`` is no longer a subclass of ``validators.Range`` (:issue:`458`). Thanks :user:`deckar01` for the catch and patch. - *Backwards-incompatible*: ``utils.get_func_args`` no longer returns bound arguments. This is consistent with the behavior of ``inspect.signature``. This change prevents a DeprecationWarning on Python 3.5 (:issue:`415`, :issue:`479`). Thanks :user:`deckar01` for the PR. - *Backwards-incompatible*: Change the signature of ``utils.get_value`` and ``Schema.get_attribute`` for consistency with Python builtins (e.g. ``getattr``) (:issue:`341`). Thanks :user:`stas` for reporting and thanks :user:`deckar01` for the PR. - *Backwards-incompatible*: Don't unconditionally call callable attributes (:issue:`430`, reverts :issue:`242`). Thanks :user:`mirko` for the suggestion. - Drop support for Python 2.6 and 3.3. Deprecation/Removals: - Remove ``__error_handler__``, ``__accessor__``, ``Schema.error_handler``, and ``Schema.accessor``. Override ``Schema.handle_error`` and ``Schema.get_attribute`` instead. - Remove ``func`` parameter of ``fields.Function``. Remove ``method_name`` parameter of ``fields.Method`` (issue:`325`). Use the ``serialize`` parameter instead. - Remove ``extra`` parameter from ``Schema``. Use a ``post_dump`` method to add additional data. ``` ### 2.21.0 ``` +++++++++++++++++++ Bug fixes: - Don't match string-ending newlines in ``URL`` and ``Email`` fields (:issue:`1522`). Thanks :user:`nbanmp` for the PR. Other changes: - Drop support for Python 3.4 (:pr:`1525`). ``` ### 2.20.5 ``` +++++++++++++++++++ Bug fixes: - Fix behavior when a non-list collection is passed to the ``validate`` argument of ``fields.Email`` and ``fields.URL`` (:issue:`1400`). ``` ### 2.20.4 ``` +++++++++++++++++++ Bug fixes: - Respect the ``many`` value on ``Schema`` instances passed to ``Nested`` (:issue:`1160`). Thanks :user:`Kamforka` for reporting. ``` ### 2.20.3 ``` +++++++++++++++++++ Bug fixes: - Don't swallow ``TypeError`` exceptions raised by ``Field._bind_to_schema`` or ``Schema.on_bind_field`` (:pr:`1376`). ``` ### 2.20.2 ``` +++++++++++++++++++ Bug fixes: - Prevent warning about importing from ``collections`` on Python 3.7 (:pr:`1354`). Thanks :user:`nicktimko` for the PR. ``` ### 2.20.1 ``` +++++++++++++++++++ Bug fixes: - Fix bug that raised ``TypeError`` when invalid data type is passed to a nested schema with ``validates`` (:issue:`1342`). ``` ### 2.20.0 ``` +++++++++++++++++++ Bug fixes: - Fix deprecated functions' compatibility with Python 2 (:issue:`1337`). Thanks :user:`airstandley` for the catch and patch. - Fix error message consistency for invalid input types on nested fields (:issue:`1303`). This is a backport of the fix in :pr:`857`. Thanks :user:`cristi23` for the thorough bug report and the PR. Deprecation/Removal: - Python 2.6 is no longer officially supported (:issue:`1274`). ```
Links - PyPI: https://pypi.org/project/marshmallow - Changelog: https://pyup.io/changelogs/marshmallow/ - Repo: https://github.com/marshmallow-code/marshmallow