Skip to content

Commit

Permalink
fixed format issue
Browse files Browse the repository at this point in the history
  • Loading branch information
skirui-source committed May 6, 2021
1 parent db8bda6 commit 36a0cab
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions python/cudf/cudf/tests/test_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -2990,20 +2990,21 @@ def test_string_slice_with_mask():
],
],
)
def test_string_get_json_object(data):
def test_string_get_json_object_n(data):
gs = cudf.Series(data)
js = json.loads(data[0])
ps = pd.Series(data)

assert_eq(
json.loads(gs.str.get_json_object("$.store").iloc[0]), js["store"]
json.loads(gs.str.get_json_object("$.store")[0]),
ps.apply(lambda x: json.loads(x)["store"])[0],
)
assert_eq(
json.loads(gs.str.get_json_object("$.store.book").iloc[0]),
js["store"]["book"],
json.loads(gs.str.get_json_object("$.store.book")[0]),
ps.apply(lambda x: json.loads(x)["store"]["book"])[0],
)
assert_eq(
gs.str.get_json_object("$.store.book[0].category").iloc[0],
js["store"]["book"][0]["category"],
gs.str.get_json_object("$.store.book[0].category"),
ps.apply(lambda x: json.loads(x)["store"]["book"][0]["category"]),
)


Expand Down

0 comments on commit 36a0cab

Please sign in to comment.