Skip to content
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

BUG: Fix Index construction when given empty generator (#21470). #21481

Merged
merged 8 commits into from
Jun 18, 2018

Conversation

Liam3851
Copy link
Contributor

@codecov
Copy link

codecov bot commented Jun 14, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@d5a1232). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #21481   +/-   ##
=========================================
  Coverage          ?   91.92%           
=========================================
  Files             ?      153           
  Lines             ?    49586           
  Branches          ?        0           
=========================================
  Hits              ?    45582           
  Misses            ?     4004           
  Partials          ?        0
Flag Coverage Δ
#multiple 90.32% <100%> (?)
#single 41.89% <75%> (?)
Impacted Files Coverage Δ
pandas/core/arrays/categorical.py 95.69% <ø> (ø)
pandas/core/indexes/base.py 96.62% <100%> (ø)

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 d5a1232...650f810. Read the comment docs.

@@ -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):
Copy link
Member

@mroeschke mroeschke Jun 14, 2018

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?

@mroeschke mroeschke added Bug Regression Functionality that used to work in a prior pandas version labels Jun 14, 2018
@mroeschke
Copy link
Member

Maybe also worthwhile to include a test for iter([]) as well.

@Liam3851
Copy link
Contributor Author

@mroeschke Thanks--good call on including iter([]) in tests- turns out calling CategoricalIndex on any non-generator iterator was broken.

@jreback jreback added this to the 0.23.2 milestone Jun 15, 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.

lgtm. pls add a whatsnew note. 0.23.2 is ok, bug fix in reshaping or conversions

@jreback jreback merged commit 076635a into pandas-dev:master Jun 18, 2018
@jreback
Copy link
Contributor

jreback commented Jun 18, 2018

thanks @Liam3851

jorisvandenbossche pushed a commit that referenced this pull request Jun 29, 2018
jorisvandenbossche pushed a commit that referenced this pull request Jul 2, 2018
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
Bug Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index created from empty generator raises TypeError
4 participants