-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
CLN/DEPR: remove pd.ordered_merge #18459
Conversation
af88842
to
e1b862a
Compare
Codecov Report
@@ Coverage Diff @@
## master #18459 +/- ##
==========================================
- Coverage 91.35% 91.34% -0.02%
==========================================
Files 163 163
Lines 49695 49691 -4
==========================================
- Hits 45401 45388 -13
- Misses 4294 4303 +9
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18459 +/- ##
==========================================
- Coverage 91.35% 91.34% -0.02%
==========================================
Files 163 163
Lines 49695 49691 -4
==========================================
- Hits 45401 45388 -13
- Misses 4294 4303 +9
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18459 +/- ##
==========================================
- Coverage 91.36% 91.34% -0.02%
==========================================
Files 163 163
Lines 49704 49700 -4
==========================================
- Hits 45411 45398 -13
- Misses 4293 4302 +9
Continue to review full report at Codecov.
|
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.
Some comments, but looks good for the rest!
asv_bench/benchmarks/join_merge.py
Outdated
try: | ||
from pandas import merge_ordered | ||
except ImportError: | ||
from pandas import ordered_merge as merge_ordered |
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.
You can still leave this one here (in case you want to compare a benchmark with pandas 0.18, which is quite unlikely, so we need to decide at a certain point how to deal with such things in the asv benchmarks, but let's leave that for another issue)
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.
I'm not sure I understand: merge_ordered
will always exist, so the ImportError is never reached and hence the try/except can be removed. Or am I misunderstanding something?
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.
Eg in pandas 0.18.0 merge_ordered
does not exist, and then the except part will be reached. The thing with benchmarks is that you run the latest (master) version of the benchmark also on older code (so benchmarks in master do not only need to satisfy master itself)
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.
Ok, I understand, thansk for explaining. I will update the PR later tonight.
pandas/core/reshape/merge.py
Outdated
@@ -1083,7 +1067,7 @@ def _get_join_indexers(left_keys, right_keys, sort=False, how='inner', | |||
|
|||
|
|||
class _OrderedMerge(_MergeOperation): | |||
_merge_type = 'ordered_merge' | |||
_merge_type = 'merge_ordered' |
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.
This one should not be changed I think. _merge_type
is passed to __finalize__
, so is mainly meant for subclasses being able to do something special. So we can leave that intact (only very advanced use case anyhow, it is not visible to normal user)
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.
I don't understand this either: ordered_merge
is removed, so calling it in that finanlize
would cause an AttributeError. What am I missing here?
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.
ordered_merge
and merge_ordered
where just aliases for the same underlying code, so both have been using _merge_type = ordered_merge
. Changing this could break subclasses (as you are changing it for merge_ordered
)
55e93d2
to
0e3f539
Compare
thanks @topper-123 |
git diff upstream/master -u -- "*.py" | flake8 --diff
pd.ordered_merge
was deprecated in #13358 (pandas v.0.19). This PR removes it from the code base.