-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix Index construction when given empty generator (#21470). #21481
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 #21481 +/- ##
=========================================
Coverage ? 91.92%
=========================================
Files ? 153
Lines ? 49586
Branches ? 0
=========================================
Hits ? 45582
Misses ? 4004
Partials ? 0
Continue to review full report at Codecov.
|
pandas/tests/indexes/test_base.py
Outdated
@@ -445,14 +445,22 @@ def test_constructor_dtypes_timedelta(self, attr, klass): | |||
result = klass(list(values), dtype=dtype) | |||
tm.assert_index_equal(result, index) | |||
|
|||
def test_constructor_empty_gen(self): | |||
def test_constructor_empty_list(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.
Could you combine this test with the one below with pytest.mark.parametrize
over skip_index_keys
and the empty list and generator?
Maybe also worthwhile to include a test for |
@mroeschke Thanks--good call on including iter([]) in tests- turns out calling CategoricalIndex on any non-generator iterator was broken. |
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. pls add a whatsnew note. 0.23.2 is ok, bug fix in reshaping or conversions
thanks @Liam3851 |
git diff upstream/master -u -- "*.py" | flake8 --diff