Skip to content

REF: share Index.union #38671

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 7 commits into from
Dec 24, 2020
Merged

REF: share Index.union #38671

merged 7 commits into from
Dec 24, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.

@@ -3502,98 +3502,9 @@ def equal_levels(self, other) -> bool:
# --------------------------------------------------------------------
# Set Methods

def union(self, other, sort=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add these examples to the existing Index.union doc-string?

Copy link
Member Author

Choose a reason for hiding this comment

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

restored + greenish

@jreback jreback added Index Related to the Index class or subclasses Refactor Internal refactoring of code labels Dec 24, 2020
@jreback jreback added this to the 1.3 milestone Dec 24, 2020
if isinstance(self, ABCMultiIndex) and not is_object_dtype(
unpack_nested_dtype(other)
):
raise NotImplementedError(
Copy link
Contributor

Choose a reason for hiding this comment

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

hit in tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@@ -2680,6 +2727,14 @@ def union(self, other, sort=None):
right = other.astype(dtype, copy=False)
return left.union(right, sort=sort)

elif not len(other) or self.equals(other):
Copy link
Contributor

Choose a reason for hiding this comment

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

coverage for all of these?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@jreback jreback merged commit e744559 into pandas-dev:master Dec 24, 2020
@jreback
Copy link
Contributor

jreback commented Dec 24, 2020

thanks would be super helpful to either disable / fix the failing travis build (it's a locale one i think)

@jbrockmendel jbrockmendel deleted the setops branch December 24, 2020 22:27
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
* BUG: MultiIndex, IntervalIndex intersection with Categorical

* standardize

* Share intersection

* REF: share Index.union

* move doctest examples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Index Related to the Index class or subclasses Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants