Skip to content

Commit

Permalink
GH1071 Revert numpy version restriction (#1078)
Browse files Browse the repository at this point in the history
* GH1071 Revert numpy version restriction

* GH1071 Fix test

* GH1071 Fix test
  • Loading branch information
loicdiridollou authored Dec 27, 2024
1 parent f8ffb46 commit 8f48f32
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ packages = [{ "include" = "pandas-stubs" }]
[tool.poetry.dependencies]
python = ">=3.10"
types-pytz = ">= 2022.1.1"
numpy = ">= 1.23.5,< 2.2.0" # wait till numpy 2.2.1 to clear
numpy = ">= 1.23.5"

[tool.poetry.group.dev.dependencies]
mypy = "1.13.0"
Expand Down
16 changes: 14 additions & 2 deletions tests/test_scalars.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,13 @@ def test_timedelta_add_sub() -> None:
),
pd.Timedelta,
)
check(assert_type(as_timedelta64 + td, pd.Timedelta), pd.Timedelta)
check(
assert_type( # type: ignore[assert-type]
as_timedelta64 + td, # pyright: ignore[reportAssertTypeFailure]
pd.Timedelta,
),
pd.Timedelta,
)
check(assert_type(as_timedelta_index + td, pd.TimedeltaIndex), pd.TimedeltaIndex)
check(
assert_type(as_timedelta_series + td, TimedeltaSeries), pd.Series, pd.Timedelta
Expand Down Expand Up @@ -637,7 +643,13 @@ def test_timedelta_add_sub() -> None:
),
pd.Timedelta,
)
check(assert_type(as_timedelta64 - td, pd.Timedelta), pd.Timedelta)
check(
assert_type( # type: ignore[assert-type]
as_timedelta64 - td, # pyright: ignore[reportAssertTypeFailure]
pd.Timedelta,
),
pd.Timedelta,
)
check(assert_type(as_timedelta_index - td, pd.TimedeltaIndex), pd.TimedeltaIndex)
check(
assert_type(as_timedelta_series - td, TimedeltaSeries), pd.Series, pd.Timedelta
Expand Down
2 changes: 1 addition & 1 deletion tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,7 @@ def test_astype_other() -> None:

def test_all_astype_args_tested() -> None:
"""Check that all relevant numpy type aliases are tested."""
NUMPY_ALIASES: set[str] = {k for k in np.sctypeDict if isinstance(k, str)}
NUMPY_ALIASES: set[str] = {k for k in np.sctypeDict}
EXCLUDED_ALIASES = {
"datetime64",
"m",
Expand Down

0 comments on commit 8f48f32

Please sign in to comment.