DEPR: pandas.util.testing
State: closed

Closes https://github.com/pandas-dev/pandas/issues/16232.

I tried to keep the commits somewhat clean.

https://github.com/pandas-dev/pandas/commit/e96624b8a3f903798f7977fb92da09fc7417ec98 and https://github.com/pandas-dev/pandas/commit/d52d35f9d6a5e721ae0e6aa1579e44dac820ed7a can probably be ignored. That's just moving `pandas.util.testing` to `pandas.util._testing` and updating all the relevant imports.

Main question: do we want to make the `tm.make*` methods public? I'd say we probably should, but wanted to confirm.

Labels:
name: Deprecate
description: Functionality to remove in pandas

Comments:
On second thought, we may want to hold of on making the `make*` functions public. We'll want pep8 compatible names at least, possibly other changes. 
The naming is problematic for our isort config.  We treat `pandas.util._*` as a collection of low-dependency modules, which `tm` is decidedly not.  could go directly in pandas/_testing.py?
Moved to pandas._testing.
Not sure about the mypy failure.

```
mypy --version
mypy 0.730
Performing static analysis using mypy
pandas/tests/test_register_accessor.py:39: error: Module has no attribute "register_series_accessor"
pandas/tests/test_register_accessor.py:40: error: Module has no attribute "register_dataframe_accessor"
pandas/tests/test_register_accessor.py:41: error: Module has no attribute "register_index_accessor"
Found 3 errors in 1 file (checked 839 source files)
```

I saw this in https://github.com/pandas-dev/pandas/pull/29964 too, but have never reproduced locally.
I see it locally occasionally.  Seems pretty random.

On Thu, Jan 2, 2020 at 2:28 PM Tom Augspurger <notifications@github.com>
wrote:

> Not sure about the mypy failure.
>
> mypy --version
> mypy 0.730
> Performing static analysis using mypy
> pandas/tests/test_register_accessor.py:39: error: Module has no attribute "register_series_accessor"
> pandas/tests/test_register_accessor.py:40: error: Module has no attribute "register_dataframe_accessor"
> pandas/tests/test_register_accessor.py:41: error: Module has no attribute "register_index_accessor"
> Found 3 errors in 1 file (checked 839 source files)
>
> I saw this in #29964 <https://github.com/pandas-dev/pandas/pull/29964>
> too, but have never reproduced locally.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/30620?email_source=notifications&email_token=AB5UM6DVFJ67N3L3I3LAMHTQ3ZS7XA5CNFSM4KCEWVK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH7USKA#issuecomment-570378536>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB5UM6A7CXXCFTNMGOGTMUTQ3ZS7XANCNFSM4KCEWVKQ>
> .
>

lgtm.
Haven't seen the error before - does merging master resolve?

> Main question: do we want to make the `tm.make*` methods public? I'd say we probably should, but wanted to confirm.

I don't think we want this. I'm under the impression these are better converted to fixtures
Sounds good. Planning to merge this once it passes since it touch so many files.
Another mypy failure.
> Not sure about the mypy failure.
> 
> ```
> mypy --version
> mypy 0.730
> Performing static analysis using mypy
> pandas/tests/test_register_accessor.py:39: error: Module has no attribute "register_series_accessor"
> pandas/tests/test_register_accessor.py:40: error: Module has no attribute "register_dataframe_accessor"
> pandas/tests/test_register_accessor.py:41: error: Module has no attribute "register_index_accessor"
> Found 3 errors in 1 file (checked 839 source files)
> ```
> 
> I saw this in #29964 too, but have never reproduced locally.

i see this locally quite often on my check_untyped_defs branch. can normally clear with `--no-incremental` but that's not relevant for ci since there isn't a cache.



Not sure if it's relevant, but we seem to only import `pandas.api` via `pandas.io.json._table_schema`, which doesn't seem great. I'm going to restructure things a bit in another PR.
Passing now. Merging.