read_json support for orient="table" by WillAyd · Pull Request #19039 · pandas-dev/pandas (original) (raw)
- closes read_json can't import own exported data with orient=table #18912 and
closes Roundtrip orient for JSON #9146 - tests added / passed
- passes
git diff upstream/master -u -- "*.py" | flake8 --diff
- whatsnew entry
This is a starting point for read_json
supporting orient='table'
for basic types. I'm explicitly raising in the instances that don't work, namely timezone aware datetimes andTimedelta
. I marked floats with no decimal values as an xfail (these are being converted to int64
by the _try_convert_data
method).
Timedelta
would be best fixed in a separate change providing a constructor equivalent to the isoformat
method (see #19040).
The new tests could also all be parametrized, but I've kept as is before going too far with this change in case of feedback