@@ -238,12 +238,14 @@ def test_non_ascii_key(self):
238
238
tm .assert_frame_equal (result , expected )
239
239
240
240
def test_missing_field (self , author_missing_data ):
241
+ # GH20030: Checks for robustness of json_normalize - should
242
+ # unnest records where only the first record has a None value
241
243
result = json_normalize (author_missing_data )
242
244
ex_data = [
243
- {'author_name.first' : float ( ' nan' ) ,
244
- 'author_name.last_name' : float ( ' nan' ) ,
245
- 'info.created_at' : float ( ' nan' ) ,
246
- 'info.last_updated' : float ( ' nan' ) },
245
+ {'author_name.first' : np . nan ,
246
+ 'author_name.last_name' : np . nan ,
247
+ 'info.created_at' : np . nan ,
248
+ 'info.last_updated' : np . nan },
247
249
{'author_name.first' : 'Jane' ,
248
250
'author_name.last_name' : 'Doe' ,
249
251
'info.created_at' : '11/08/1993' ,
@@ -350,6 +352,8 @@ def test_json_normalize_errors(self):
350
352
)
351
353
352
354
def test_nonetype_dropping (self ):
355
+ # GH20030: Checks that None values are dropped in nested_to_record
356
+ # to prevent additional columns of nans when passed to DataFrame
353
357
data = [
354
358
{'info' : None ,
355
359
'author_name' :
0 commit comments