Skip to content
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

[C++] JSON: improve error message when column changed type #23099

Closed
asfimport opened this issue Oct 2, 2019 · 4 comments
Closed

[C++] JSON: improve error message when column changed type #23099

asfimport opened this issue Oct 2, 2019 · 4 comments

Comments

@asfimport
Copy link

When a column accidentally changes type in a JSON file (which is not supported), it would be nice to get the column name that gives this problem in the error message.

I am trying to parse a simple json file. While doing so, am getting the error  JSON parse error: A column changed from string to number

from pyarrow import json
r = json.read_json('dummy.jl')

 

Reporter: harikrishnan
Assignee: Ben Kietzman / @bkietz

Original Issue Attachments:

PRs and other links:

Note: This issue was originally created as ARROW-6760. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Antoine Pitrou / @pitrou:
Hmm, we should probably give better error messages. @bkietz

In this case, though, it seems the "length" field is first a string, then an integer. Arrow only accepts homogenous JSON, i.e. all objects in the same file must have the same schema.

@asfimport
Copy link
Author

harikrishnan:
Ah I see. Thanks for the quick reply @pitrou . Yes definitely listing the column name here with the error message will be a saver when it comes to debugging. 

@asfimport
Copy link
Author

Joris Van den Bossche / @jorisvandenbossche:
Indeed, a better error message would be nice. Renamed the issue to reflect this.

@asfimport
Copy link
Author

Ben Kietzman / @bkietz:
Issue resolved by pull request 5571
#5571

@asfimport asfimport added this to the 0.15.0 milestone Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants