From 36a0cab53caacd6aeb0cdc8a965ccfb853818662 Mon Sep 17 00:00:00 2001 From: Sheilah Date: Wed, 5 May 2021 19:58:59 -0700 Subject: [PATCH] fixed format issue --- python/cudf/cudf/tests/test_string.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/python/cudf/cudf/tests/test_string.py b/python/cudf/cudf/tests/test_string.py index b76c4034241..c6a64824a86 100644 --- a/python/cudf/cudf/tests/test_string.py +++ b/python/cudf/cudf/tests/test_string.py @@ -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"]), )