Skip to content

Commit

Permalink
fix issues due to pyright 1.1.320
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Irv committed Aug 2, 2023
1 parent 6658660 commit 5a724bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ reportPrivateUsage = false
# enable optional checks
reportMissingModuleSource = true
useLibraryCodeForTypes = false
defineConstant = { MYPY_CHECKING = false }

[tool.codespell]
ignore-words-list = "indext, mose, sav, ser"
11 changes: 10 additions & 1 deletion tests/test_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
)

if TYPE_CHECKING:
MYPY_CHECKING: bool = True
if MYPY_CHECKING:
from typing import Any

from typing_extensions import TypeAlias

SupportsRichComparison: TypeAlias = Any
else:
from _typeshed import SupportsRichComparison
from pandas.core.indexes.base import (
_ComplexIndexType,
_FloatIndexType,
Expand Down Expand Up @@ -722,7 +731,7 @@ def test_sorted_and_list() -> None:
check(
assert_type(
sorted(i1),
list,
list["SupportsRichComparison"],
),
list,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ def test_merge_ordered() -> None:
)
pd.merge_ordered( # type: ignore[call-overload]
ls,
rf, # pyright: ignore[reportGeneralTypeIssues]
rf,
left_on="left",
right_on="b",
left_by="left", # pyright: ignore[reportGeneralTypeIssues]
Expand Down

0 comments on commit 5a724bf

Please sign in to comment.