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 raspbian-autopush committed Dec 10, 2020
1 parent 0f2a161 commit 4d9d475
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

try:
return self.const_type(value[slobj], self.env)
Expand Down

0 comments on commit 4d9d475

Please sign in to comment.