@@ -3069,19 +3069,15 @@ def test_take() -> None:
30693069def 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