Skip to content

Commit e6a8ca8

Browse files
committed
DOC: Set remaining __module__ attributes
1 parent f7447cc commit e6a8ca8

40 files changed

+106
-4
lines changed

pandas/_config/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class RegisteredOption(NamedTuple):
101101

102102

103103
class OptionError(AttributeError, KeyError):
104+
__module__ = "pandas.errors"
104105
"""
105106
Exception raised for pandas.options.
106107

pandas/_libs/missing.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class NAType(C_NAType):
393393
>>> True | pd.NA
394394
True
395395
"""
396-
__module__ = "pandas"
396+
__module__ = "pandas.api.typing"
397397

398398
_instance = None
399399

pandas/_libs/tslibs/nattype.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ class NaTType(_NaT):
372372
1 NaT
373373
"""
374374

375-
__module__ = "pandas"
375+
__module__ = "pandas.api.typing"
376376

377377
def __new__(cls):
378378
cdef _NaT base

pandas/_libs/tslibs/np_datetime.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ class OutOfBoundsDatetime(ValueError):
192192
OutOfBoundsDatetime: Parsing "08335394550" to datetime overflows,
193193
at position 0
194194
"""
195+
__module__ = "pandas.errors"
195196
pass
196197

197198

@@ -212,6 +213,7 @@ class OutOfBoundsTimedelta(ValueError):
212213
OutOfBoundsTimedelta: Cannot cast 139999 days 00:00:00
213214
to unit='ns' without overflow.
214215
"""
216+
__module__ = "pandas.errors"
215217
# Timedelta analogue to OutOfBoundsDatetime
216218
pass
217219

pandas/_libs/tslibs/offsets.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,6 +1819,8 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta):
18191819
>>> ts + pd.DateOffset(hour=8)
18201820
Timestamp('2017-01-01 08:10:11')
18211821
"""
1822+
__module__ = "pandas"
1823+
18221824
def __setattr__(self, name, value):
18231825
raise AttributeError("DateOffset objects are immutable.")
18241826

pandas/_libs/tslibs/period.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,7 @@ DIFFERENT_FREQ = ("Input has different freq={other_freq} "
16271627

16281628

16291629
class IncompatibleFrequency(TypeError):
1630+
__module__ = "pandas.errors"
16301631
"""
16311632
Raised when trying to compare or operate between Periods with different
16321633
frequencies.

pandas/_typing.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107

108108

109109
class SequenceNotStr(Protocol[_T_co]):
110+
__module__ = "pandas.api.typing.aliases"
111+
110112
@overload
111113
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
112114

@@ -278,12 +280,16 @@ def tell(self) -> int:
278280

279281

280282
class ReadBuffer(BaseBuffer, Protocol[AnyStr_co]):
283+
__module__ = "pandas.api.typing.aliases"
284+
281285
def read(self, n: int = ..., /) -> AnyStr_co:
282286
# for BytesIOWrapper, gzip.GzipFile, bz2.BZ2File
283287
...
284288

285289

286290
class WriteBuffer(BaseBuffer, Protocol[AnyStr_contra]):
291+
__module__ = "pandas.api.typing.aliases"
292+
287293
def write(self, b: AnyStr_contra, /) -> Any:
288294
# for gzip.GzipFile, bz2.BZ2File
289295
...
@@ -294,14 +300,20 @@ def flush(self) -> Any:
294300

295301

296302
class ReadPickleBuffer(ReadBuffer[bytes], Protocol):
303+
__module__ = "pandas.api.typing.aliases"
304+
297305
def readline(self) -> bytes: ...
298306

299307

300308
class WriteExcelBuffer(WriteBuffer[bytes], Protocol):
309+
__module__ = "pandas.api.typing.aliases"
310+
301311
def truncate(self, size: int | None = ..., /) -> int: ...
302312

303313

304314
class ReadCsvBuffer(ReadBuffer[AnyStr_co], Protocol):
315+
__module__ = "pandas.api.typing.aliases"
316+
305317
def __iter__(self) -> Iterator[AnyStr_co]:
306318
# for engine=python
307319
...

pandas/core/apply.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676

7777

7878
class BaseExecutionEngine(abc.ABC):
79+
__module__ = "pandas.api.executors"
7980
"""
8081
Base class for execution engines for map and apply methods.
8182

pandas/core/arrays/arrow/array.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ class ArrowExtensionArray(
246246
ExtensionArraySupportsAnyAll,
247247
ArrowStringArrayMixin,
248248
):
249+
__module__ = "pandas.arrays"
249250
"""
250251
Pandas ExtensionArray backed by a PyArrow ChunkedArray.
251252

pandas/core/arrays/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106

107107

108108
class ExtensionArray:
109+
__module__ = "pandas.api.extensions"
109110
"""
110111
Abstract base class for custom 1-D array types.
111112
@@ -2787,6 +2788,7 @@ def _add_logical_ops(cls) -> None:
27872788

27882789

27892790
class ExtensionScalarOpsMixin(ExtensionOpsMixin):
2791+
__module__ = "pandas.api.extensions"
27902792
"""
27912793
A mixin for defining ops on an ExtensionArray.
27922794

0 commit comments

Comments
 (0)