Skip to content

REGR: merge with 3rd party EA's can sometimes raise ValueError #57333

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

Merged
merged 3 commits into from
Feb 10, 2024

Conversation

lukemanley
Copy link
Member

@lukemanley lukemanley added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Regression Functionality that used to work in a prior pandas version labels Feb 10, 2024
@lukemanley lukemanley added this to the 2.2.1 milestone Feb 10, 2024
@lukemanley lukemanley requested a review from WillAyd as a code owner February 10, 2024 02:56
@@ -301,7 +301,7 @@ cdef class IndexEngine:
values = self.values
self.monotonic_inc, self.monotonic_dec, is_strict_monotonic = \
self._call_monotonic(values)
except (TypeError, InvalidOperation):
except (TypeError, InvalidOperation, ValueError):
Copy link
Member

Choose a reason for hiding this comment

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

can we test this somehow? We have "test_downstream.py" for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

would you be ok with just testing against a pyarrow list type? e.g. this raises a ValueError:

import pyarrow as pa
import pandas as pd

arr = pd.array([[1], [2, 3]], dtype=pd.ArrowDtype(pa.list_(pa.int64())))

pd.Index(arr).is_monotonic_increasing  # ValueError

Copy link
Member

Choose a reason for hiding this comment

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

Yep that’s fine

Copy link
Member

@phofl phofl Feb 10, 2024

Choose a reason for hiding this comment

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

I just want to avoid that someone removes the ValueError and the tests don’t fail

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks, test added

@phofl phofl merged commit 2e0ef79 into pandas-dev:main Feb 10, 2024
@phofl
Copy link
Member

phofl commented Feb 10, 2024

Thx @lukemanley

Copy link

lumberbot-app bot commented Feb 10, 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.2.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 2e0ef79dd48b13045ff3539df895c3b647c25403
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am "Backport PR #57333: REGR: merge with 3rd party EA's can sometimes raise ValueError"
  1. Push to a named branch:
git push YOURFORK 2.2.x:auto-backport-of-pr-57333-on-2.2.x
  1. Create a PR against branch 2.2.x, I would have named this PR:

"Backport PR #57333 on branch 2.2.x (REGR: merge with 3rd party EA's can sometimes raise ValueError)"

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.

lukemanley added a commit to lukemanley/pandas that referenced this pull request Feb 10, 2024
phofl pushed a commit that referenced this pull request Feb 10, 2024
…an sometimes raise ValueError) (#57337)

Backport PR #57333: REGR: merge with 3rd party EA's can sometimes raise ValueError
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: ExtensionArray no longer can be merged with Pandas 2.2
2 participants