Skip to content

CLN: Remove Legacy MultiIndex Index Compatibility #21740

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

Conversation

elmq0022
Copy link
Contributor

@elmq0022 elmq0022 commented Jul 5, 2018

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

pls add a whatsnew note - removing legacy MuktiIndex internal formats

def test_legacy_pickle(datapath):

path = datapath('indexes', 'multi', 'data', 'multiindex_v1.pickle')
obj = pd.read_pickle(path)
Copy link
Contributor

Choose a reason for hiding this comment

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

can u also remove the legacy code itself from MultiIndex

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, I came to the conclusion that I can just delete the __setstate__ method as there is no associated __getstate__ method. I hope this approach is correct.

@gfyoung gfyoung added Testing pandas testing functions or related to the test suite MultiIndex Clean Compat pandas objects compatability with Numpy or Python functions labels Jul 5, 2018
@codecov
Copy link

codecov bot commented Jul 5, 2018

Codecov Report

Merging #21740 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21740      +/-   ##
==========================================
+ Coverage   92.05%   92.05%   +<.01%     
==========================================
  Files         170      170              
  Lines       50708    50697      -11     
==========================================
- Hits        46677    46668       -9     
+ Misses       4031     4029       -2
Flag Coverage Δ
#multiple 90.46% <ø> (ø) ⬆️
#single 42.36% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/multi.py 95.25% <ø> (+0.12%) ⬆️

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 7a2fbce...ae446bc. Read the comment docs.

@elmq0022
Copy link
Contributor Author

elmq0022 commented Jul 5, 2018 via email

@jreback jreback changed the title fix issue #21654 CLN: remove legacy MultiIndex #21654 Jul 5, 2018
@elmq0022 elmq0022 force-pushed the remove_multiindex_pickles branch from 10c8a23 to 12a612e Compare July 6, 2018 02:41
levels = state.get('levels')
labels = state.get('labels')
sortorder = state.get('sortorder')
names = state.get('names')
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm i don't think you can remove this.


elif isinstance(state, tuple):

nd_state, own_state = state
Copy link
Contributor

Choose a reason for hiding this comment

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

there are the _v1 and _v2 properties you can remove though

Copy link
Contributor

Choose a reason for hiding this comment

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

also the _bounds, & get_major_bounds are not used either (I may have a separate issue number for that)

@elmq0022 elmq0022 force-pushed the remove_multiindex_pickles branch from 12a612e to 1313ee1 Compare July 14, 2018 16:02
@elmq0022
Copy link
Contributor Author

elmq0022 commented Jul 14, 2018

@jreback I am not sure what happened with the circleci build. I could use some help with the postmortem as I haven't dealt with circleci directly before.

def test_bounds(idx):
idx._bounds
# def test_bounds(idx):
# idx._bounds
Copy link
Member

Choose a reason for hiding this comment

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

If this is no longer needed, just delete.

@jbrockmendel
Copy link
Member

Looks like circleCI fail may be unrelated. Pushing a new commit will have it try again.

@elmq0022
Copy link
Contributor Author

elmq0022 commented Jul 19, 2018 via email

@@ -444,7 +444,7 @@ Missing
MultiIndex
^^^^^^^^^^

-
- Removing legacy MultiIndex internal formats
Copy link
Contributor

Choose a reason for hiding this comment

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

add the issue number

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, will add the issue number tonight and resubmit. Looks like the first failure was something on AppVeyor's side.

Copy link
Member

Choose a reason for hiding this comment

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

