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