From 6e193dd6d2f6ad4c88b2d450d0549d88db92835f Mon Sep 17 00:00:00 2001 From: Egor Dranischnikow Date: Sat, 3 Jul 2021 21:06:45 +0200 Subject: [PATCH 1/3] do not use _PyHASH_Imag it is not defined in PyPy --- pandas/_libs/src/klib/khash_python.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/_libs/src/klib/khash_python.h b/pandas/_libs/src/klib/khash_python.h index 04a6bf48c50c2..c0fca76ef701e 100644 --- a/pandas/_libs/src/klib/khash_python.h +++ b/pandas/_libs/src/klib/khash_python.h @@ -272,6 +272,8 @@ Py_hash_t PANDAS_INLINE floatobject_hash(PyFloatObject* key) { } +#define _PandasHASH_IMAG 1000003UL + // replaces _Py_HashDouble with _Pandas_HashDouble Py_hash_t PANDAS_INLINE complexobject_hash(PyComplexObject* key) { Py_uhash_t realhash = (Py_uhash_t)_Pandas_HashDouble(key->cval.real); @@ -279,7 +281,7 @@ Py_hash_t PANDAS_INLINE complexobject_hash(PyComplexObject* key) { if (realhash == (Py_uhash_t)-1 || imaghash == (Py_uhash_t)-1) { return -1; } - Py_uhash_t combined = realhash + _PyHASH_IMAG * imaghash; + Py_uhash_t combined = realhash + _PandasHASH_IMAG * imaghash; if (combined == (Py_uhash_t)-1) { return -2; } From afd06e2b737dd99a6f7080948846b6ce3922fe34 Mon Sep 17 00:00:00 2001 From: Egor Dranischnikow Date: Sun, 4 Jul 2021 06:50:24 +0200 Subject: [PATCH 2/3] adding whatsnew --- doc/source/whatsnew/v1.3.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.3.1.rst b/doc/source/whatsnew/v1.3.1.rst index 805bddb7d63e7..3a714bdbc8648 100644 --- a/doc/source/whatsnew/v1.3.1.rst +++ b/doc/source/whatsnew/v1.3.1.rst @@ -14,7 +14,7 @@ including other versions of pandas. Fixed regressions ~~~~~~~~~~~~~~~~~ -- +- Pandas could not be build on PyPy (GH-42355) - .. --------------------------------------------------------------------------- From 7018937ae1a5be1d3238bc6d78f24cfbb5d3f6fe Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Sun, 4 Jul 2021 14:09:18 -0400 Subject: [PATCH 3/3] Update doc/source/whatsnew/v1.3.1.rst --- doc/source/whatsnew/v1.3.1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.3.1.rst b/doc/source/whatsnew/v1.3.1.rst index 3a714bdbc8648..eaf514bcd2053 100644 --- a/doc/source/whatsnew/v1.3.1.rst +++ b/doc/source/whatsnew/v1.3.1.rst @@ -14,7 +14,7 @@ including other versions of pandas. Fixed regressions ~~~~~~~~~~~~~~~~~ -- Pandas could not be build on PyPy (GH-42355) +- Pandas could not be built on PyPy (:issue:`42355`) - .. ---------------------------------------------------------------------------