Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST (string dtype): update all tests in tests/frame/indexing #60193

Conversation

jorisvandenbossche
Copy link
Member

This removes most xfails in pandas/tests/frame/indexing. The remaining xfails are actually bugs that need to be fixed (i.e. can't be fixed by just a test update)

The main case that I encountered here is when starting from an empty DataFrame, and then adding columns:

df = pd.DataFrame()
df["a"] = values

will result in an object-dtype columns Index object (because we start with object dtype for the empty frame, and then preserve that dtype when inserting labels).

And when constructing the expected result through a default pd.DataFrane(.., columns=["a"]), you get the future string dtype for the columns Index.

xref #54792

@jorisvandenbossche jorisvandenbossche added the Strings String extension data type and string data label Nov 5, 2024
@jorisvandenbossche jorisvandenbossche added this to the 2.3 milestone Nov 5, 2024
@mroeschke mroeschke merged commit bec2dbc into pandas-dev:main Nov 5, 2024
52 of 55 checks passed
@mroeschke
Copy link
Member

Thanks @jorisvandenbossche

Copy link

lumberbot-app bot commented Nov 5, 2024

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.3.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 bec2dbca274a4f983790d069279a4b3aec184f49
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #60193: TST (string dtype): update all tests in tests/frame/indexing'
  1. Push to a named branch:
git push YOURFORK 2.3.x:auto-backport-of-pr-60193-on-2.3.x
  1. Create a PR against branch 2.3.x, I would have named this PR:

"Backport PR #60193 on branch 2.3.x (TST (string dtype): update all tests in tests/frame/indexing)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@jorisvandenbossche
Copy link
Member Author

Manual backport -> #60212

mroeschke pushed a commit that referenced this pull request Nov 6, 2024
…indexing (#60193) (#60212)

* TST (string dtype): update all tests in tests/frame/indexing (#60193)

(cherry picked from commit bec2dbc)

* update for 2.3.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants