Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
670e035
merge ty_all and pyrefly_strict
cmp0xff Aug 2, 2026
0906818
styler
cmp0xff Aug 2, 2026
89233e0
facebook/pyrefly#4427
cmp0xff Aug 4, 2026
72fd61f
facebook/pyrefly#4439
cmp0xff Aug 4, 2026
a217fad
pyrefly implicit-any-lambda
cmp0xff Aug 6, 2026
de87a36
pyrefly and pyright
cmp0xff Aug 6, 2026
df787c3
also mypy python/mypy#15900
cmp0xff Aug 7, 2026
6fb0b36
bump ty
cmp0xff Aug 14, 2026
80370af
recover ty_all
cmp0xff Aug 14, 2026
85b23cf
earlier python
cmp0xff Aug 14, 2026
3753f9d
Update .github/workflows/optional.yml
cmp0xff Aug 14, 2026
1ec5b3d
https://github.com/pandas-dev/pandas-stubs/pull/1867#discussion_r3787…
cmp0xff Aug 15, 2026
435832c
microsoft/pyright#11644 microsoft/pyright#10607
cmp0xff Aug 15, 2026
d03e3c6
https://github.com/pandas-dev/pandas-stubs/pull/1867#discussion_r3789…
cmp0xff Aug 15, 2026
81fe691
pandas-dev/pandas-stubs#1901 https://github.com/pandas-dev/pandas-stu…
cmp0xff Aug 15, 2026
2fd2bb6
Iterator[Any]
cmp0xff Aug 16, 2026
554fdb7
copy
cmp0xff Aug 18, 2026
34fc7e5
isna
cmp0xff Aug 18, 2026
f58658c
nbytes
cmp0xff Aug 18, 2026
371c33c
StringArray.__setitem__
cmp0xff Aug 18, 2026
8f88636
is_unique
cmp0xff Aug 18, 2026
29e7139
is_monotonic_decreasing
cmp0xff Aug 18, 2026
e36f014
is_monotonic_increasing
cmp0xff Aug 18, 2026
e1b0a93
hasnans
cmp0xff Aug 18, 2026
1a7316f
inferred_type
cmp0xff Aug 18, 2026
502146e
tzinfo
cmp0xff Aug 18, 2026
95df327
memory_usage
cmp0xff Aug 18, 2026
7070859
get_loc
cmp0xff Aug 18, 2026
54c6463
__len__
cmp0xff Aug 18, 2026
57669a8
dropna
cmp0xff Aug 18, 2026
74bb14b
nlevels
cmp0xff Aug 18, 2026
e3c9cdc
has_duplicates
cmp0xff Aug 18, 2026
a4e3e6e
size
cmp0xff Aug 18, 2026
88140bd
remove NoNewAttributesMixin
cmp0xff Aug 18, 2026
4ab74f9
empty
cmp0xff Aug 18, 2026
a55eb5c
ndim
cmp0xff Aug 18, 2026
2585225
searchsorted
cmp0xff Aug 18, 2026
7a2b5a5
nunique
cmp0xff Aug 18, 2026
55826f5
to_list
cmp0xff Aug 18, 2026
6593909
Iterator[DataFrame]
cmp0xff Aug 18, 2026
47997fd
_BaseVersion
cmp0xff Aug 18, 2026
c5906ac
mod and rmod
cmp0xff Aug 18, 2026
adb12c6
tolist
cmp0xff Aug 18, 2026
c396d44
Merge remote-tracking branch 'upstream' into pyrefly-strict-ty-all
cmp0xff Aug 18, 2026
425c2d9
MultiIndex.isin
cmp0xff Aug 18, 2026
81d1218
size
cmp0xff Aug 18, 2026
e953198
one less cast
cmp0xff Aug 19, 2026
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
6 changes: 1 addition & 5 deletions .github/workflows/comment_commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
actions: write
checks: write
# if more commands are added, they will need to be added here too as we don't have access to env at this stage
if: (github.event.issue.pull_request) && contains(fromJSON('["/pandas_nightly", "/mypy_nightly", "/pyrefly_strict", "/pyrefly_all", "/ty_all"]'), github.event.comment.body) && github.event.comment.author_association == 'MEMBER'
if: (github.event.issue.pull_request) && contains(fromJSON('["/pandas_nightly", "/mypy_nightly", "/pyrefly_all", "/ty_all"]'), github.event.comment.body) && github.event.comment.author_association == 'MEMBER'

