Skip to content

GH1227 align init pyi with init py from pandas #1229

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 3 commits into from
May 21, 2025
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
2 changes: 1 addition & 1 deletion pandas-stubs/_config/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .config import (
from pandas._config.config import (
describe_option as describe_option,
get_option as get_option,
option_context as option_context,
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/api/extensions/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ from pandas.core.arrays import (

from pandas._libs.lib import no_default as no_default

from pandas.core.dtypes.dtypes import (
from pandas.core.dtypes.base import (
ExtensionDtype as ExtensionDtype,
register_extension_dtype as register_extension_dtype,
)
4 changes: 2 additions & 2 deletions pandas-stubs/api/indexers/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pandas.core.indexers import (
from pandas.core.indexers import check_array_indexer as check_array_indexer
from pandas.core.indexers.objects import (
BaseIndexer as BaseIndexer,
FixedForwardWindowIndexer as FixedForwardWindowIndexer,
VariableOffsetWindowIndexer as VariableOffsetWindowIndexer,
check_array_indexer as check_array_indexer,
)
5 changes: 5 additions & 0 deletions pandas-stubs/core/dtypes/base.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import (
ClassVar,
Literal,
TypeVar,
)

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

class StorageExtensionDtype(ExtensionDtype): ...

_ExtensionDtypeT = TypeVar("_ExtensionDtypeT", bound=ExtensionDtype)

def register_extension_dtype(cls: type[_ExtensionDtypeT]) -> type[_ExtensionDtypeT]: ...
10 changes: 4 additions & 6 deletions pandas-stubs/core/dtypes/dtypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import datetime as dt
from typing import (
Any,
Literal,
TypeVar,
)

import numpy as np
Expand All @@ -21,11 +20,10 @@ from pandas._typing import (
npt,
)

from .base import ExtensionDtype as ExtensionDtype

_ExtensionDtypeT = TypeVar("_ExtensionDtypeT", bound=ExtensionDtype)

def register_extension_dtype(cls: type[_ExtensionDtypeT]) -> type[_ExtensionDtypeT]: ...
from pandas.core.dtypes.base import (
ExtensionDtype as ExtensionDtype,
register_extension_dtype as register_extension_dtype,
)

class BaseMaskedDtype(ExtensionDtype): ...
class PandasExtensionDtype(ExtensionDtype): ...
Expand Down
2 changes: 2 additions & 0 deletions pandas-stubs/core/interchange/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from pandas.core.interchange.dataframe_protocol import DataFrame as DataFrame
from pandas.core.interchange.from_dataframe import from_dataframe as from_dataframe
5 changes: 5 additions & 0 deletions pandas-stubs/io/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from pandas.io import (
formats as formats,
json as json,
stata as stata,
)
1 change: 1 addition & 0 deletions pandas-stubs/io/formats/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from pandas.io.formats import style as style
7 changes: 6 additions & 1 deletion pandas-stubs/io/json/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
from pandas.io.json._json import read_json as read_json
from pandas.io.json._json import (
read_json as read_json,
)

# below are untyped imports so commented out
# to_json as to_json,; ujson_dumps as ujson_dumps,; ujson_loads as ujson_loads,
from pandas.io.json._table_schema import build_table_schema as build_table_schema