Skip to content

Commit 1cdef76

Browse files
committed
create aliases file and update tests
1 parent e6fb15b commit 1cdef76

File tree

3 files changed

+201
-3
lines changed

3 files changed

+201
-3
lines changed

pandas/api/typing/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from pandas._libs.lib import NoDefault
77
from pandas._libs.missing import NAType
88

9-
from pandas.api.typing import aliases
109
from pandas.core.groupby import (
1110
DataFrameGroupBy,
1211
SeriesGroupBy,
@@ -57,5 +56,4 @@
5756
"TimeGrouper",
5857
"TimedeltaIndexResamplerGroupby",
5958
"Window",
60-
"aliases",
6159
]

pandas/api/typing/aliases.py

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
from pandas._typing import (
2+
AggFuncType,
3+
AlignJoin,
4+
AnyAll,
5+
AnyArrayLike,
6+
ArrayLike,
7+
AstypeArg,
8+
Axes,
9+
Axis,
10+
ColspaceArgType,
11+
CompressionOptions,
12+
CorrelationMethod,
13+
CSVEngine,
14+
DropKeep,
15+
Dtype,
16+
DtypeArg,
17+
DtypeBackend,
18+
DtypeObj,
19+
ExcelWriterIfSheetExists,
20+
ExcelWriterMergeCells,
21+
FilePath,
22+
FillnaOptions,
23+
FloatFormatType,
24+
FormattersType,
25+
FromDictOrient,
26+
HTMLFlavors,
27+
IgnoreRaise,
28+
IndexLabel,
29+
InterpolateOptions,
30+
JoinHow,
31+
JoinValidate,
32+
JSONEngine,
33+
JSONSerializable,
34+
MergeHow,
35+
MergeValidate,
36+
NaPosition,
37+
NsmallestNlargestKeep,
38+
OpenFileErrors,
39+
Ordered,
40+
QuantileInterpolation,
41+
ReadBuffer,
42+
ReadCsvBuffer,
43+
ReadPickleBuffer,
44+
ReindexMethod,
45+
Scalar,
46+
SequenceNotStr,
47+
SortKind,
48+
StorageOptions,
49+
Suffixes,
50+
TakeIndexer,
51+
TimeAmbiguous,
52+
TimedeltaConvertibleTypes,
53+
TimeGrouperOrigin,
54+
TimeNonexistent,
55+
TimestampConvertibleTypes,
56+
TimeUnit,
57+
ToStataByteorder,
58+
ToTimestampHow,
59+
UpdateJoin,
60+
UsecolsArgType,
61+
WindowingRankType,
62+
WriteBuffer,
63+
WriteExcelBuffer,
64+
XMLParsers,
65+
)
66+
67+
__all__ = [
68+
"AggFuncType",
69+
"AlignJoin",
70+
"AnyAll",
71+
"AnyArrayLike",
72+
"ArrayLike",
73+
"AstypeArg",
74+
"Axes",
75+
"Axis",
76+
"CSVEngine",
77+
"ColspaceArgType",
78+
"CompressionOptions",
79+
"CorrelationMethod",
80+
"DropKeep",
81+
"Dtype",
82+
"DtypeArg",
83+
"DtypeBackend",
84+
"DtypeObj",
85+
"ExcelWriterIfSheetExists",
86+
"ExcelWriterMergeCells",
87+
"FilePath",
88+
"FillnaOptions",
89+
"FloatFormatType",
90+
"FormattersType",
91+
"FromDictOrient",
92+
"HTMLFlavors",
93+
"IgnoreRaise",
94+
"IndexLabel",
95+
"InterpolateOptions",
96+
"JSONEngine",
97+
"JSONSerializable",
98+
"JoinHow",
99+
"JoinValidate",
100+
"MergeHow",
101+
"MergeValidate",
102+
"NaPosition",
103+
"NsmallestNlargestKeep",
104+
"OpenFileErrors",
105+
"Ordered",
106+
"QuantileInterpolation",
107+
"ReadBuffer",
108+
"ReadCsvBuffer",
109+
"ReadPickleBuffer",
110+
"ReindexMethod",
111+
"Scalar",
112+
"SequenceNotStr",
113+
"SortKind",
114+
"StorageOptions",
115+
"Suffixes",
116+
"TakeIndexer",
117+
"TimeAmbiguous",
118+
"TimeGrouperOrigin",
119+
"TimeNonexistent",
120+
"TimeUnit",
121+
"TimedeltaConvertibleTypes",
122+
"TimestampConvertibleTypes",
123+
"ToStataByteorder",
124+
"ToTimestampHow",
125+
"UpdateJoin",
126+
"UsecolsArgType",
127+
"WindowingRankType",
128+
"WriteBuffer",
129+
"WriteExcelBuffer",
130+
"XMLParsers",
131+
]

