Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
9 changes: 1 addition & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ repos:
rev: v0.13.3
hooks:
- id: ruff-check
args: [
--exit-non-zero-on-fix,
--target-version, py39,
--extend-select, "PYI,UP,RUF100",
--ignore, "E501,E731,F841,PYI042",
--per-file-ignores, "_*.pyi:PYI001",
--fix
]
args: [--exit-non-zero-on-fix]
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
Expand Down
6 changes: 2 additions & 4 deletions pandas-stubs/_libs/lib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ from enum import Enum
from typing import (
Final,
Literal,
)

import numpy as np
from typing_extensions import (
TypeAlias,
TypeGuard,
)

import numpy as np

class _NoDefault(Enum):
no_default = ...

Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_libs/missing.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Callable
from typing import (
Any,
Callable,
Literal,
overload,
)
Expand Down
6 changes: 4 additions & 2 deletions pandas-stubs/_libs/tslibs/nattype.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ from datetime import (
timedelta,
tzinfo as _tzinfo,
)
from typing import Literal
from typing import (
Literal,
TypeAlias,
)

import numpy as np
from typing_extensions import (
Self,
TypeAlias,
)

from pandas._libs.tslibs.period import Period
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_libs/tslibs/period.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
from typing import (
Literal,
TypeAlias,
overload,
)

Expand All @@ -12,7 +13,6 @@ from pandas import (
Timedelta,
TimedeltaIndex,
)
from typing_extensions import TypeAlias

from pandas._libs.tslibs import NaTType
from pandas._libs.tslibs.offsets import BaseOffset
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_libs/tslibs/timedeltas.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from typing import (
ClassVar,
Literal,
NamedTuple,
TypeAlias,
overload,
)

Expand All @@ -19,7 +20,6 @@ from pandas import (
)
from typing_extensions import (
Self,
TypeAlias,
)

