Bug#956021: Syntax warnings while upgrading python3-pandas

Rebecca N. Palmer rebecca_palmer at zoho.com
Mon Apr 6 12:01:03 BST 2020


Control: tag -1 upstream patch
(untested)

This is in test code not library code, so it should be fine to ignore 
the warnings for now.

A nearby comment notes that a simple == won't work on all the types that 
keys[0] can be, but this probably will:

--- a/pandas/tests/frame/test_alter_axes.py
+++ b/pandas/tests/frame/test_alter_axes.py
@@ -238,7 +238,7 @@ class TestDataFrameAlterAxes:
          # cannot drop the same column twice;
          # use "is" because == would give ambiguous Boolean error for 
containers
          first_drop = (
-            False if (keys[0] is "A" and keys[1] is "A") else drop  # 
noqa: F632
+            False if (type(keys[0]) == str and keys[0] == "A" and 
type(keys[1]) == str and keys[1] == "A") else drop  # noqa: F632
          )
          # to test against already-tested behaviour, we add sequentially,
          # hence second append always True; must wrap keys in list, 
otherwise



More information about the debian-science-maintainers mailing list