Skip to content

Commit 5c17862

Browse files
timfelmsimacek
authored andcommitted
Add pandas 2.2.3 patch
1 parent 92d279e commit 5c17862

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

graalpython/lib-graalpython/patches/metadata.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ patch = 'pandas-2.2.2.patch'
367367
license = 'BSD-3-Clause'
368368
dist-type = 'sdist'
369369

370+
[[pandas.rules]]
371+
version = '== 2.2.3'
372+
patch = 'pandas-2.2.3.patch'
373+
license = 'BSD-3-Clause'
374+
dist-type = 'sdist'
375+
370376
[[pandas.rules]]
371377
version = '== 2.0.3'
372378
patch = 'pandas-2.0.3.patch'
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
diff --git a/pandas/_libs/include/pandas/vendored/klib/khash_python.h b/pandas/_libs/include/pandas/vendored/klib/khash_python.h
2+
index 5a933b4..f579fc6 100644
3+
--- a/pandas/_libs/include/pandas/vendored/klib/khash_python.h
4+
+++ b/pandas/_libs/include/pandas/vendored/klib/khash_python.h
5+
@@ -173,13 +173,15 @@ static inline int floatobject_cmp(PyFloatObject *a, PyFloatObject *b) {
6+
// PyObject_RichCompareBool for complexobjects has a different behavior
7+
// needs to be replaced
8+
static inline int complexobject_cmp(PyComplexObject *a, PyComplexObject *b) {
9+
- return (Py_IS_NAN(a->cval.real) && Py_IS_NAN(b->cval.real) &&
10+
- Py_IS_NAN(a->cval.imag) && Py_IS_NAN(b->cval.imag)) ||
11+
- (Py_IS_NAN(a->cval.real) && Py_IS_NAN(b->cval.real) &&
12+
- a->cval.imag == b->cval.imag) ||
13+
- (a->cval.real == b->cval.real && Py_IS_NAN(a->cval.imag) &&
14+
- Py_IS_NAN(b->cval.imag)) ||
15+
- (a->cval.real == b->cval.real && a->cval.imag == b->cval.imag);
16+
+ Py_complex a_cval = PyComplex_AsCComplex((PyObject*)a);
17+
+ Py_complex b_cval = PyComplex_AsCComplex((PyObject*)b);
18+
+ return (Py_IS_NAN(a_cval.real) && Py_IS_NAN(b_cval.real) &&
19+
+ Py_IS_NAN(a_cval.imag) && Py_IS_NAN(b_cval.imag)) ||
20+
+ (Py_IS_NAN(a_cval.real) && Py_IS_NAN(b_cval.real) &&
21+
+ a_cval.imag == b_cval.imag) ||
22+
+ (a_cval.real == b_cval.real && Py_IS_NAN(a_cval.imag) &&
23+
+ Py_IS_NAN(b_cval.imag)) ||
24+
+ (a_cval.real == b_cval.real && a_cval.imag == b_cval.imag);
25+
}
26+
27+
static inline int pyobject_cmp(PyObject *a, PyObject *b);
28+
@@ -250,8 +252,9 @@ static inline Py_hash_t floatobject_hash(PyFloatObject *key) {
29+
30+
// replaces _Py_HashDouble with _Pandas_HashDouble
31+
static inline Py_hash_t complexobject_hash(PyComplexObject *key) {
32+
- Py_uhash_t realhash = (Py_uhash_t)_Pandas_HashDouble(key->cval.real);
33+
- Py_uhash_t imaghash = (Py_uhash_t)_Pandas_HashDouble(key->cval.imag);
34+
+ Py_complex cval = PyComplex_AsCComplex((PyObject*)key);
35+
+ Py_uhash_t realhash = (Py_uhash_t)_Pandas_HashDouble(cval.real);
36+
+ Py_uhash_t imaghash = (Py_uhash_t)_Pandas_HashDouble(cval.imag);
37+
if (realhash == (Py_uhash_t)-1 || imaghash == (Py_uhash_t)-1) {
38+
return -1;
39+
}
40+
diff --git a/pyproject.toml b/pyproject.toml
41+
index db9f055..c191232 100644
42+
--- a/pyproject.toml
43+
+++ b/pyproject.toml
44+
@@ -5,7 +5,7 @@ requires = [
45+
"meson-python==0.13.1",
46+
"meson==1.2.1",
47+
"wheel",
48+
- "Cython~=3.0.5", # Note: sync with setup.py, environment.yml and asv.conf.json
49+
+ "Cython==3.0.10", # Note: sync with setup.py, environment.yml and asv.conf.json
50+
# Force numpy higher than 2.0, so that built wheels are compatible
51+
# with both numpy 1 and 2
52+
"numpy>=2.0",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy