Skip to content

Commit 3829c94

Browse files
authored
DOC: Fix Docstring Errors for pandas.api.extensions.ExtensionArray (#58540)
* fix line too long * fix docstring errors for pandas.api.extensions.ExtensionArray._accumulate * fix SA01 error for pandas.api.extensions.ExtensionArray._concat_same_type * fix PR07 error for pandas.api.extensions.ExtensionArray._concat_same_type * fix docstring issues for pandas.api.extensions.ExtensionArray._formatter * delete extra lines * docstring errors fixed for pandas.api.extensions.ExtensionArray._from_sequence
1 parent d9a02be commit 3829c94

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

ci/code_checks.sh

-5
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
373373
-i "pandas.Timestamp.weekday SA01" \
374374
-i "pandas.Timestamp.weekofyear SA01" \
375375
-i "pandas.Timestamp.year GL08" \
376-
-i "pandas.api.extensions.ExtensionArray SA01" \
377-
-i "pandas.api.extensions.ExtensionArray._accumulate RT03,SA01" \
378-
-i "pandas.api.extensions.ExtensionArray._concat_same_type PR07,SA01" \
379-
-i "pandas.api.extensions.ExtensionArray._formatter SA01" \
380-
-i "pandas.api.extensions.ExtensionArray._from_sequence SA01" \
381376
-i "pandas.api.extensions.ExtensionArray._from_sequence_of_strings SA01" \
382377
-i "pandas.api.extensions.ExtensionArray._hash_pandas_object RT03,SA01" \
383378
-i "pandas.api.extensions.ExtensionArray._pad_or_backfill PR01,RT03,SA01" \

pandas/core/arrays/base.py

+43
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ class ExtensionArray:
158158
_values_for_argsort
159159
_values_for_factorize
160160
161+
See Also
162+
--------
163+
api.extensions.ExtensionDtype : A custom data type, to be paired with an
164+
ExtensionArray.
165+
api.extensions.ExtensionArray.dtype : An instance of ExtensionDtype.
166+
161167
Notes
162168
-----
163169
The interface includes the following abstract methods that must be
@@ -289,6 +295,13 @@ def _from_sequence(
289295
-------
290296
ExtensionArray
291297
298+
See Also
299+
--------
300+
api.extensions.ExtensionArray._from_sequence_of_strings : Construct a new
301+
ExtensionArray from a sequence of strings.
302+
api.extensions.ExtensionArray._hash_pandas_object : Hook for
303+
hash_pandas_object.
304+
292305
Examples
293306
--------
294307
>>> pd.arrays.IntegerArray._from_sequence([4, 5])
@@ -1707,6 +1720,17 @@ def _formatter(self, boxed: bool = False) -> Callable[[Any], str | None]:
17071720
when ``boxed=False`` and :func:`str` is used when
17081721
``boxed=True``.
17091722
1723+
See Also
1724+
--------
1725+
api.extensions.ExtensionArray._concat_same_type : Concatenate multiple
1726+
array of this dtype.
1727+
api.extensions.ExtensionArray._explode : Transform each element of
1728+
list-like to a row.
1729+
api.extensions.ExtensionArray._from_factorized : Reconstruct an
1730+
ExtensionArray after factorization.
1731+
api.extensions.ExtensionArray._from_sequence : Construct a new
1732+
ExtensionArray from a sequence of scalars.
1733+
17101734
Examples
17111735
--------
17121736
>>> class MyExtensionArray(pd.arrays.NumpyExtensionArray):
@@ -1783,11 +1807,21 @@ def _concat_same_type(cls, to_concat: Sequence[Self]) -> Self:
17831807
Parameters
17841808
----------
17851809
to_concat : sequence of this type
1810+
An array of the same dtype to concatenate.
17861811
17871812
Returns
17881813
-------
17891814
ExtensionArray
17901815
1816+
See Also
1817+
--------
1818+
api.extensions.ExtensionArray._explode : Transform each element of
1819+
list-like to a row.
1820+
api.extensions.ExtensionArray._formatter : Formatting function for
1821+
scalar values.
1822+
api.extensions.ExtensionArray._from_factorized : Reconstruct an
1823+
ExtensionArray after factorization.
1824+
17911825
Examples
17921826
--------
17931827
>>> arr1 = pd.array([1, 2, 3])
@@ -1838,11 +1872,20 @@ def _accumulate(
18381872
Returns
18391873
-------
18401874
array
1875+
An array performing the accumulation operation.
18411876
18421877
Raises
18431878
------
18441879
NotImplementedError : subclass does not define accumulations
18451880
1881+
See Also
1882+
--------
1883+
api.extensions.ExtensionArray._concat_same_type : Concatenate multiple
1884+
array of this dtype.
1885+
api.extensions.ExtensionArray.view : Return a view on the array.
1886+
api.extensions.ExtensionArray._explode : Transform each element of
1887+
list-like to a row.
1888+
18461889
Examples
18471890
--------
18481891
>>> arr = pd.array([1, 2, 3])

0 commit comments

Comments
 (0)