Skip to content

DOC: fix PR01,SA01,ES01 for pandas.errors.AbstractMethodError #59679

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

Merged
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.var SA01" \
-i "pandas.date_range RT03" \
-i "pandas.errors.AbstractMethodError PR01,SA01" \
-i "pandas.errors.AttributeConflictWarning SA01" \
-i "pandas.errors.CSSWarning SA01" \
-i "pandas.errors.CategoricalConversionWarning SA01" \
Expand Down
24 changes: 24 additions & 0 deletions pandas/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,30 @@ class AbstractMethodError(NotImplementedError):
"""
Raise this error instead of NotImplementedError for abstract methods.

The `AbstractMethodError` is designed for use in classes that follow an abstract
base class pattern. By raising this error in the method, it ensures that a subclass
must implement the method to provide specific functionality. This is useful in a
framework or library where certain methods must be implemented by the user to
ensure correct behavior.

Parameters
----------
class_instance : object
The instance of the class where the abstract method is being called.
methodtype : str, default "method"
A string indicating the type of method that is abstract.
Must be one of {"method", "classmethod", "staticmethod", "property"}.

See Also
--------
api.extensions.ExtensionArray
An example of a pandas extension mechanism that requires implementing
specific abstract methods.
NotImplementedError
A built-in exception that can also be used for abstract methods but lacks
the specificity of `AbstractMethodError` in indicating the need for subclass
implementation.

Examples
--------
>>> class Foo:
Expand Down
Loading