-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ERR: ValueError when merging on incompatible dtypes #18674
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
Hello @reidy-p! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on December 09, 2017 at 15:46 Hours UTC |
pandas/core/reshape/merge.py
Outdated
|
||
# Check if we are trying to merge on obviously | ||
# incompatible dtypes GH 9780 | ||
msg = ("You are trying to merge on {lk_dtype} and " |
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.
can you do these as separate elif (rather than catch these on the big else, which should be just for the object type)
left = df | ||
for col in df.columns: | ||
right = DataFrame({'A': df[col]}) | ||
result = pd.merge(left, right, on='A') |
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.
can you parameterize this test
Codecov Report
@@ Coverage Diff @@
## master #18674 +/- ##
==========================================
- Coverage 91.6% 91.56% -0.05%
==========================================
Files 153 153
Lines 51273 51285 +12
==========================================
- Hits 46970 46957 -13
- Misses 4303 4328 +25
Continue to review full report at Codecov.
|
d531ac5
to
0e9a975
Compare
rebase and looks good to go. |
0e9a975
to
ba5aa95
Compare
doc/source/whatsnew/v0.22.0.txt
Outdated
@@ -186,6 +186,8 @@ Other API Changes | |||
- :func:`Series.fillna` now raises a ``TypeError`` instead of a ``ValueError`` when passed a list, tuple or DataFrame as a ``value`` (:issue:`18293`) | |||
- :func:`pandas.DataFrame.merge` no longer casts a ``float`` column to ``object`` when merging on ``int`` and ``float`` columns (:issue:`16572`) | |||
- The default NA value for :class:`UInt64Index` has changed from 0 to ``NaN``, which impacts methods that mask with NA, such as ``UInt64Index.where()`` (:issue:`18398`) | |||
- Building pandas for development now requires ``cython >= 0.24`` (:issue:`18613`) |
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.
hmm this moved, can you fixup
fa306e4
to
cc03f5a
Compare
cc03f5a
to
0ca53a5
Compare
thanks @reidy-p |
git diff upstream/master -u -- "*.py" | flake8 --diff