steps:
- name: Resolve comment command
Expand All @@ -34,10 +34,6 @@ jobs:
echo "poe_command=mypy --mypy_nightly" >> "${GITHUB_OUTPUT}"
echo "check_name=Mypy nightly tests" >> "${GITHUB_OUTPUT}"
;;
/pyrefly_strict)
echo "poe_command=pyrefly_strict" >> "${GITHUB_OUTPUT}"
echo "check_name=Pyrefly tests strict preset" >> "${GITHUB_OUTPUT}"
;;
/pyrefly_all)
echo "poe_command=pyrefly_all" >> "${GITHUB_OUTPUT}"
echo "check_name=Pyrefly tests all preset" >> "${GITHUB_OUTPUT}"
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/optional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,6 @@ jobs:
- name: Run mypy tests with mypy nightly
run: poetry run poe mypy --mypy_nightly

pyrefly_strict:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v7

- name: Install project dependencies
uses: ./.github/setup
with:
os: ubuntu-latest
python-version: '3.14'

- name: Run pyrefly tests with preset 'strict'
run: poetry run poe pyrefly_strict

pyrefly_all:
runs-on: ubuntu-latest
timeout-minutes: 10
Expand All @@ -82,7 +66,7 @@ jobs:

- name: Run pyrefly tests with preset 'all'
run: poetry run poe pyrefly_all

ty_all:
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down
2 changes: 0 additions & 2 deletions docs/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ The following tests are **optional**. Some of them are run by the CI but it is o

