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

BUG/TST (string dtype): raise proper TypeError in interpolate #60637

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

rhshadrach
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@rhshadrach rhshadrach added Testing pandas testing functions or related to the test suite Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Strings String extension data type and string data labels Dec 31, 2024
@rhshadrach rhshadrach added this to the 2.3 milestone Dec 31, 2024
@rhshadrach rhshadrach changed the title Str xfail interpolate TST(string dtype): Resolve xfail for interpolate Dec 31, 2024
Comment on lines 88 to 89
if not using_infer_string:
assert np.shares_memory(df["D"]._values, dvalues)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With EAs, I don't think there can be any expectation that this is holds.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not using_infer_string:
assert np.shares_memory(df["D"]._values, dvalues)
assert tm.shares_memory(df["D"]._values, dvalues)

If we use our own helper that can handle EAs, it actually still appears to be true

@jorisvandenbossche jorisvandenbossche changed the title TST(string dtype): Resolve xfail for interpolate BUG/TST (string dtype): raise proper TypeError in interpolate Jan 2, 2025
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good!

Comment on lines 88 to 89
if not using_infer_string:
assert np.shares_memory(df["D"]._values, dvalues)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if not using_infer_string:
assert np.shares_memory(df["D"]._values, dvalues)
assert tm.shares_memory(df["D"]._values, dvalues)

If we use our own helper that can handle EAs, it actually still appears to be true

@mroeschke mroeschke merged commit 5e50d3f into pandas-dev:main Jan 3, 2025
51 checks passed
@mroeschke
Copy link
Member

Thanks @rhshadrach

Copy link

lumberbot-app bot commented Jan 3, 2025

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 5e50d3f3d2b0ee65f0d5bfda0c6da47ffd39dcfe
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #60637: BUG/TST (string dtype): raise proper TypeError in interpolate'
  1. Push to a named branch:
git push YOURFORK 2.3.x:auto-backport-of-pr-60637-on-2.3.x
  1. Create a PR against branch 2.3.x, I would have named this PR:

"Backport PR #60637 on branch 2.3.x (BUG/TST (string dtype): raise proper TypeError in interpolate)"

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 pushed a commit to jorisvandenbossche/pandas that referenced this pull request Jan 3, 2025
…-dev#60637)

* TST(string dtype): Resolve xfail for interpolate

* Adjust arrow tests

* Fixup for NumPyExtensionArray

* Use tm.shares_memory

(cherry picked from commit 5e50d3f)
@jorisvandenbossche
Copy link
Member

Manual backport -> #60652

@rhshadrach rhshadrach deleted the str_xfail_interpolate branch January 3, 2025 10:14
jorisvandenbossche added a commit that referenced this pull request Jan 3, 2025
…terpolate (#60637) (#60652)

BUG/TST (string dtype): raise proper TypeError in interpolate (#60637)

* TST(string dtype): Resolve xfail for interpolate

* Adjust arrow tests

* Fixup for NumPyExtensionArray

* Use tm.shares_memory

(cherry picked from commit 5e50d3f)

Co-authored-by: Richard Shadrach <[email protected]>
gmcrocetti pushed a commit to gmcrocetti/pandas that referenced this pull request Jan 3, 2025
…-dev#60637)

* TST(string dtype): Resolve xfail for interpolate

* Adjust arrow tests

* Fixup for NumPyExtensionArray

* Use tm.shares_memory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Strings String extension data type and string data Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants