We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93a46db commit 3b28e5eCopy full SHA for 3b28e5e
pandas/tests/io/json/test_readlines.py
@@ -226,12 +226,15 @@ def test_readjson_nrows_requires_lines():
226
def test_readjson_lines_chunks_fileurl(datapath):
227
# GH 27135
228
# Test reading line-format JSON from file url
229
+ df_list_expected = [
230
+ pd.DataFrame([[1, 2]], columns=["a", "b"], index=[0]),
231
+ pd.DataFrame([[3, 4]], columns=["a", "b"], index=[1]),
232
+ pd.DataFrame([[5, 6]], columns=["a", "b"], index=[2]),
233
+ ]
234
os_path = datapath("io", "json", "data", "line_delimited.json")
235
file_url = "file://localhost" + os_path
236
if system() == "Windows":
237
file_url = PureWindowsPath(file_url)
- path_reader = pd.read_json(os_path, lines=True, chunksize=1)
- df_list = list(path_reader)
238
url_reader = pd.read_json(file_url, lines=True, chunksize=1)
239
for index, chuck in enumerate(url_reader):
- tm.assert_frame_equal(chuck, df_list[index])
240
+ tm.assert_frame_equal(chuck, df_list_expected[index])
0 commit comments