pandas/tests/api/test_api.py

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
types as api_types,
1414
typing as api_typing,
1515
)
16+
from pandas.api.typing import aliases as api_aliases
1617

1718

1819
class Base:
@@ -251,7 +252,6 @@ class TestApi(Base):
251252
"indexers",
252253
"interchange",
253254
"typing",
254-
"internals",
255255
]
256256
allowed_typing = [
257257
"DataFrameGroupBy",
@@ -275,6 +275,7 @@ class TestApi(Base):
275275
"TimedeltaIndexResamplerGroupby",
276276
"TimeGrouper",
277277
"Window",
278+
"aliases",
278279
]
279280
allowed_api_types = [
280281
"is_any_real_numeric_dtype",
@@ -342,6 +343,71 @@ class TestApi(Base):
342343
"ExtensionScalarOpsMixin",
343344
]
344345
allowed_api_executors = ["BaseExecutionEngine"]
346+
allowed_api_aliases = [
347+
"AggFuncType",
348+
"AlignJoin",
349+
"AnyAll",
350+
"AnyArrayLike",
351+
"ArrayLike",
352+
"AstypeArg",
353+
"Axes",
354+
"Axis",
355+
"CSVEngine",
356+
"ColspaceArgType",
357+
"CompressionOptions",
358+
"CorrelationMethod",
359+
"DropKeep",
360+
"Dtype",
361+
"DtypeArg",
362+
"DtypeBackend",
363+
"DtypeObj",
364+
"ExcelWriterIfSheetExists",
365+
"ExcelWriterMergeCells",
366+
"FilePath",
367+
"FillnaOptions",
368+
"FloatFormatType",
369+
"FormattersType",
370+
"FromDictOrient",
371+
"HTMLFlavors",
372+
"IgnoreRaise",
373+
"IndexLabel",
374+
"InterpolateOptions",
375+
"JSONEngine",
376+
"JSONSerializable",
377+
"JoinHow",
378+
"JoinValidate",
379+
"MergeHow",
380+
"MergeValidate",
381+
"NaPosition",
382+
"NsmallestNlargestKeep",
383+
"OpenFileErrors",
384+
"Ordered",
385+
"QuantileInterpolation",
386+
"ReadBuffer",
387+
"ReadCsvBuffer",
388+
"ReadPickleBuffer",
389+
"ReindexMethod",
390+
"Scalar",
391+
"SequenceNotStr",
392+
"SortKind",
393+
"StorageOptions",
394+
"Suffixes",
395+
"TakeIndexer",
396+
"TimeAmbiguous",
397+
"TimeGrouperOrigin",
398+
"TimeNonexistent",
399+
"TimeUnit",
400+
"TimedeltaConvertibleTypes",
401+
"TimestampConvertibleTypes",
402+
"ToStataByteorder",
403+
"ToTimestampHow",
404+
"UpdateJoin",
405+
"UsecolsArgType",
406+
"WindowingRankType",
407+
"WriteBuffer",
408+
"WriteExcelBuffer",
409+
"XMLParsers",
410+
]
345411

346412
def test_api(self):
347413
self.check(api, self.allowed_api_dirs)
@@ -364,6 +430,9 @@ def test_api_extensions(self):
364430
def test_api_executors(self):
365431
self.check(api_executors, self.allowed_api_executors)
366432

433+
def test_api_typing_aliases(self):
434+
self.check(api_aliases, self.allowed_api_aliases)
435+
367436

368437
class TestErrors(Base):
369438
def test_errors(self):

0 commit comments

Comments
 (0)