Skip to content

Commit

Permalink
copied pytest change from PR rapidsai#11574 to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyann committed Sep 18, 2022
1 parent a158220 commit 07caae7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions python/cudf/cudf/tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,12 @@ def test_json_nested_lines(data):
)
bytes.seek(0)
pdf = pd.read_json(bytes, orient="records", lines=True)
# In the second test-case:
# Pandas omits "f1" in first row, so we have to enforce a common schema
assert df.to_arrow().equals(pa.Table.from_pandas(pdf))
# In the second test-case we need to take a detour via pyarrow
# Pandas omits "f1" in first row, so we have to enforce a common schema,
# such that pandas would have the f1 member with null
# Also, pyarrow chooses to select different ordering of a nested column
# children though key-value pairs are correct.
pa_table_pdf = pa.Table.from_pandas(
pdf, schema=df.to_arrow().schema, safe=False
)
assert df.to_arrow().equals(pa_table_pdf)

0 comments on commit 07caae7

Please sign in to comment.