Skip to content

BUG: Allow all int types for merge (GH28870) #28875

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 8 commits into from
Oct 11, 2019

Conversation

jjlkant
Copy link
Contributor

@jjlkant jjlkant commented Oct 9, 2019

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

  • Needs a test to confirm the behavior has been fixed.
  • Needs a new whatsnew entry (in 0.25.2)

@jjlkant jjlkant requested a review from mroeschke October 9, 2019 21:54
@jjlkant jjlkant changed the title Allow all int types for merge BUG: Allow all int types for merge (GH28870) Oct 9, 2019
@@ -86,7 +86,7 @@ Groupby/resample/rolling
Reshaping
^^^^^^^^^

-
- Fix to ensure all int dtypes can be used in :meth:`pandas.core.reshape.merge_asof` when using a tolerance value (:issue:`28870`).
Copy link
Member

Choose a reason for hiding this comment

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

:func:`merge_asof` and maybe clarify that any non-int64 integer previously raised an erroneous MergeError


left = pd.DataFrame({"a": [0, 100, 200], "left_val": [1, 2, 3]})
right = pd.DataFrame({"a": [50, 150, 250], "right_val": [1, 2, 3]})
left["a"] = left["a"].astype(np.int32)
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 pytest.mark.parameterize over more int dtypes. e.g. [int, "int64", "int32", "int16", "int8", "uint64", "uint32", "uint16", "uint8"]

@@ -86,7 +86,7 @@ Groupby/resample/rolling
Reshaping
^^^^^^^^^

-
- Fix to ensure all int dtypes can be used in :func:`merge_asof` when using a tolerance value. Before every non-int64 type would raise an erroneous ``MergeError`` (:issue:`28870`).
Copy link
Contributor

Choose a reason for hiding this comment

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

moved to 1.0

Before -> Previously


@pytest.mark.parametrize(
"dtype",
[int, "int64", "int32", "int16", "int8", "uint64", "uint32", "uint16", "uint8"],
Copy link
Contributor

Choose a reason for hiding this comment

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

use the any_int_dtype fixture instead

@jreback jreback added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Oct 10, 2019
@jreback jreback added this to the 1.0 milestone Oct 10, 2019
@jjlkant jjlkant requested a review from jreback October 10, 2019 15:08
@jreback jreback merged commit 6241b9d into pandas-dev:master Oct 11, 2019
@jreback
Copy link
Contributor

jreback commented Oct 11, 2019

thanks @jjlkant

@jreback
Copy link
Contributor

jreback commented Oct 11, 2019

a side issue, i suspect we don't have asv (performance tests for all of the int indexers) (and its possible since we don't have implementations for some of the non-int64 indexers they may be non-performant).

would you be up to submitting a PR for this?

#28922

@jjlkant jjlkant deleted the merge_int_type branch October 12, 2019 15:49
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
bongolegend pushed a commit to bongolegend/pandas that referenced this pull request Jan 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merge_asof() Requires specific int type, not reflected in error or documentation
3 participants