REF: Remove many Panel tests
State: closed

Stopped this branch at the point where I'd have to do surgery on `legacy_table.h5` to fix `test_legacy_table_read`.  If we're dropping that entirely and can just remove the file, I can push forward on removing a bunch more of `io.pytables`.

Labels:
name: Clean

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

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

```diff
@@             Coverage Diff             @@
##           master   #25191       +/-   ##
===========================================
- Coverage   92.34%   42.27%   -50.08%     
===========================================
  Files         166      166               
  Lines       52310    52290       -20     
===========================================
- Hits        48305    22103    -26202     
- Misses       4005    30187    +26182
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `?` | |
| #single | `42.27% <ø> (-0.57%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25191?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/internals/blocks.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL2Jsb2Nrcy5weQ==) | `52% <ø> (-42.11%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `49.67% <ø> (-38.37%)` | :arrow_down: |
| [pandas/core/internals/managers.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL21hbmFnZXJzLnB5) | `66.29% <ø> (-29.67%)` | :arrow_down: |
| [pandas/io/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3B5dGFibGVzLnB5) | `89.49% <ø> (-3.06%)` | :arrow_down: |
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/sas/sas\_constants.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfY29uc3RhbnRzLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/plotting.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvcGxvdHRpbmcucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvY29udmVydGVyLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/formats/html.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvaHRtbC5weQ==) | `0% <0%> (-99.35%)` | :arrow_down: |
| ... and [127 more](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25191?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/25191?src=pr&el=footer). Last update [93568cc...b04c393](https://codecov.io/gh/pandas-dev/pandas/pull/25191?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/25191?src=pr&el=h1) Report
> Merging [#25191](https://codecov.io/gh/pandas-dev/pandas/pull/25191?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/93568cc3c529a10a897879561b4cd75486c618be?src=pr&el=desc) will **decrease** coverage by `0.19%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff            @@
##           master   #25191     +/-   ##
=========================================
- Coverage   92.34%   92.15%   -0.2%     
=========================================
  Files         166      166             
  Lines       52310    52290     -20     
=========================================
- Hits        48305    48186    -119     
- Misses       4005     4104     +99
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.61% <ø> (-0.17%)` | :arrow_down: |
| #single | `42.27% <ø> (-0.57%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25191?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/internals/blocks.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL2Jsb2Nrcy5weQ==) | `93.96% <ø> (-0.15%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `87.88% <ø> (-0.16%)` | :arrow_down: |
| [pandas/core/internals/managers.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL21hbmFnZXJzLnB5) | `94.83% <ø> (-1.13%)` | :arrow_down: |
| [pandas/io/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3B5dGFibGVzLnB5) | `90.42% <ø> (-2.12%)` | :arrow_down: |
| [pandas/core/panel.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcGFuZWwucHk=) | `93.86% <0%> (-4.05%)` | :arrow_down: |
| [pandas/core/computation/pytables.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tcHV0YXRpb24vcHl0YWJsZXMucHk=) | `90.51% <0%> (-1.84%)` | :arrow_down: |
| [pandas/core/computation/expr.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tcHV0YXRpb24vZXhwci5weQ==) | `88.17% <0%> (-0.52%)` | :arrow_down: |
| [pandas/core/reshape/concat.py](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9jb25jYXQucHk=) | `97.2% <0%> (-0.4%)` | :arrow_down: |
| ... and [2 more](https://codecov.io/gh/pandas-dev/pandas/pull/25191/diff?src=pr&el=tree-more) | |

------

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

```
    def test_legacy_table_fixed_format_read_py2(self, datapath):
    def test_legacy_table_read_py2(self, datapath):
    def test_legacy_table_read(self, datapath):
    def test_legacy_datetimetz_object(self, datapath):
```

so can remove      these 2

```
def test_legacy_table_read(self, datapath):
def test_legacy_datetimetz_object(self, datapath):
```

which are really old legacy formats (just make a note in the whatsnew). The others need to stay as they are written in PY2 and should still be readable (as these are really just tests of encoding).

This can certainly be a followup.
> This can certainly be a followup.

Sounds good.  I'm AFK for a bit, will do this in the next pass.
thanks!
> which are really old legacy formats (just make a note in the whatsnew). The others need to stay as they are written in PY2 and should still be readable (as these are really just tests of encoding).

Putting together a PR for this in the next pass.  What do you have in mind for the whatsnew?  We already have a "Panel is removed" entry with a growing list of associated issues/PRs

Can we entirely remove some subset of the classes in io.pytables?  e.g. LegacyTable and subclasses?
> Putting together a PR for this in the next pass

@jbrockmendel : you will be removing..?

./pandas/tests/indexing/multiindex/test_panel.py
./pandas/tests/indexing/test_panel.py
./pandas/tests/test_panel.py

I got stuck on some of the IO tests where pickle and msgpack files need to be rebuilt.  Feel free to pick up the baton with these.
when changing to pytest.raises context manager, i skipped `./pandas/tests/test_panel.py`, so i'll look at removing that one first.