-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: fix IntervalIndex for pivot table raise type error #26765
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #26765 +/- ##
==========================================
- Coverage 91.71% 91.71% -0.01%
==========================================
Files 178 178
Lines 50740 50740
==========================================
- Hits 46538 46534 -4
- Misses 4202 4206 +4
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26765 +/- ##
==========================================
- Coverage 91.86% 91.86% -0.01%
==========================================
Files 179 179
Lines 50706 50706
==========================================
- Hits 46583 46580 -3
- Misses 4123 4126 +3
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.
can you add a whatsnew note (reshaping) bug fixes
pandas/tests/reshape/test_pivot.py
Outdated
@@ -198,6 +198,17 @@ def test_pivot_with_non_observable_dropna(self, dropna): | |||
|
|||
tm.assert_frame_equal(result, expected) | |||
|
|||
def test_pivot_with_interval_index(self, dropna): | |||
df = pd.DataFrame( |
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 you add the issue number as a comment
pandas/tests/reshape/test_pivot.py
Outdated
def test_pivot_with_interval_index(self, dropna): | ||
df = pd.DataFrame( | ||
{'A': pd.Categorical([pd.Interval(0, 1)] * 4), | ||
'B': [1] * 4}) |
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.
does this fully replicate the OP 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 just added a fixture to include more scenarios.
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.
tiny tiny comment, ping on green.
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.
lgtm, just some simplifications to the implementation
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.
Merged master to fix the CI. Should be good to go.
Thanks @peterpanmj! |
Close (#25814). When use IntervalIndex for pivot table, raise
TypeError: cannot determine next label for type <class 'str'>
git diff upstream/master -u -- "*.py" | flake8 --diff