@@ -3069,19 +3069,15 @@ def test_take() -> None:
3069
3069
def test_set_columns () -> None :
3070
3070
# GH 73
3071
3071
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" )
3085
3081
if TYPE_CHECKING_INVALID_USAGE :
3086
3082
df .columns = "abc" # type: ignore[assignment] # pyright: ignore[reportAttributeAccessIssue]
3087
3083
@@ -4369,12 +4365,8 @@ def test_hashable_args() -> None:
4369
4365
df .to_xml (path , elem_cols = test )
4370
4366
df .to_xml (path , elem_cols = ["test" ])
4371
4367
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" ]
4378
4370
4379
4371
testDict = {"test" : 1 }
4380
4372
with ensure_clean () as path :
0 commit comments