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

CLN/DEPR: remove pd.ordered_merge #18459

Merged
merged 2 commits into from
Nov 24, 2017

Conversation

topper-123
Copy link
Contributor

pd.ordered_merge was deprecated in #13358 (pandas v.0.19). This PR removes it from the code base.

@codecov
Copy link

codecov bot commented Nov 24, 2017

Codecov Report

Merging #18459 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 89.14% <100%> (-0.01%) ⬇️
#single 39.66% <100%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/reshape/api.py 100% <100%> (ø) ⬆️
pandas/core/reshape/merge.py 94.28% <100%> (-0.04%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.8% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e67065...e1b862a. Read the comment docs.

@codecov
Copy link

codecov bot commented Nov 24, 2017

Codecov Report

Merging #18459 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 89.14% <100%> (-0.01%) ⬇️
#single 39.66% <100%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/reshape/api.py 100% <100%> (ø) ⬆️
pandas/core/reshape/merge.py 94.28% <100%> (-0.04%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.8% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e67065...e1b862a. Read the comment docs.

@codecov
Copy link

codecov bot commented Nov 24, 2017

Codecov Report

Merging #18459 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 89.14% <100%> (-0.01%) ⬇️
#single 39.66% <100%> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/core/reshape/merge.py 94.28% <ø> (-0.04%) ⬇️
pandas/core/reshape/api.py 100% <100%> (ø) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.8% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aec3347...0e3f539. Read the comment docs.

@jorisvandenbossche jorisvandenbossche changed the title DEPR: remove pd.ordered_merge CLN/DEPR: remove pd.ordered_merge Nov 24, 2017
@jorisvandenbossche jorisvandenbossche added Clean Deprecate Functionality to remove in pandas labels Nov 24, 2017
@jorisvandenbossche jorisvandenbossche added this to the 0.22.0 milestone Nov 24, 2017
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a 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!

try:
from pandas import merge_ordered
except ImportError:
from pandas import ordered_merge as merge_ordered
Copy link
Member

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)

Copy link
Contributor Author

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?

Copy link
Member

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)

Copy link
Contributor Author

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.

@@ -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'
Copy link
Member

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)

Copy link
Contributor Author

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?

Copy link
Member

@jorisvandenbossche jorisvandenbossche Nov 24, 2017

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)

@jreback jreback merged commit 6660638 into pandas-dev:master Nov 24, 2017
@jreback
Copy link
Contributor

jreback commented Nov 24, 2017

thanks @topper-123

@topper-123 topper-123 deleted the remove_ordered_merge branch November 24, 2017 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants