diff --git a/AUTHORS.rst b/AUTHORS.rst index c9439dfa4..5b1f7b743 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -163,4 +163,5 @@ Contributors (chronological) - Javier Fernández `@jfernandz `_ - Michael Dimchuk `@michaeldimchuk `_ - Jochen Kupperschmidt `@homeworkprod `_ -- `@yourun-proger `_ \ No newline at end of file +- `@yourun-proger `_ +- Ryan Morehart '@traherom `_ diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 196e1cf1c..d9fb7c43f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,7 +8,9 @@ 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 + 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`). diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py index 19437e170..ad388c754 100644 --- a/src/marshmallow/fields.py +++ b/src/marshmallow/fields.py @@ -216,8 +216,9 @@ def __init__( self.metadata = {**metadata, **additional_metadata} if additional_metadata: warnings.warn( - "Passing field metadata as a keyword arg is deprecated. Use the " - "explicit `metadata=...` argument instead.", + "Passing field metadata as keyword arguments is deprecated. Use the " + "explicit `metadata=...` argument instead. " + f"Additional metadata: {additional_metadata}", RemovedInMarshmallow4Warning, )