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

DEPR: allowing unknown array-likes in merge #48454

Closed

Conversation

jbrockmendel
Copy link
Member

Not sure what the current status is w/r/t new deprecations.

Until we make this change, some of our annotations in this module are lies.

@mroeschke mroeschke added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Deprecate Functionality to remove in pandas labels Sep 8, 2022
@jbrockmendel
Copy link
Member Author

Or we could just change it directly for 2.0. This is a pretty weird corner case

@mroeschke
Copy link
Member

Curious if there was a motivating factor from usage in another library or just self discovered?

@jbrockmendel
Copy link
Member Author

jbrockmendel commented Sep 9, 2022 via email

@mroeschke
Copy link
Member

Or we could just change it directly for 2.0. This is a pretty weird corner case

Up to you how strongly you feel about avoiding this in 2.0. Personally, I think we should use the 2.0 hard break for functionality that would be a PITA to deprecate normally.

@jbrockmendel
Copy link
Member Author

Up to you how strongly you feel about avoiding this in 2.0.

Not the end of the world to wait until 3.0

@mroeschke
Copy link
Member

Cool, then a whatsnew note in 1.6 would probably be good. But hopefully we can do the 1.x deprecation cleaning spree before adding deprecations in 2.0.

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Oct 13, 2022

msg = "will only allow array-like objects that are one of the following types"
with tm.assert_produces_warning(FutureWarning, match=msg):
res = merge(left, right, left_on="A", right_on=arr)
Copy link
Member

Choose a reason for hiding this comment

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

Could you also add tests that the FutureWarning shows up when the dask array is passed to left_on and on?

Copy link
Member Author

Choose a reason for hiding this comment

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

huh this now raises for me locally; i wonder if it isnt getting run on the CI? ive gotta run, will dig into this later

@mroeschke mroeschke removed the Stale label Jan 13, 2023
@jbrockmendel
Copy link
Member Author

This now raises in Int64Factorizer when I pass in a dask.array (in the test this currently adds). In 1.5.3 passing a dask array worked for left_on and right_on, but not on; I'm guessing @phofl's Factorizer work changed this.

My initial motivation here was to be able to accurately annotate the merge code, which ATM uses is_array_like but doesn't actually require "ndarray | EA | Series | Index". Seeing as how the API has already been changed, any objection to making that change explicit+documented by checking for the specific types?

@phofl
Copy link
Member

phofl commented Feb 10, 2023

I'd be ok with that.

Fixing wouldn't be too hard I guess (we called ensure_...) before, but not sure if it's worth it

@jbrockmendel
Copy link
Member Author

Closing, will address in a few months once we confirm no one complains about the changed behavior.

@jbrockmendel jbrockmendel deleted the depr-merge-arraylike branch February 18, 2023 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants