-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
FIX printing index with display.max_seq_items=None (GH10182) #10183
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
FIX printing index with display.max_seq_items=None (GH10182) #10183
Conversation
d1c144e
to
c53b474
Compare
c53b474
to
138cb7c
Compare
@jreback two reasons for the failures (both because I used
|
I think if you remove I think |
For the CategoricalIndex, why not adding |
@jorisvandenbossche that's what I said, add for |
I mean |
@jorisvandenbossche oh, yes, for sure do that! |
6d07d2e
to
57a69cd
Compare
@jreback can you have a look? |
@@ -133,6 +133,14 @@ def test_str(self): | |||
self.assertTrue("'foo'" in str(idx)) | |||
self.assertTrue(idx.__class__.__name__ in str(idx)) | |||
|
|||
def test_repr_max_seq_item_setting(self): |
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.
move this to the Base
class which tests for all sub-classes
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 is already in the Base class
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.
ahh, you know what the function above it is not testing much test_str
(that's what I was looking at). should be iterating over the self.indices
rather than using .create_index()
.
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 am not fully following the logic of the test set up.
- on the one hand, you have the
self.indices
-> so iterating over these will run this test for all the different index types - but
create_index
is also redefined in each subclass ofBase
, so in this way the test will also be run for the different index types
So it seems two ways to achieve a bit the same?
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.
.indices
has much more to test (and is customizable per sub-class), while .create_index
is a single plain vanilla one. For the generic tests using .indices
provides more coverage.
this looked reasonable |
@@ -63,7 +63,7 @@ Bug Fixes | |||
- Bug where read_hdf store.select modifies the passed columns list when | |||
multi-indexed (:issue:`7212`) | |||
- Bug in ``Categorical`` repr with ``display.width`` of ``None`` in Python 3 (:issue:`10087`) | |||
|
|||
- Bug in Index repr when using the ``max_seq_items=None`` setting (:issue:`10182`). |
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.
move to 0.16.2
@jreback yes, coming back to this. I think your main comment here is that the tests can be expanded by looping over the |
@jorisvandenbossche sure. Always like expanded tests, but otherwise ok. merge when ready. |
ok, will do this evening |
57a69cd
to
4360afa
Compare
FIX printing index with display.max_seq_items=None (GH10182)
Fixes #10182