From d886e03fe383a0c581d50c4e8cffc61705874e30 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 19 Jul 2023 03:03:02 -0400 Subject: [PATCH] Fix deprecation warning on Python 3.12 --- 54188.patch | 24 ++++++++++++++++++++++++ python-pandas.spec | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 54188.patch diff --git a/54188.patch b/54188.patch new file mode 100644 index 0000000..253460f --- /dev/null +++ b/54188.patch @@ -0,0 +1,24 @@ +From f25740ff7d6dcbf4c5a3e0d03d0a3eaf2f3d72a4 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +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) diff --git a/python-pandas.spec b/python-pandas.spec index 8674c81..d05bcb5 100644 --- a/python-pandas.spec +++ b/python-pandas.spec @@ -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