dask / dask/partd

Tests fail with pandas 3

Open
#82 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
107
Forks
32
PR merge metrics
No merged PRs in 30d

Description

When preparing Fedora for upgrading to pandas3 the following tests fail when building against the new version. Would it be possible to port to support the new version.

```
=================================== FAILURES ===================================
______________________________ test_PandasColumns ______________________________

def test_PandasColumns():
with PandasColumns() as p:
assert os.path.exists(p.partd.partd.path)

> p.append({'x': df1, 'y': df2})

partd/tests/test_pandas.py:32:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../BUILDROOT/usr/lib/python3.14/site-packages/partd/pandas.py:56: in append
self.partd.append(arrays, **kwargs)
../BUILDROOT/usr/lib/python3.14/site-packages/partd/numpy.py:55: in append
self.partd.iset(suffix(k, '.dtype'), serialize_dtype(v.dtype))
^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

dt =

def serialize_dtype(dt):
""" Serialize dtype to bytes

>>> serialize_dtype(np.dtype('i4'))
b'>> serialize_dtype(np.dtype('M8[us]'))
b' return dt.str.encode()
^^^^^^
E AttributeError: 'StringDtype' object has no attribute 'str'

../BUILDROOT/usr/lib/python3.14/site-packages/partd/numpy.py:25: AttributeError
____________________________ test_column_selection _____________________________

def test_column_selection():
with PandasColumns('foo') as p:
> p.append({'x': df1, 'y': df2})

partd/tests/test_pandas.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../BUILDROOT/usr/lib/python3.14/site-packages/partd/pandas.py:56: in append
self.partd.append(arrays, **kwargs)
../BUILDROOT/usr/lib/python3.14/site-packages/partd/numpy.py:55: in append
self.partd.iset(suffix(k, '.dtype'), serialize_dtype(v.dtype))
^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

dt =

def serialize_dtype(dt):
""" Serialize dtype to bytes

>>> serialize_dtype(np.dtype('i4'))
b'>> serialize_dtype(np.dtype('M8[us]'))
b' return dt.str.encode()
^^^^^^
E AttributeError: 'StringDtype' object has no attribute 'str'

../BUILDROOT/usr/lib/python3.14/site-packages/partd/numpy.py:25: AttributeError
=========================== short test summary info ============================
FAILED partd/tests/test_pandas.py::test_PandasColumns - AttributeError: 'Stri...
FAILED partd/tests/test_pandas.py::test_column_selection - AttributeError: 'S...
=================== 2 failed, 53 passed, 1 skipped in 1.16s ====================
```

Contributor guide

Open the contributing guide

Research direction

Start with partd/numpy.py, where serialize_dtype raises the StringDtype error, and partd/tests/test_pandas.py, especially test_PandasColumns and test_column_selection. Reproduce the failures with pandas 3, then verify those tests and the existing suite pass without the reported AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.