Skip to content

Commit

Permalink
DOC: fix PR01,SA01,ES01 for pandas.errors.AbstractMethodError (#59679)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuhinsharma121 authored Aug 31, 2024
1 parent 8566ff3 commit 078e11f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,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

0 comments on commit 078e11f

Please sign in to comment.