Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork18.5k
BUG: Raise ValueError for non-string columns in read_json orient='table' (GH19129)#61359
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
pre-commit.ci autofix |
for more information, seehttps://pre-commit.ci
@@ -372,6 +372,11 @@ def parse_table_schema(json, precise_float: bool) -> DataFrame: | |||
pandas.read_json | |||
""" | |||
table = ujson_loads(json, precise_float=precise_float) | |||
fields = table["schema"]["fields"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can you replace other instances oftable["schema"]["fields"]
below withfields
?
@@ -372,6 +372,11 @@ def parse_table_schema(json, precise_float: bool) -> DataFrame: | |||
pandas.read_json | |||
""" | |||
table = ujson_loads(json, precise_float=precise_float) | |||
fields = table["schema"]["fields"] | |||
if any(not isinstance(field["name"], str) for field in fields): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ifany(notisinstance(field["name"],str)forfieldinfields): | |
ifnotall(isinstance(field["name"],str)forfieldinfields): |
NIt: IMO this reads a little clearer with me
Hi, it seems there is already a PR#60945 addressing this issue. |
Uh oh!
There was an error while loading.Please reload this page.
Looking forward to feedback. Thanks!