fix(mm): Replace deprecated Marshmallow Field parameters#351
fix(mm): Replace deprecated Marshmallow Field parameters#351stevenpackardblp wants to merge 1 commit intolidatong:masterfrom
Conversation
|
This would be nice to clean up the warning spews! |
|
In case anyone is seeing hundreds of errors, is waiting on this fix to be merged (and uses pytest) adding the following to a |
|
I would love for this fix to be merged! |
|
@stevenpackardblp please update your PR and we can merge ;) |
|
@stevenpackardblp another ping :) if no reply in a week I'll take over this PR and re-create it |
Let me refresh my workspace this week and see if I can get this rebased. Apologies for missing the first ping. |
|
it would be great if this could be merged 🙏 |
|
Agree, would be great if this could be addressed! |
4830e2b to
ef31090
Compare
|
@george-zubrienko big apologies for the delay, I just rebased it. |
|
rebased again. |
|
It would be great to get this merged, so the deprecation warnings can finally be addressed 🙏 |
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. fixes: lidatong#328
|
rebased again |
|
It would be possible to solve the other issues with marshmallow4 ? |
|
Wondering if it is as simple as diff --git a/dataclasses_json/mm.py b/dataclasses_json/mm.py
index 9cfacf1..cecd3b0 100644
--- a/dataclasses_json/mm.py
+++ b/dataclasses_json/mm.py
@@ -248,7 +248,7 @@ def build_type(type_, options, mixin, field, cls):
options['field_many'] = bool(
_is_supported_generic(field.type) and _is_collection(
field.type))
- return fields.Nested(type_.schema(), **options)
+ return fields.Nested(type_.schema(), metadata=options)
else:
warnings.warn(f"Nested dataclass field {field.name} of type "
f"{field.type} detected in " |
In Marshmallow 3.13.0, the
defaultandmissingparameters of theFieldobject were deprecated and replaced withdump_defaultandload_defaultrespectively. As these are new parameters added inversion 3.13.0, the minimum version requirement is bumped accordingly.
fixes: #328