10000 BUG: Fix type coercion in read_json orient='table' (#21345) by albertvillanova · Pull Request #25219 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Fix type coercion in read_json orient='table' (#21345) #25219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Feb 23, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Raise error if dtype is not None and orient='table'
  • Loading branch information
Albert Villanova del Moral committed Feb 9, 2019
commit 4f5c3b378a99146abd43e52469ce996af012abca
4 changes: 2 additions & 2 deletions pandas/io/json/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ def read_json(path_or_buf=None, orient=None, typ='frame', dtype=None,
{"index": "row 2", "col 1": "c", "col 2": "d"}]}'
"""

if dtype and orient == 'table':
raise ValueError("'dtype' is only valid when 'orient' is not 'table'")
if dtype is not None and orient == 'table':
raise ValueError("cannot pass both dtype and orient='table'")

compression = _infer_compression(path_or_buf, compression)
filepath_or_buffer, _, compression, should_close = get_filepath_or_buffer(
Expand Down
0