Skip to content

REF: stricter types for RangeIndex._simple_new #31084

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

Merged
merged 1 commit into from
Jan 16, 2020

Conversation

jbrockmendel
Copy link
Member

xref #31055.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function cleanup looks good; question on the reindex

@@ -3105,7 +3106,10 @@ def reindex(self, target, method=None, level=None, limit=None, tolerance=None):
if not isinstance(target, Index) and len(target) == 0:
attrs = self._get_attributes_dict()
attrs.pop("freq", None) # don't preserve freq
values = self._data[:0] # appropriately-dtyped empty array
if isinstance(self, ABCRangeIndex):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this need to change for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self._data[:0] is an ndarray for RangeIndex, so we can't pass it to self._simple_new below

@WillAyd WillAyd added the Clean label Jan 16, 2020
@jreback jreback added this to the 1.1 milestone Jan 16, 2020
@jreback jreback merged commit f6747b9 into pandas-dev:master Jan 16, 2020
@jreback
Copy link
Contributor

jreback commented Jan 16, 2020

sure

@jbrockmendel jbrockmendel deleted the simplenew-range branch January 17, 2020 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants