pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.86k stars 18.01k forks source link

Backport PR #60321: TST (string dtype): resolve all xfails in IO pars… #60330

Closed WillAyd closed 6 days ago

WillAyd commented 1 week ago

Backport of https://github.com/pandas-dev/pandas/pull/60321

WillAyd commented 1 week ago

Hmm not sure how to fix the failing test here. There's a lot of mutability going on in the CSV parser...but I can trace things back to base_parser.py:510 which calls:

index = ensure_index_from_sequences(arrays, names)

At that point in time, arrays has the right data with the proper dtype:

[array(['01'], dtype=object)]

but the Index constructor seems to force that to str, whereas the test expects object to be maintained.

@jorisvandenbossche any thoughts on this one?

jorisvandenbossche commented 1 week ago

I have a local fix (have to include changes from https://github.com/pandas-dev/pandas/pull/59316 I think), will clean up and push tomorrow

WillAyd commented 1 week ago

@jorisvandenbossche with your added commit I think this is good to merge (?)