File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -234,9 +234,16 @@ def test_set_index_pass_arrays_duplicate(
234
234
235
235
# need to adapt first drop for case that both keys are 'A' --
236
236
# cannot drop the same column twice;
237
- # use "is" because == would give ambiguous Boolean error for containers
237
+ # plain == would give ambiguous Boolean error for containers
238
238
first_drop = (
239
- False if (keys [0 ] is "A" and keys [1 ] is "A" ) else drop # noqa: F632
239
+ 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
240
247
)
241
248
# to test against already-tested behaviour, we add sequentially,
242
249
# hence second append always True; must wrap keys in list, otherwise
You can’t perform that action at this time.
0 commit comments