Skip to content

Commit d556e6b

Browse files
committed
COMPAT: implement visit_Constant for 3.8 compat
Closes pandas-dev#27261
1 parent def01cf commit d556e6b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

doc/source/whatsnew/v1.0.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ ExtensionArray
205205
Other
206206
^^^^^
207207
- Trying to set the ``display.precision``, ``display.max_rows`` or ``display.max_columns`` using :meth:`set_option` to anything but a ``None`` or a positive int will raise a ``ValueError`` (:issue:`23348`)
208+
- Compatibility with Python 3.8 in :meth:`DataFrame.query` (:issue:`27261`)
208209

209210

210211
.. _whatsnew_1000.contributors:

pandas/core/computation/expr.py

+3
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ def visit_NameConstant(self, node, **kwargs):
582582
def visit_Num(self, node, **kwargs):
583583
return self.const_type(node.n, self.env)
584584

585+
def visit_Constant(self, node, **kwargs):
586+
return self.const_type(node.n, self.env)
587+
585588
def visit_Str(self, node, **kwargs):
586589
name = self.env.add_tmp(node.s)
587590
return self.term_type(name, self.env)

0 commit comments

Comments
 (0)