from pandas._libs.tslibs import (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ from typing import (
ClassVar,
Literal,
SupportsIndex,
TypeAlias,
overload,
)

Expand All @@ -26,7 +27,6 @@ from pandas.core.series import Series
from typing_extensions import (
Never,
Self,
TypeAlias,
)

from pandas._libs.tslibs import (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ from typing import (
Literal,
Protocol,
SupportsIndex,
TypeAlias,
TypedDict,
Union,
overload,
Expand All @@ -36,7 +37,6 @@ from pandas.core.series import Series
from pandas.core.tools.datetimes import FulldatetimeDict
from typing_extensions import (
ParamSpec,
TypeAlias,
TypeVar,
override,
)
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/accessor.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Callable
from collections.abc import Callable

from pandas._typing import TypeT

Expand Down
6 changes: 4 additions & 2 deletions pandas-stubs/core/arrays/datetimelike.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from collections.abc import Sequence
from typing import overload
from typing import (
TypeAlias,
overload,
)

import numpy as np
from pandas.core.arrays.base import (
Expand All @@ -8,7 +11,6 @@ from pandas.core.arrays.base import (
)
from typing_extensions import (
Self,
TypeAlias,
)

from pandas._libs import (
Expand Down
6 changes: 4 additions & 2 deletions pandas-stubs/core/arrays/interval.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from typing import overload
from typing import (
TypeAlias,
overload,
)

import numpy as np
from pandas import (
Expand All @@ -8,7 +11,6 @@ from pandas import (
from pandas.core.arrays.base import ExtensionArray as ExtensionArray
from typing_extensions import (
Self,
TypeAlias,
)

from pandas._libs.interval import (
Expand Down
3 changes: 2 additions & 1 deletion pandas-stubs/core/dtypes/common.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import TypeAlias

import pandas as pd
from pandas.api.extensions import ExtensionDtype
from typing_extensions import TypeAlias

from pandas._typing import (
ArrayLike,
Expand Down
3 changes: 2 additions & 1 deletion pandas-stubs/core/dtypes/generic.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import TypeAlias

from pandas import Series
from pandas.core.arrays import ExtensionArray
from typing_extensions import TypeAlias

ABCSeries: TypeAlias = type[Series]
ABCExtensionArray: TypeAlias = type[ExtensionArray]
2 changes: 1 addition & 1 deletion pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ from typing import (
Generic,
Literal,
NoReturn,
TypeAlias,
TypeVar,
final,
overload,
Expand Down Expand Up @@ -73,7 +74,6 @@ from pandas.core.window.rolling import (
from typing_extensions import (
Never,
Self,
TypeAlias,
)
import xarray as xr

Expand Down
39 changes: 38 additions & 1 deletion pandas-stubs/core/generic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import sqlite3
from typing import (
Any,
ClassVar,
Concatenate,
Literal,
final,
overload,
Expand All @@ -28,7 +29,7 @@ from pandas.core.series import (
)
import sqlalchemy.engine
from typing_extensions import (
Concatenate,
Never,
Self,
)

Expand Down Expand Up @@ -315,6 +316,42 @@ class NDFrame(indexing.IndexingMixin):
@final
def __delitem__(self, idx: Hashable) -> None: ...
@overload
def drop(
self,
labels=...,
*,
axis=...,
index: None,
columns=...,
level=...,
inplace=...,
errors=...,
) -> Never: ...
@overload
def drop(
self,
labels=...,
*,
axis=...,
index=...,
columns: None,
level=...,
inplace=...,
errors=...,
) -> Never: ...
@overload
def drop(
self,
labels: None,
*,
axis=...,
index=...,
columns=...,
level=...,
inplace=...,
errors=...,
) -> Never: ...
@overload
def drop(
self,
labels: None = ...,
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/groupby/generic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ from typing import (
Literal,
NamedTuple,
Protocol,
TypeAlias,
TypeVar,
final,
overload,
Expand All @@ -28,7 +29,6 @@ from pandas.core.groupby.groupby import (
from pandas.core.series import Series
from typing_extensions import (
Self,
TypeAlias,
)

from pandas._libs.tslibs.timestamps import Timestamp
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/groupby/groupby.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ from collections.abc import (
import datetime as dt
from typing import (
Any,
Concatenate,
Generic,
Literal,
TypeAlias,
TypeVar,
final,
overload,
Expand Down Expand Up @@ -39,9 +41,7 @@ from pandas.core.window import (
RollingGroupby,
)
from typing_extensions import (
Concatenate,
Self,
TypeAlias,
)

from pandas._libs.lib import _NoDefaultDoNotUse
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from collections.abc import (
import datetime as dt
from typing import (
Literal,
TypeAlias,
final,
overload,
)
Expand All @@ -13,7 +14,6 @@ import numpy as np
import pandas as pd
from pandas import Index
from pandas.core.indexes.extension import ExtensionIndex
from typing_extensions import TypeAlias

from pandas._libs.interval import (
Interval as Interval,
Expand Down
6 changes: 4 additions & 2 deletions pandas-stubs/core/indexing.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from typing import TypeVar
from typing import (
TypeAlias,
TypeVar,
)

from pandas.core.indexes.api import Index
from typing_extensions import TypeAlias

from pandas._libs.indexing import _NDFrameIndexerBase
from pandas._typing import (
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/resample.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from collections.abc import (
)
from typing import (
Literal,
TypeAlias,
final,
overload,
)
Expand All @@ -20,7 +21,6 @@ from pandas.core.groupby.groupby import BaseGroupBy
from pandas.core.groupby.grouper import Grouper
from typing_extensions import (
Self,
TypeAlias,
)

from pandas._typing import (
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/reshape/concat.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def concat(
# verify_integrity: bool = ...,
# sort: bool = ...,
# copy: bool = ...,
# ) -> Union[DataFrame, Series]: ...
# ) -> DataFrame | Series: ...

# @overload
# def concat(
Expand All @@ -176,4 +176,4 @@ def concat(
# verify_integrity: bool = ...,
# sort: bool = ...,
# copy: bool = ...,
# ) -> Union[DataFrame, Series]: ...
# ) -> DataFrame | Series: ...
2 changes: 1 addition & 1 deletion pandas-stubs/core/reshape/pivot.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ from collections.abc import (
import datetime
from typing import (
Literal,
TypeAlias,
overload,
)

Expand All @@ -16,7 +17,6 @@ from pandas.core.frame import DataFrame
from pandas.core.groupby.grouper import Grouper
from pandas.core.indexes.base import Index
from pandas.core.series import Series
from typing_extensions import TypeAlias

from pandas._typing import (
AnyArrayLike,
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ from typing import (
Literal,
NoReturn,
Protocol,
TypeAlias,
TypeVar,
final,
overload,
Expand Down Expand Up @@ -96,7 +97,6 @@ from pandas.core.window.rolling import (
from typing_extensions import (
Never,
Self,
TypeAlias,
)
import xarray as xr

Expand Down
Loading