@@ -130,7 +130,7 @@ def test_readjson_chunks_closes(chunksize):
130
130
lines = True ,
131
131
chunksize = chunksize ,
132
132
compression = None ,
133
- nrows = None
133
+ nrows = None ,
134
134
)
135
135
reader .read ()
136
136
assert (
@@ -185,10 +185,10 @@ def test_readjson_unicode(monkeypatch):
185
185
@pytest .mark .parametrize ("nrows" , [1 , 2 ])
186
186
def test_readjson_nrows (nrows ):
187
187
# Test reading line-format JSON to Series with nrows param
188
- jsonl = ''' {"a": 1, "b": 2}
188
+ jsonl = """ {"a": 1, "b": 2}
189
189
{"a": 3, "b": 4}
190
190
{"a": 5, "b": 6}
191
- {"a": 7, "b": 8}'''
191
+ {"a": 7, "b": 8}"""
192
192
result = pd .read_json (jsonl , lines = True , nrows = nrows )
193
193
expected = pd .DataFrame ({"a" : [1 , 3 , 5 , 7 ], "b" : [2 , 4 , 6 , 8 ]}).iloc [:nrows ]
194
194
tm .assert_frame_equal (result , expected )
@@ -197,10 +197,10 @@ def test_readjson_nrows(nrows):
197
197
@pytest .mark .parametrize ("nrows,chunksize" , [(2 , 2 ), (4 , 2 )])
198
198
def test_readjson_nrows_chunks (nrows , chunksize ):
199
199
# Test reading line-format JSON to Series with nrows and chunksize param
200
- jsonl = ''' {"a": 1, "b": 2}
200
+ jsonl = """ {"a": 1, "b": 2}
201
201
{"a": 3, "b": 4}
202
202
{"a": 5, "b": 6}
203
- {"a": 7, "b": 8}'''
203
+ {"a": 7, "b": 8}"""
204
204
reader = read_json (jsonl , lines = True , nrows = nrows , chunksize = chunksize )
205
205
chunked = pd .concat (reader )
206
206
expected = pd .DataFrame ({"a" : [1 , 3 , 5 , 7 ], "b" : [2 , 4 , 6 , 8 ]}).iloc [:nrows ]
0 commit comments