BUG: fixed check `_is_unorderable_exception`
State: closed

With upgrade to NumPy 1.13.2 the error message raised when comparing unorderable types
changes from using `"'>' not supported between instances of"` to using
`"'<' not supported between instances of"`.

This PR checks both of these.

See [GH-17046](https://github.com/pandas-dev/pandas/issues/17046) for discussion.

This caused failing `test test_basic_indexing` when running tests with NumPy 1.13.2. 

Here is the reproducer

```
import pandas
import pytest
import numpy as np
def test_basic_indexing():
    s = pandas.Series(np.random.randn(5), index=['a', 'b', 'a', 'a', 'b'])

    pytest.raises(IndexError, s.__getitem__, 5)
    pytest.raises(IndexError, s.__setitem__, 5, 0)

    pytest.raises(KeyError, s.__getitem__, 'c')

    s = s.sort_index()

    pytest.raises(IndexError, s.__getitem__, 5)
    pytest.raises(IndexError, s.__setitem__, 5, 0) # this part was failing

test_basic_indexing()
```



Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas

Comments:
Hello @oleksandr-pavlyk! Thanks for updating the PR.



Cheers ! There are no PEP8 issues in this Pull Request. :beers: 

##### Comment last updated on October 01, 2017 at 13:04 Hours UTC
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=h1) Report
> Merging [#17724](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/baadad7581c48b0b1c6401b7e3b32fd09e7f0863?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/17724/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #17724      +/-   ##
==========================================
- Coverage   91.27%   91.25%   -0.03%     
==========================================
  Files         163      163              
  Lines       49766    49766              
==========================================
- Hits        45422    45412      -10     
- Misses       4344     4354      +10
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.04% <ø> (-0.01%)` | :arrow_down: |
| #single | `40.33% <ø> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/dtypes/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2NvbW1vbi5weQ==) | `94.22% <ø> (-0.24%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.73% <0%> (-0.1%)` | :arrow_down: |
| [pandas/core/dtypes/inference.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2luZmVyZW5jZS5weQ==) | `98.33% <0%> (-0.03%)` | :arrow_down: |
| [pandas/core/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9tdWx0aS5weQ==) | `96.9% <0%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=footer). Last update [baadad7...02d3516](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=h1) Report
> Merging [#17724](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/baadad7581c48b0b1c6401b7e3b32fd09e7f0863?src=pr&el=desc) will **decrease** coverage by `0.02%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/17724/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #17724      +/-   ##
==========================================
- Coverage   91.27%   91.25%   -0.03%     
==========================================
  Files         163      163              
  Lines       49766    49766              
==========================================
- Hits        45422    45412      -10     
- Misses       4344     4354      +10
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.04% <ø> (-0.01%)` | :arrow_down: |
| #single | `40.33% <ø> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/dtypes/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2NvbW1vbi5weQ==) | `94.22% <ø> (-0.24%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `25% <0%> (-58.34%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.73% <0%> (-0.1%)` | :arrow_down: |
| [pandas/core/dtypes/inference.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2luZmVyZW5jZS5weQ==) | `98.33% <0%> (-0.03%)` | :arrow_down: |
| [pandas/core/indexes/multi.py](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9tdWx0aS5weQ==) | `96.9% <0%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=footer). Last update [baadad7...855d03f](https://codecov.io/gh/pandas-dev/pandas/pull/17724?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

can you point to something specific which is actually failing with a minimal env.. We tests vs numpy master and this doesn't come up.
this issue you are referncing: https://github.com/pandas-dev/pandas/pull/17051 is already been merged a while back
@jreback Yes, the #17051 has merged, I was simply pointing to the similar problem. That PR was dealing with a fall-out from the same change in the different tests.

To reproduce this problem it is important to use numpy 1.13.2 or 1.13.3 while running the test. 

Note that Travis uses NumPy 1.13.1 for testing, since miniconda does not ship NumPy 1.13.2 yet.
> Note that Travis uses NumPy 1.13.1 for testing, since miniconda does not ship NumPy 1.13.2 yet.

@oleksandr-pavlyk you would have to prove that this doesn't work as we already test on the CI with numpy 1.13.3: https://travis-ci.org/pandas-dev/pandas/jobs/282520540 (this is an all conda-forge build), and with numpy master: https://travis-ci.org/pandas-dev/pandas/jobs/282520544

our other builds use defaults for the base build.

both of which pass.

sure the currently *released *version (IOW 0.20.3) would fail with 1.13.2 on these tests, but that's not relevant).
Yes, my fix was developed with 0.20.3 in mind. 

Regarding your comment as to the relevancy. It is relevant for Python distributors, like Anaconda, or Intel Distribution for Python, as customers generally expect distributions to have up-to-date packages. 
> Yes, my fix was developed with 0.20.3 in mind.

closing, this is already fixed in master.

> Regarding your comment as to the relevancy. It is relevant for Python distributors, like Anaconda, or Intel Distribution for Python, as customers generally expect distributions to have up-to-date packages.

not what I meant. we don't backport from major releases. you can get 0.21.0 when it is out.