BUG: make conftest._cython_table deterministic for Python<3.6
State: closed

Closes a bug for Python < 3.6 where xdist gets non-deterministic input because of random dict ordering for Python < 3.6.

See #22156 for details.

Labels:
name: Testing
description: pandas testing functions or related to the test suite

Comments:
Travis failure is unrelated. Was in ``pandas/tests/plotting/test_deprecated.py:51:``

and message

``
E           AssertionError: Caused unexpected warning(s): [('RuntimeWarning', RuntimeWarning('invalid value encountered in equal',), '/home/travis/miniconda3/envs/pandas/lib/python2.7/site-packages/numpy/core/numeric.py', 2367)].
``
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22157?src=pr&el=h1) Report
> Merging [#22157](https://codecov.io/gh/pandas-dev/pandas/pull/22157?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/0370740034978d3a63d4b8e5e2c96ff54e7e08ba?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

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

```diff
@@           Coverage Diff           @@
##           master   #22157   +/-   ##
=======================================
  Coverage   92.08%   92.08%           
=======================================
  Files         169      169           
  Lines       50694    50694           
=======================================
  Hits        46682    46682           
  Misses       4012     4012
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.49% <100%> (ø)` | :arrow_up: |
| #single | `42.34% <100%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/22157?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/22157/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYmFzZS5weQ==) | `96.92% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/22157?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/22157?src=pr&el=footer). Last update [0370740...5b28029](https://codecov.io/gh/pandas-dev/pandas/pull/22157?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

hmm, I swear I saw this, but ok, I'll close this PR. If the issue (re-)appears, I can just do a PR then.
Just saw the reference from #21902.

@h-vetinari, can you conform if you saw the same issue in your PR that I'm raporting in #22156?
Hey @topper-123, i definitely saw this issue at least 2-3 times in the 3.5 Travis build for several PRs. It's real. ;)
Since I rebased #21902, the Travis info is not (easily) available anymore, but I posted an extract there. It was always the same test (exactly related to this issue), so I'm confident about that.
I went through the travis log and looked for some of my old failed jobs. Here's some more occurrences (in each case, it was the only fail out of the required travis builds):
https://travis-ci.org/pandas-dev/pandas/jobs/412363050
https://travis-ci.org/pandas-dev/pandas/jobs/412369259
https://travis-ci.org/pandas-dev/pandas/jobs/413341494

All these are less than 4 days old, so in particular, after the comment from @jreback:
> there was another push after PR
i have never seen this repeat

Ok, I've made ``_cython_table`` and ``_builtin_table`` OrderedDicts, which solves the issue. Nice solution.
Is this ok?
A bit odd this bug first shows up and isn't showing up again. Maybe we saw something else?

I'll wait a few days and if this isn't showing again, I can close this PR.
thanks @topper-123 I like this a lot better