Also, the above message is unclear to me what it is about (as an external reader, didn't look at the rest of the PR)

@elmq0022 elmq0022 force-pushed the remove_multiindex_pickles branch from 1313ee1 to 768adf2 Compare July 22, 2018 23:08
@elmq0022 elmq0022 changed the title CLN: remove legacy MultiIndex #21654 CLN: Remove Legacy MultiIndex Index Compatibility Jul 24, 2018
@elmq0022 elmq0022 force-pushed the remove_multiindex_pickles branch from 768adf2 to 08a9701 Compare July 24, 2018 01:57
@elmq0022
Copy link
Contributor Author

@jreback I think this is good to go.

@elmq0022 elmq0022 force-pushed the remove_multiindex_pickles branch from 08a9701 to aad8ccb Compare July 25, 2018 01:40
@elmq0022
Copy link
Contributor Author

@jreback I rebased after the latest merge should be good to go. Thanks!

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

minor comment. ping on green.

@@ -15,8 +15,8 @@ def test_shift(idx):
pytest.raises(NotImplementedError, idx.shift, 1, 2)


def test_bounds(idx):
idx._bounds
# def test_bounds(idx):
Copy link
Contributor

Choose a reason for hiding this comment

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

remote this entirely

@jreback jreback added this to the 0.24.0 milestone Jul 25, 2018
@elmq0022
Copy link
Contributor Author

elmq0022 commented Jul 25, 2018 via email

@@ -513,7 +513,7 @@ Missing
MultiIndex
^^^^^^^^^^

-
- Removed legacy internal formats (:issue:`21654`)
Copy link
Member

Choose a reason for hiding this comment

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

Putting it here again: the above message is unclear to me what it is about.

Either this change is not relevant for the user (eg only internal clean-up), and not whatsnew notice is needed. Or it is, but then needs to be clarified (eg do we drop support for very old pickle files?)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we have tests for really old pickle files You could add a note that this is circa 0.8.0, where we only maintain back compat for pickle to 0.13 (IIRC)

Copy link
Member

Choose a reason for hiding this comment

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

if that is the case, I would maybe just remove the what's new notice? (since the 0.13 threshold is already documented I assume?)

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah I don't think this has any user visible effects, but still having a whatsnew note just documents what we did. I would expand the note slightly but leave it.

Copy link
Member

Choose a reason for hiding this comment

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

We don't always add a whatsnew note for internal code clean-up (if it has no user visible change), so I still don't think it is needed here. Anyhow, if we keep one, it should be comprehensible for users (the current one is not even comprehensible for me without looking at the issue)

@elmq0022
Copy link
Contributor Author

elmq0022 commented Jul 26, 2018 via email

@elmq0022 elmq0022 force-pushed the remove_multiindex_pickles branch from aad8ccb to ae446bc Compare July 27, 2018 02:10
@elmq0022
Copy link
Contributor Author

@jreback everything is green. Thank you for all your help on refactoring this MultiIndex text suite.

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.

Thanks for the update, that's clear now!

@jorisvandenbossche jorisvandenbossche merged commit 114f415 into pandas-dev:master Jul 27, 2018
@elmq0022
Copy link
Contributor Author

elmq0022 commented Jul 27, 2018 via email

minggli added a commit to minggli/pandas that referenced this pull request Jul 28, 2018
* master:
  BENCH: asv csv reading benchmarks no longer read StringIO objects off the end (pandas-dev#21807)
  BUG: df.agg, df.transform and df.apply use different methods when axis=1 than when axis=0 (pandas-dev#21224)
  BUG: bug in GroupBy.count where arg minlength passed to np.bincount must be None for np<1.13 (pandas-dev#21957)
  CLN: Vbench to asv conversion script (pandas-dev#22089)
  consistent docstring (pandas-dev#22066)
  TST: skip pytables test with not-updated pytables conda package (pandas-dev#22099)
  CLN: Remove Legacy MultiIndex Index Compatibility (pandas-dev#21740)
  DOC: Reword doc for filepath_or_buffer in read_csv (pandas-dev#22058)
  BUG: rolling with MSVC 2017 build (pandas-dev#21813)
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Compat pandas objects compatability with Numpy or Python functions MultiIndex Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST/CLN: remove MultiIndex compat
5 participants