dataclasses-json icon indicating copy to clipboard operation
dataclasses-json copied to clipboard

Deprecation errors when using marshmallow 3.10.0

Open thedjinn opened this issue 3 years ago • 1 comments

I'm getting deprecation warnings when using dataclasses-json with marshmallow 3.10.0. See the following backtrace. Looks like the problem is triggered by the fields.Nested() invocation.

/usr/local/lib/python3.8/site-packages/dataclasses_json/api.py:100: in schema
    Schema = build_schema(cls, DataClassJsonMixin, infer_missing, partial)
/usr/local/lib/python3.8/site-packages/dataclasses_json/mm.py:359: in build_schema
    schema_ = schema(cls, mixin, infer_missing)
/usr/local/lib/python3.8/site-packages/dataclasses_json/mm.py:310: in schema
    t = build_type(type_, options, mixin, field, cls)
/usr/local/lib/python3.8/site-packages/dataclasses_json/mm.py:275: in build_type
    return inner(type_, options)
/usr/local/lib/python3.8/site-packages/dataclasses_json/mm.py:252: in inner
    args = [inner(a, {}) for a in getattr(type_, '__args__', []) if
/usr/local/lib/python3.8/site-packages/dataclasses_json/mm.py:252: in <listcomp>
    args = [inner(a, {}) for a in getattr(type_, '__args__', []) if
/usr/local/lib/python3.8/site-packages/dataclasses_json/mm.py:240: in inner
    return fields.Nested(type_.schema(), **options)
/usr/local/lib/python3.8/site-packages/marshmallow/fields.py:516: in __init__
    super().__init__(default=default, **kwargs)
/usr/local/lib/python3.8/site-packages/marshmallow/fields.py:195: in __init__
    warnings.warn(
E   marshmallow.warnings.RemovedInMarshmallow4Warning: Passing field metadata as a keyword arg is deprecated. Use the explicit `metadata=...` argument instead.

thedjinn avatar Feb 01 '21 12:02 thedjinn

for context, I think lovasoa/marshmallow_dataclass#119 are also running into that problem. I guess the solution could be the same (at least in spirit / approach).

patzm avatar Jul 01 '21 14:07 patzm

Marshmallow minimum has been upgraded, closing as obsolete - reopen if still a thing.

george-zubrienko avatar Jul 20 '23 22:07 george-zubrienko