-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
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
Conversation
There was a problem hiding this 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)
doc/source/whatsnew/v0.25.2.rst
Outdated
@@ -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`). |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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"]
doc/source/whatsnew/v0.25.2.rst
Outdated
@@ -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`). |
There was a problem hiding this comment.
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"], |
There was a problem hiding this comment.
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
thanks @jjlkant |
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? |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff