-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
CLN: Remove Legacy MultiIndex Index Compatibility #21740
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.
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) |
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 u also remove the legacy code itself from MultiIndex
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.
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.
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
I read the pickle docs and I believe I have it figured out. Will play with
it a little tonight and see if I have it right. Thanks!
…On Wed, Jul 4, 2018, 8:13 PM Jeff Reback ***@***.***> wrote:
***@***.**** requested changes on this pull request.
pls add a whatsnew note - removing legacy MuktiIndex internal formats
------------------------------
In pandas/tests/indexes/multi/test_conversion.py
<#21740 (comment)>:
> @@ -87,46 +85,6 @@ def test_to_hierarchical():
assert result.names == index.names
***@***.***(PY3, reason="testing legacy pickles not support on py3")
-def test_legacy_pickle(datapath):
-
- path = datapath('indexes', 'multi', 'data', 'multiindex_v1.pickle')
- obj = pd.read_pickle(path)
can u also remove the legacy code itself from MultiIndex
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#21740 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADSn4HQ-X3K-J6n2M_P0bph0ug9GKnNLks5uDWgwgaJpZM4VDHzu>
.
|
10c8a23
to
12a612e
Compare
pandas/core/indexes/multi.py
Outdated
levels = state.get('levels') | ||
labels = state.get('labels') | ||
sortorder = state.get('sortorder') | ||
names = state.get('names') |
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 i don't think you can remove this.
pandas/core/indexes/multi.py
Outdated
|
||
elif isinstance(state, tuple): | ||
|
||
nd_state, own_state = state |
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.
there are the _v1
and _v2
properties you can remove though
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.
also the _bounds
, & get_major_bounds
are not used either (I may have a separate issue number for that)
12a612e
to
1313ee1
Compare
@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 |
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.
If this is no longer needed, just delete.
Looks like circleCI fail may be unrelated. Pushing a new commit will have it try again. |
Thanks. The queue seemed really full that day. Will give it another go.
…On Wed, Jul 18, 2018, 10:30 PM jbrockmendel ***@***.***> wrote:
Looks like circleCI fail may be unrelated. Pushing a new commit will have
it try again.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#21740 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADSn4NcbynbIJtxzI9UiY9EefKrDYDtZks5uH_1JgaJpZM4VDHzu>
.
|
doc/source/whatsnew/v0.24.0.txt
Outdated
@@ -444,7 +444,7 @@ Missing | |||
MultiIndex | |||
^^^^^^^^^^ | |||
|
|||
- | |||
- Removing legacy MultiIndex internal formats |
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.
add the issue number
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.
Okay, will add the issue number tonight and resubmit. Looks like the first failure was something on AppVeyor's side.
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.
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)
1313ee1
to
768adf2
Compare
768adf2
to
08a9701
Compare
@jreback I think this is good to go. |
08a9701
to
aad8ccb
Compare
@jreback I rebased after the latest merge should be good to go. Thanks! |
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.
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): |
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.
remote this entirely
Nice catch. Thanks! Will get to this tonight.
…On Wed, Jul 25, 2018, 7:04 AM Jeff Reback ***@***.***> wrote:
***@***.**** requested changes on this pull request.
minor comment. ping on green.
------------------------------
In pandas/tests/indexes/multi/test_analytics.py
<#21740 (comment)>:
> @@ -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):
remote this entirely
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#21740 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADSn4NbKh6ER0ZklowaIbunz2VBbRoPbks5uKF67gaJpZM4VDHzu>
.
|
doc/source/whatsnew/v0.24.0.txt
Outdated
@@ -513,7 +513,7 @@ Missing | |||
MultiIndex | |||
^^^^^^^^^^ | |||
|
|||
- | |||
- Removed legacy internal formats (:issue:`21654`) |
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.
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?)
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 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)
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.
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?)
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.
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.
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.
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)
Okay thanks. It's a fair point. I will try to summarize the issue better
in the what's new text and resubmit.
…On Thu, Jul 26, 2018, 8:17 AM Joris Van den Bossche < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In doc/source/whatsnew/v0.24.0.txt
<#21740 (comment)>:
> @@ -513,7 +513,7 @@ Missing
MultiIndex
^^^^^^^^^^
--
+- Removed legacy internal formats (:issue:`21654`)
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)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#21740 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADSn4F1x-6KqhBcrsUpZn60_yUVYDcobks5uKcFagaJpZM4VDHzu>
.
|
aad8ccb
to
ae446bc
Compare
@jreback everything is green. Thank you for all your help on refactoring this MultiIndex text suite. |
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.
Thanks for the update, that's clear now!
No problem. I'm glad you brought up the issue. Thanks!
…On Fri, Jul 27, 2018, 6:33 AM Joris Van den Bossche < ***@***.***> wrote:
***@***.**** approved this pull request.
Thanks for the update, that's clear now!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#21740 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADSn4DDTJd60km7OCfxlcxkDJhQOdO8Aks5uKvp6gaJpZM4VDHzu>
.
|
* 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)
git diff upstream/master -u -- "*.py" | flake8 --diff