Skip to content

DOC: Fixing EX01 - Added examples #54168

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 2 commits into from
Jul 17, 2023
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
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Partially validate docstrings (EX01)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX01 --ignore_functions \
pandas.errors.AccessorRegistrationWarning \
pandas.errors.AttributeConflictWarning \
pandas.errors.DataError \
pandas.errors.IncompatibilityWarning \
pandas.errors.InvalidComparison \
pandas.errors.IntCastingNaNError \
Expand Down
1 change: 0 additions & 1 deletion doc/source/reference/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Exceptions and warnings
:toctree: api/

errors.AbstractMethodError
errors.AccessorRegistrationWarning
errors.AttributeConflictWarning
errors.CategoricalConversionWarning
errors.ChainedAssignmentError
Expand Down
25 changes: 18 additions & 7 deletions pandas/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,6 @@ class MergeError(ValueError):
"""


class AccessorRegistrationWarning(Warning):
"""
Warning for attribute conflicts in accessor registration.
"""


class AbstractMethodError(NotImplementedError):
"""
Raise this error instead of NotImplementedError for abstract methods.
Expand Down Expand Up @@ -281,6 +275,13 @@ class DataError(Exception):

For example, calling ``ohlc`` on a non-numerical column or a function
on a rolling window.

Examples
--------
>>> ser = pd.Series(['a', 'b', 'c'])
>>> ser.rolling(2).sum()
Traceback (most recent call last):
DataError: No numeric types to aggregate
"""


Expand Down Expand Up @@ -552,6 +553,17 @@ class AttributeConflictWarning(Warning):
Occurs when attempting to append an index with a different
name than the existing index on an HDFStore or attempting to append an index with a
different frequency than the existing index on an HDFStore.

Examples
--------
>>> idx1 = pd.Index(['a', 'b'], name='name1')
>>> df1 = pd.DataFrame([[1, 2], [3, 4]], index=idx1)
>>> df1.to_hdf('file', 'data', 'w', append=True) # doctest: +SKIP
>>> idx2 = pd.Index(['c', 'd'], name='name2')
>>> df2 = pd.DataFrame([[5, 6], [7, 8]], index=idx2)
>>> df2.to_hdf('file', 'data', 'a', append=True) # doctest: +SKIP
AttributeConflictWarning: the [index_name] attribute of the existing index is
[name1] which conflicts with the new [name2]...
"""


Expand Down Expand Up @@ -644,7 +656,6 @@ class InvalidComparison(Exception):

__all__ = [
"AbstractMethodError",
"AccessorRegistrationWarning",
"AttributeConflictWarning",
"CategoricalConversionWarning",
"ClosedFileError",
Expand Down