We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0647850 commit 66a3d17Copy full SHA for 66a3d17
pandas/tests/frame/test_alter_axes.py
@@ -234,9 +234,16 @@ def test_set_index_pass_arrays_duplicate(
234
235
# need to adapt first drop for case that both keys are 'A' --
236
# cannot drop the same column twice;
237
- # use "is" because == would give ambiguous Boolean error for containers
+ # plain == would give ambiguous Boolean error for containers
238
first_drop = (
239
- False if (keys[0] is "A" and keys[1] is "A") else drop # noqa: F632
+ False
240
+ if (
241
+ isinstance(keys[0], str)
242
+ and keys[0] == "A"
243
+ and isinstance(keys[1], str)
244
+ and keys[1] == "A"
245
+ )
246
+ else drop
247
)
248
# to test against already-tested behaviour, we add sequentially,
249
# hence second append always True; must wrap keys in list, otherwise
0 commit comments