From 4830e2b2ab021341872de2c90ac8d7b364c2a25d Mon Sep 17 00:00:00 2001 From: Steven Packard Date: Sat, 9 Apr 2022 03:37:52 -0400 Subject: [PATCH] fix(mm): Replace deprecated Marshmallow Field parameters In Marshmallow 3.13.0, the `default` and `missing` parameters of the `Field` object were deprecated and replaced with `dump_default` and `load_default` respectively. As these are new parameters added in version 3.13.0, the minimum version requirement is bumped accordingly. fixes: #328 --- dataclasses_json/mm.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dataclasses_json/mm.py b/dataclasses_json/mm.py index 2125de6e..4b08e476 100644 --- a/dataclasses_json/mm.py +++ b/dataclasses_json/mm.py @@ -289,7 +289,7 @@ def schema(cls, mixin, infer_missing): else: type_ = field.type options = {} - missing_key = 'missing' if infer_missing else 'default' + missing_key = 'load_default' if infer_missing else 'dump_default' if field.default is not MISSING: options[missing_key] = field.default elif field.default_factory is not MISSING: diff --git a/setup.py b/setup.py index 6acd4ad0..ef369d7a 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ keywords='dataclasses json', install_requires=[ 'dataclasses;python_version=="3.6"', - 'marshmallow>=3.3.0,<4.0.0', + 'marshmallow>=3.13.0,<4.0.0', 'marshmallow-enum>=1.5.1,<2.0.0', 'typing-inspect>=0.4.0' ],