Skip to content

Commit

Permalink
Fix pytables expressions with Python 3.9
Browse files Browse the repository at this point in the history
ast.Index has been replaced by a bare value, so we need to do the
conversion from Constant to int

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/972015
Forwarded: pandas-dev/pandas#37217


Gbp-Pq: Name python39_compat.patch
  • Loading branch information
Debian Science Team authored and rebecca-palmer committed Dec 7, 2020
1 parent af37792 commit a400950
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pandas/core/computation/pytables.py
Expand Up @@ -425,6 +425,10 @@ def visit_Subscript(self, node, **kwargs):
value = value.value
except AttributeError:
pass
try:
slobj = slobj.value
except AttributeError:
pass

if isinstance(slobj, Term):
# In py39 np.ndarray lookups with Term containing int raise
Expand Down

0 comments on commit a400950

Please sign in to comment.