Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default and missing properties #2702

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions src/marshmallow/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,48 +418,6 @@ def context(self):
"""The context dictionary for the parent :class:`Schema`."""
return self.parent.context

# the default and missing properties are provided for compatibility and
# emit warnings when they are accessed and set
@property
def default(self):
warnings.warn(
"The 'default' attribute of fields is deprecated. "
"Use 'dump_default' instead.",
RemovedInMarshmallow4Warning,
stacklevel=2,
)
return self.dump_default

@default.setter
def default(self, value):
warnings.warn(
"The 'default' attribute of fields is deprecated. "
"Use 'dump_default' instead.",
RemovedInMarshmallow4Warning,
stacklevel=2,
)
self.dump_default = value

@property
def missing(self):
warnings.warn(
"The 'missing' attribute of fields is deprecated. "
"Use 'load_default' instead.",
RemovedInMarshmallow4Warning,
stacklevel=2,
)
return self.load_default

@missing.setter
def missing(self, value):
warnings.warn(
"The 'missing' attribute of fields is deprecated. "
"Use 'load_default' instead.",
RemovedInMarshmallow4Warning,
stacklevel=2,
)
self.load_default = value


class Raw(Field):
"""Field that applies no formatting."""
Expand Down
Loading