You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a table has struct with zero columns, it fails to write using cudf::write_json.
Steps/Code to reproduce bug
case 1:
# write a json with struct with zero columns, sometimes nullsjson_str="""{"A": {"B": null, "C": 1}}{"A": {"B": null}}{"A": {"B": {}}}{"A": {"B": {}}}{"A": {}}{"A": {}}"""importcudffromioimportStringIOdf1=cudf.read_json(StringIO(json_str), lines=True)
df1[["A"]].to_json('tmp', engine='cudf')
Also, another repro (different issue).
case 2:
# write a json with struct with zero columns, sometimes nullsjson_str="""{"A": null}{"A": null}{"A": {}}{"A": {}}{}{}"""importcudffromioimportStringIOdf1=cudf.read_json(StringIO(json_str), lines=True)
df1[["A"]].to_json('tmp', engine='cudf')
Expected behavior
using pandas engine, df1[["A"]].to_json() produces
case 1: '{"A":{"0":{"B":null,"C":1},"1":{"B":null,"C":null},"2":{"B":{},"C":null},"3":{"B":{},"C":null},"4":{"B":null,"C":null},"5":{"B":null,"C":null}}}'
case 2: '{"A":{"0":null,"1":null,"2":{},"3":{},"4":null,"5":null}}'
Additional context @GregoryKimball found the issue while working with synthesized json files.
The text was updated successfully, but these errors were encountered:
Describe the bug
When a table has struct with zero columns, it fails to write using
cudf::write_json
.Steps/Code to reproduce bug
case 1:
Also, another repro (different issue).
case 2:
Expected behavior
using pandas engine,
df1[["A"]].to_json()
producescase 1:
'{"A":{"0":{"B":null,"C":1},"1":{"B":null,"C":null},"2":{"B":{},"C":null},"3":{"B":{},"C":null},"4":{"B":null,"C":null},"5":{"B":null,"C":null}}}'
case 2:
'{"A":{"0":null,"1":null,"2":{},"3":{},"4":null,"5":null}}'
Additional context
@GregoryKimball found the issue while working with synthesized json files.
The text was updated successfully, but these errors were encountered: