Skip to content

Commit 5686ca9

Browse files
GH1227 align init pyi with init py from pandas (#1229)
* GH1227 Align __init__ file content with pandas * GH1227 Align __init__.pyi with __init__.py * GH1227 PR feedback
1 parent 925584b commit 5686ca9

File tree

9 files changed

+27
-11
lines changed

9 files changed

+27
-11
lines changed

pandas-stubs/_config/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .config import (
1+
from pandas._config.config import (
22
describe_option as describe_option,
33
get_option as get_option,
44
option_context as option_context,

pandas-stubs/api/extensions/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ from pandas.core.arrays import (
1111

1212
from pandas._libs.lib import no_default as no_default
1313

14-
from pandas.core.dtypes.dtypes import (
14+
from pandas.core.dtypes.base import (
1515
ExtensionDtype as ExtensionDtype,
1616
register_extension_dtype as register_extension_dtype,
1717
)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from pandas.core.indexers import (
1+
from pandas.core.indexers import check_array_indexer as check_array_indexer
2+
from pandas.core.indexers.objects import (
23
BaseIndexer as BaseIndexer,
34
FixedForwardWindowIndexer as FixedForwardWindowIndexer,
45
VariableOffsetWindowIndexer as VariableOffsetWindowIndexer,
5-
check_array_indexer as check_array_indexer,
66
)

pandas-stubs/core/dtypes/base.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import (
22
ClassVar,
33
Literal,
4+
TypeVar,
45
)
56

67
from pandas.core.arrays import ExtensionArray
@@ -28,3 +29,7 @@ class ExtensionDtype:
2829
def is_dtype(cls, dtype: object) -> bool: ...
2930

3031
class StorageExtensionDtype(ExtensionDtype): ...
32+
33+
_ExtensionDtypeT = TypeVar("_ExtensionDtypeT", bound=ExtensionDtype)
34+
35+
def register_extension_dtype(cls: type[_ExtensionDtypeT]) -> type[_ExtensionDtypeT]: ...

pandas-stubs/core/dtypes/dtypes.pyi

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import datetime as dt
22
from typing import (
33
Any,
44
Literal,
5-
TypeVar,
65
)
76

87
import numpy as np
@@ -21,11 +20,10 @@ from pandas._typing import (
2120
npt,
2221
)
2322

24-
from .base import ExtensionDtype as ExtensionDtype
25-
26-
_ExtensionDtypeT = TypeVar("_ExtensionDtypeT", bound=ExtensionDtype)
27-
28-
def register_extension_dtype(cls: type[_ExtensionDtypeT]) -> type[_ExtensionDtypeT]: ...
23+
from pandas.core.dtypes.base import (
24+
ExtensionDtype as ExtensionDtype,
25+
register_extension_dtype as register_extension_dtype,
26+
)
2927

3028
class BaseMaskedDtype(ExtensionDtype): ...
3129
class PandasExtensionDtype(ExtensionDtype): ...
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from pandas.core.interchange.dataframe_protocol import DataFrame as DataFrame
2+
from pandas.core.interchange.from_dataframe import from_dataframe as from_dataframe

pandas-stubs/io/__init__.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from pandas.io import (
2+
formats as formats,
3+
json as json,
4+
stata as stata,
5+
)

pandas-stubs/io/formats/__init__.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from pandas.io.formats import style as style

pandas-stubs/io/json/__init__.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
from pandas.io.json._json import read_json as read_json
1+
from pandas.io.json._json import (
2+
read_json as read_json,
3+
)
4+
5+
# below are untyped imports so commented out
6+
# to_json as to_json,; ujson_dumps as ujson_dumps,; ujson_loads as ujson_loads,
27
from pandas.io.json._table_schema import build_table_schema as build_table_schema

0 commit comments

Comments
 (0)