Skip to content

Commit

Permalink
fix(mm): Replace deprecated Marshmallow Field parameters
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stevenpackardblp committed Apr 9, 2022
1 parent 3264a00 commit 4830e2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dataclasses_json/mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
],
Expand Down

0 comments on commit 4830e2b

Please sign in to comment.