public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-partd] rawhide: Backport upstream patch for compatibility with pandas 3
@ 2026-06-08 19:11
0 siblings, 0 replies; only message in thread
From: @ 2026-06-08 19:11 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-partd
Branch : rawhide
Commit : a8296f0dbd8bbf75128318692753a2dd0caca76b
Author : Tomáš Hrnčiar <thrnciar@redhat.com>
Date : 2026-06-08T15:37:43+02:00
Stats : +38/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-partd/c/a8296f0dbd8bbf75128318692753a2dd0caca76b?branch=rawhide
Log:
Backport upstream patch for compatibility with pandas 3
---
diff --git a/83.patch b/83.patch
new file mode 100644
index 0000000..bee0795
--- /dev/null
+++ b/83.patch
@@ -0,0 +1,35 @@
+From 3efd8ec7e35a7c0aa1ba15ba2cf0766af99d3c21 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <tomas.hrnciar@me.com>
+Date: Mon, 8 Jun 2026 15:24:18 +0200
+Subject: [PATCH] Fix PandasColumns compatibility with pandas 3.0 StringDtype
+
+In pandas 3.0, string columns default to StringDtype instead of
+object dtype. PandasColumns.append() passes column .values to the Numpy backend, which calls serialize_dtype(dt) -> dt.str.encode().
+StringDtype (an ExtensionDtype) does not have a .str attribute,
+causing AttributeError.
+
+Use .to_numpy() instead of .values to ensure extension arrays are converted to numpy arrays before serialization. Pandas 3.0 re-infers StringDtype when reconstructing DataFrames, preserving round-trip correctness.
+
+Fixes: https://github.com/dask/partd/issues/82
+Assisted-by: Claude Opus 4.6
+---
+ partd/pandas.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/partd/pandas.py b/partd/pandas.py
+index 36c1b01..e0fac96 100644
+--- a/partd/pandas.py
++++ b/partd/pandas.py
+@@ -47,10 +47,10 @@ def append(self, data, **kwargs):
+
+ # TODO: don't use values, it does some work. Look at _blocks instead
+ # pframe/cframe do this well
+- arrays = {extend(k, col): df[col].values
++ arrays = {extend(k, col): df[col].to_numpy()
+ for k, df in data.items()
+ for col in df.columns}
+- arrays.update({extend(k, '.index'): df.index.values
++ arrays.update({extend(k, '.index'): df.index.to_numpy()
+ for k, df in data.items()})
+ # TODO: handle categoricals
+ self.partd.append(arrays, **kwargs)
diff --git a/python-partd.spec b/python-partd.spec
index 9a8d96e..2bd64d9 100644
--- a/python-partd.spec
+++ b/python-partd.spec
@@ -9,6 +9,9 @@ License: BSD-3-Clause
URL: https://github.com/dask/partd
Source: %pypi_source %{srcname}
+# Fix PandasColumns compatibility with pandas 3.0 StringDtype
+Patch: https://github.com/dask/partd/pull/83.patch
+
BuildArch: noarch
# Needed for the zeromq test
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-08 19:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08 19:11 [rpms/python-partd] rawhide: Backport upstream patch for compatibility with pandas 3
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox