(self, other, sort)
| 3470 | return self._wrap_difference_result(other, result) |
| 3471 | |
| 3472 | def _difference(self, other, sort): |
| 3473 | # overridden by RangeIndex |
| 3474 | this = self |
| 3475 | if isinstance(self, ABCCategoricalIndex) and self.hasnans and other.hasnans: |
| 3476 | this = this.dropna() |
| 3477 | other = other.unique() |
| 3478 | the_diff = this[other.get_indexer_for(this) == -1] |
| 3479 | the_diff = the_diff if this.is_unique else the_diff.unique() |
| 3480 | the_diff = _maybe_try_sort(the_diff, sort) |
| 3481 | return the_diff |
| 3482 | |
| 3483 | def _wrap_difference_result(self, other, result): |
| 3484 | # We will override for MultiIndex to handle empty results |
no test coverage detected