Skip to content

Commit a9c632c

Browse files
GH1235 Update to mypy 1.16 (#1236)
1 parent b5a9735 commit a9c632c

File tree

2 files changed

+12
-20
lines changed

2 files changed

+12
-20
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ types-pytz = ">= 2022.1.1"
3535
numpy = ">= 1.23.5"
3636

3737
[tool.poetry.group.dev.dependencies]
38-
mypy = "1.15.0"
38+
mypy = "1.16.0"
3939
pandas = "2.2.3"
4040
pyarrow = ">=10.0.1"
4141
pytest = ">=7.1.2"

tests/test_frame.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3069,19 +3069,15 @@ def test_take() -> None:
30693069
def test_set_columns() -> None:
30703070
# GH 73
30713071
df = pd.DataFrame({"a": [1, 2, 3], "b": [0.0, 1, 1]})
3072-
# Next lines should work, but it is a mypy bug
3073-
# https://github.com/python/mypy/issues/3004
3074-
# pyright accepts this, so we only type check for pyright,
3075-
# and also test the code with pytest
3076-
df.columns = ["c", "d"] # type: ignore[assignment]
3077-
df.columns = [1, 2] # type: ignore[assignment]
3078-
df.columns = [1, "a"] # type: ignore[assignment]
3079-
df.columns = np.array([1, 2]) # type: ignore[assignment]
3080-
df.columns = pd.Series([1, 2]) # type: ignore[assignment]
3081-
df.columns = np.array([1, "a"]) # type: ignore[assignment]
3082-
df.columns = pd.Series([1, "a"]) # type: ignore[assignment]
3083-
df.columns = (1, 2) # type: ignore[assignment]
3084-
df.columns = (1, "a") # type: ignore[assignment]
3072+
df.columns = ["c", "d"]
3073+
df.columns = [1, 2]
3074+
df.columns = [1, "a"]
3075+
df.columns = np.array([1, 2])
3076+
df.columns = pd.Series([1, 2])
3077+
df.columns = np.array([1, "a"])
3078+
df.columns = pd.Series([1, "a"])
3079+
df.columns = (1, 2)
3080+
df.columns = (1, "a")
30853081
if TYPE_CHECKING_INVALID_USAGE:
30863082
df.columns = "abc" # type: ignore[assignment] # pyright: ignore[reportAttributeAccessIssue]
30873083

@@ -4369,12 +4365,8 @@ def test_hashable_args() -> None:
43694365
df.to_xml(path, elem_cols=test)
43704366
df.to_xml(path, elem_cols=["test"])
43714367

4372-
# Next lines should work, but it is a mypy bug
4373-
# https://github.com/python/mypy/issues/3004
4374-
# pyright accepts this, so we only type check for pyright,
4375-
# and also test the code with pytest
4376-
df.columns = test # type: ignore[assignment]
4377-
df.columns = ["test"] # type: ignore[assignment]
4368+
df.columns = test
4369+
df.columns = ["test"]
43784370

43794371
testDict = {"test": 1}
43804372
with ensure_clean() as path:

0 commit comments

Comments
 (0)