Fix deprecation warning on Python 3.12

This commit is contained in:
Elliott Sales de Andrade 2023-07-19 03:03:02 -04:00
parent 6aa992873e
commit d886e03fe3
2 changed files with 27 additions and 0 deletions

24
54188.patch Normal file
View File

@ -0,0 +1,24 @@
From f25740ff7d6dcbf4c5a3e0d03d0a3eaf2f3d72a4 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 19 Jul 2023 02:56:09 -0400
Subject: [PATCH] Fix deprecation warning on Python 3.12
`Constant.n` is now deprecated for removal in 3.14; it appears that
`Constant.value` has existed since at least 3.9.
---
pandas/core/computation/expr.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pandas/core/computation/expr.py b/pandas/core/computation/expr.py
index f8c8e6d87ff13..7aaafc8edab87 100644
--- a/pandas/core/computation/expr.py
+++ b/pandas/core/computation/expr.py
@@ -550,7 +550,7 @@ def visit_Num(self, node, **kwargs) -> Term:
return self.const_type(node.n, self.env)
def visit_Constant(self, node, **kwargs) -> Term:
- return self.const_type(node.n, self.env)
+ return self.const_type(node.value, self.env)
def visit_Str(self, node, **kwargs):
name = self.env.add_tmp(node.s)

View File

@ -149,6 +149,9 @@ Patch: https://github.com/pandas-dev/pandas/pull/52150.patch
# All commits cherry-picked to tag v1.5.3 and combined into a single patch.
Patch: pandas-1.5.3-pyarrow-10-11-12.patch
# Fix deprecation warning with Python 3.12.
Patch: https://github.com/pandas-dev/pandas/pull/54188.patch
%global _description %{expand:
pandas is an open source, BSD-licensed library providing
high-performance, easy-to-use data structures and data