BUG: Fix read_json orient='table' without index (#25170)
State: closed

- [x] closes #25170
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Bug
name: IO JSON
description: read_json, to_json, json_normalize

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25171?src=pr&el=h1) Report
> Merging [#25171](https://codecov.io/gh/pandas-dev/pandas/pull/25171?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/e3b095074c5c3b29ec25a994cd204349b872d961?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #25171      +/-   ##
==========================================
- Coverage   92.37%   92.37%   -0.01%     
==========================================
  Files         166      166              
  Lines       52408    52409       +1     
==========================================
  Hits        48412    48412              
- Misses       3996     3997       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.79% <100%> (ø)` | :arrow_up: |
| #single | `42.86% <0%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25171?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/json/table\_schema.py](https://codecov.io/gh/pandas-dev/pandas/pull/25171/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vdGFibGVfc2NoZW1hLnB5) | `98.3% <100%> (+0.01%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/25171/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `88.04% <0%> (-0.1%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25171?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/25171?src=pr&el=footer). Last update [e3b0950...dcbb22b](https://codecov.io/gh/pandas-dev/pandas/pull/25171?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/25171?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@d7a0964`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff            @@
##             master   #25171   +/-   ##
=========================================
  Coverage          ?   91.89%           
=========================================
  Files             ?      166           
  Lines             ?    52227           
  Branches          ?        0           
=========================================
  Hits              ?    47994           
  Misses            ?     4233           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.44% <100%> (?)` | |
| #single | `42.12% <0%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25171?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/json/table\_schema.py](https://codecov.io/gh/pandas-dev/pandas/pull/25171/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vdGFibGVfc2NoZW1hLnB5) | `98.3% <100%> (ø)` | |

------

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

@WillAyd @jreback,  I have addressed all the requested changes.
@WillAyd @jreback I have done all requested changes and tests pass after merging master branch.
rebased
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
$ git checkout 0.24.x
$ git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
$ git cherry-pick -m1 7ee5b92ce4c7fb37337b07ea23493de60d2e63cb
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
$ git commit -am "Backport PR #25171: BUG: Fix read_json orient='table' without index (#25170)"
```

4. Push to a named branch :

```
git push YOURFORK 0.24.x:auto-backport-of-pr-25171-on-0.24.x
```

5. Create a PR against branch 0.24.x, I would have named this PR:

> "Backport PR #25171 on branch 0.24.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
thanks @albertvillanova