- Run pytest against pandas nightly: `poe pytest --nightly`
- Use mypy nightly to validate the annotations: `poe mypy --mypy_nightly`
- Use pyrefly with [preset](https://pyrefly.org/en/docs/configuration/#preset) 'strict': `poe pyrefly_strict`
- Use pyrefly with preset 'all': `poe pyrefly_all`
- Use ty with [all rules raising errors](https://docs.astral.sh/ty/rules/#rule-levels): `poe ty_all`
- Run stubtest to compare the installed pandas-stubs against pandas (this will fail): `poe stubtest`. If you have created an allowlist to ignore certain errors: `poe stubtest path_to_the_allow_list`
Expand All @@ -30,6 +29,5 @@ Among the tests above, the following can be run directly during a PR by commenti

- Run pytest against pandas nightly by commenting `/pandas_nightly`
- Use mypy nightly to validate the annotations by commenting `/mypy_nightly`
- Use pyrefly with preset 'strict': `/pyrefly_strict`
- Use pyrefly with preset 'all': `/pyrefly_all`
- Use ty with all rules raising errors: `/ty_all`
4 changes: 4 additions & 0 deletions pandas-stubs/_config/config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ from typing import (
type_check_only,
)

from typing_extensions import override

def get_option(pat: str) -> Any: ...
@overload
def set_option(*args: dict[str, Any]) -> None: ...
Expand Down Expand Up @@ -70,10 +72,12 @@ def describe_option(pat: str, _print_desc: Literal[True] = True) -> None: ...

class DictWrapper:
def __init__(self, d: dict[str, Any], prefix: str = "") -> None: ...
@override
def __setattr__(
self, key: str, val: str | bool | int | DictWrapper | None
) -> None: ...
def __getattr__(self, key: str) -> str | bool | int | DictWrapper | None: ...
@override
def __dir__(self) -> Iterable[str]: ...

@type_check_only
Expand Down
26 changes: 16 additions & 10 deletions pandas-stubs/_libs/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@ from typing import (
)

import numpy as np
from pandas import (
IntervalIndex,
Series,
Timedelta,
Timestamp,
)
from pandas._stubs_only import (
OrderableScalarT,
OrderableT,
OrderableTimesT,
)
from pandas.core.indexes.interval import IntervalIndex
from pandas.core.series import Series
from typing_extensions import override

from pandas._libs.tslibs.timedeltas import Timedelta
from pandas._libs.tslibs.timestamps import Timestamp
from pandas._typing import (
IntervalClosedType,
IntervalT,
Expand Down Expand Up @@ -78,6 +77,7 @@ class Interval(IntervalMixin, Generic[OrderableT]):
right: OrderableT,
closed: IntervalClosedType = "right",
) -> Self: ...
@override
def __hash__(self) -> int: ...
@overload
def __contains__(self: Interval[int], key: float | np.floating) -> bool: ...
Expand Down Expand Up @@ -191,18 +191,24 @@ class Interval(IntervalMixin, Generic[OrderableT]):
@overload
def __le__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
@overload
def __eq__(self, other: Interval[OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@override
def __eq__(self, other: Interval[OrderableT]) -> bool: ... # type: ignore[overload-overlap]
@overload
def __eq__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
@overload
def __eq__(self, other: Series[OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: object) -> Literal[False]: ...
def __eq__( # pyright: ignore[reportOverlappingOverload]
self, other: object
) -> Literal[False]: ...
@overload
def __ne__(self, other: Interval[OrderableT]) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@override
def __ne__(self, other: Interval[OrderableT]) -> bool: ... # type: ignore[overload-overlap]
@overload
def __ne__(self: IntervalT, other: IntervalIndex[IntervalT]) -> np_1darray_bool: ...
@overload
def __ne__(self, other: Series[OrderableT]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: object) -> Literal[True]: ...
def __ne__( # pyright: ignore[reportOverlappingOverload]
self, other: object
) -> Literal[True]: ...
18 changes: 10 additions & 8 deletions pandas-stubs/_libs/missing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ import numpy as np
from pandas.core.arrays.boolean import BooleanArray
from pandas.core.indexes.base import Index
from pandas.core.series import Series
from typing_extensions import override

from pandas._typing import Scalar

@final
class NAType:
def __new__(cls, *args: Any, **kwargs: Any) -> Self: ...
def __format__(self, format_spec: str) -> str: ...
@override
def __hash__(self) -> int: ...
def __reduce__(self) -> str: ...
@override
def __reduce__(self) -> Literal["NA"]: ...
@overload
def __add__(self, other: Series, /) -> Series: ...
@overload
Expand Down Expand Up @@ -107,19 +109,19 @@ class NAType:
@overload
def __rdivmod__(self, other: Scalar, /) -> tuple[NAType, NAType]: ...
@overload # type: ignore[override]
def __eq__( # pyrefly: ignore[bad-override]
self, other: Series, /
) -> Series[bool]: ...
@override
# pyrefly: ignore[bad-override]
def __eq__(self, other: Series, /) -> Series[bool]: ...
@overload
def __eq__(self, other: Index, /) -> BooleanArray: ...
@overload
def __eq__( # pyright: ignore[reportIncompatibleMethodOverride] # ty: ignore[invalid-method-override]
self, other: Scalar, /
) -> NAType: ...
@overload # type: ignore[override]
def __ne__( # pyrefly: ignore[bad-override]
self, other: Series, /
) -> Series[bool]: ...
@override
# pyrefly: ignore[bad-override]
def __ne__(self, other: Series, /) -> Series[bool]: ...
@overload
def __ne__(self, other: Index, /) -> BooleanArray: ...
@overload
Expand Down
4 changes: 4 additions & 0 deletions pandas-stubs/_libs/tslibs/nattype.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ from typing import (
)

import numpy as np
from typing_extensions import override

from pandas._libs.tslibs.period import Period
from pandas._typing import (
Expand All @@ -34,6 +35,7 @@ class _NatComparison:
@final
class NaTType:
value: np.int64
@override
def __hash__(self) -> int: ...
def asm8(self) -> np.datetime64: ...
def to_datetime64(self) -> np.datetime64: ...
Expand Down Expand Up @@ -147,7 +149,9 @@ class NaTType:
# inject Period properties
@property
def qyear(self) -> float: ...
@override
def __eq__(self, other: object) -> bool: ...
@override
def __ne__(self, other: object) -> bool: ...
__lt__: _NatComparison
__le__: _NatComparison
Expand Down
7 changes: 6 additions & 1 deletion pandas-stubs/_libs/tslibs/offsets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ from typing import (

from dateutil.relativedelta import weekday as WeekdayClass
import numpy as np
from pandas import Timestamp
from typing_extensions import override

from pandas._libs.tslibs.timestamps import Timestamp
from pandas._typing import (
Frequency,
ShapeT,
Expand All @@ -33,8 +34,11 @@ class ApplyTypeError(TypeError): ...
class BaseOffset:
n: int
def __init__(self, n: int = ..., normalize: bool = ...) -> None: ...
@override
def __eq__(self, other: object) -> bool: ...
@override
def __ne__(self, other: object) -> bool: ...
@override
def __hash__(self) -> int: ...
@property
def kwds(self) -> dict[str, Any]: ...
Expand Down Expand Up @@ -113,6 +117,7 @@ def to_offset(freq: Frequency | timedelta, is_period: bool = False) -> BaseOffse
class Tick(SingleConstructorOffset):
def __init__(self, n: int = ..., normalize: bool = ...) -> None: ...
@property
@override
def nanos(self) -> int: ...

class Day(Tick): ...
Expand Down
17 changes: 13 additions & 4 deletions pandas-stubs/_libs/tslibs/period.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ from pandas.core.indexes.base import Index
from pandas.core.indexes.period import PeriodIndex
from pandas.core.indexes.timedeltas import TimedeltaIndex
from pandas.core.series import Series
from typing_extensions import override

from pandas._libs.tslibs import NaTType
from pandas._libs.tslibs.offsets import BaseOffset
Expand Down Expand Up @@ -80,15 +81,18 @@ class Period(PeriodMixin):
# ignore[misc] here because we know all other comparisons
# are False, so we use Literal[False]
@overload
def __eq__(self, other: Self) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@override
def __eq__(self, other: Self) -> bool: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: Index) -> np_1darray_bool: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: Series[Period]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: np_ndarray_object[ShapeT]) -> np_ndarray_bool[ShapeT]: ... # type: ignore[overload-overlap]
@overload
def __eq__(self, other: object) -> Literal[False]: ...
def __eq__( # pyright: ignore[reportOverlappingOverload]
self, other: object
) -> Literal[False]: ...
@overload
def __ge__(self, other: Self) -> bool: ...
@overload
Expand Down Expand Up @@ -124,15 +128,18 @@ class Period(PeriodMixin):
# ignore[misc] here because we know all other comparisons
# are False, so we use Literal[False]
@overload
def __ne__(self, other: Self) -> bool: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
@override
def __ne__(self, other: Self) -> bool: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: Index) -> np_1darray_bool: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: Series[Period]) -> Series[bool]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: np_ndarray_object[ShapeT]) -> np_ndarray_bool[ShapeT]: ... # type: ignore[overload-overlap]
@overload
def __ne__(self, other: object) -> Literal[True]: ...
def __ne__( # pyright: ignore[reportOverlappingOverload]
self, other: object
) -> Literal[True]: ...
@property
def day(self) -> int: ...
@property
Expand All @@ -144,6 +151,7 @@ class Period(PeriodMixin):
@property
def days_in_month(self) -> int: ...
@property
@override
def end_time(self) -> Timestamp: ...
@property
def freq(self) -> BaseOffset: ...
Expand All @@ -166,6 +174,7 @@ class Period(PeriodMixin):
@property
def is_leap_year(self) -> bool: ...
@property
@override
def start_time(self) -> Timestamp: ...
@property
def week(self) -> int: ...
Expand Down
Loading
Loading