Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Expand Up @@ -4,6 +4,7 @@ from typing import (
)

from pandas.core.arrays import ExtensionArray
from typing_extensions import TypeVar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should come from typing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, by curiosity is there a difference between the two? I know we usually to typing_extensions since it is python3.9 compatible.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, by curiosity is there a difference between the two? I know we usually to typing_extensions since it is python3.9 compatible.

No difference, but we're not supporting python 3.9 any more.


from pandas._typing import type_t

Expand All @@ -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