Fix hard-coded pandas version to infer the current
State: closed

Fix hard-coded pandas version to infer the current version in `pd.io.json.build_table_schema` output. 

```python
>>> import pandas as pd
>>> pd.__version__
'0.23.4'
>>> df = pd.DataFrame({'A': [1,2], 'B': ['a','b']})
>>> # BEFORE
>>> pd.io.json.build_table_schema(df, index=0)['pandas_version']
'0.20.0'
>>> # AFTER
>>> pd.io.json.build_table_schema(df, index=0)['pandas_version']
'0.23.4'
```


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

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

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

```diff
@@            Coverage Diff             @@
##           master   #24509      +/-   ##
==========================================
+ Coverage   31.89%    31.9%   +<.01%     
==========================================
  Files         166      166              
  Lines       52421    52422       +1     
==========================================
+ Hits        16722    16723       +1     
  Misses      35699    35699
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `30.29% <50%> (ø)` | :arrow_up: |
| #single | `31.9% <50%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24509?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/json/table\_schema.py](https://codecov.io/gh/pandas-dev/pandas/pull/24509/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vdGFibGVfc2NoZW1hLnB5) | `11.86% <50%> (+0.75%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24509?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/24509?src=pr&el=footer). Last update [100ffff...fd02c31](https://codecov.io/gh/pandas-dev/pandas/pull/24509?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/24509?src=pr&el=h1) Report
> Merging [#24509](https://codecov.io/gh/pandas-dev/pandas/pull/24509?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/100ffffa0ace51baac7045ca51fecf228e54bc5b?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `50%`.

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

```diff
@@            Coverage Diff             @@
##           master   #24509      +/-   ##
==========================================
+ Coverage   31.89%    31.9%   +<.01%     
==========================================
  Files         166      166              
  Lines       52421    52422       +1     
==========================================
+ Hits        16722    16723       +1     
  Misses      35699    35699
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `30.29% <50%> (ø)` | :arrow_up: |
| #single | `31.9% <50%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/24509?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/json/table\_schema.py](https://codecov.io/gh/pandas-dev/pandas/pull/24509/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2pzb24vdGFibGVfc2NoZW1hLnB5) | `11.86% <50%> (+0.75%)` | :arrow_up: |

------

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

you will also have to fix the imports, `isort` should be able to do it for you
Should `isort` be used on all the imports or just the one I added? Because `isort` suggested fixes on previous imports as well: 
![image](https://user-images.githubusercontent.com/3298308/50553056-492a7a80-0c6d-11e9-970f-a03c66b20528.png)

you can leave all the changes that isort does, but as far as `ci/code_checks.py` is happy, it doesn't really matter
I don't think we want to do this. I think the intent was to increment the version whenever we make an API breaking change to the schema. You might want to look back at the PR when JSON table schema writing was originally added to verify.
In retrospect, using the pandas version at the time of the API break is not the clearest thing in the world. 
Search for "pandas_version" in http://pandas-docs.github.io/pandas-docs-travis/io.html#table-schema. Again, not the clearest ("each revision" of what?) In my mind, it was each revision of the spec.
I see, thanks. I will go ahead and close the PR.