Skip to content

Commit 7b56e27

Browse files
committed
Update unit tests
1 parent 79b68a9 commit 7b56e27

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pandas/tests/io/json/test_normalize.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,29 @@ def test_series_index(self, state_data):
569569
result = json_normalize(series, "counties")
570570
tm.assert_index_equal(result.index, idx.repeat([3, 2]))
571571

572+
@pytest.mark.parametrize("path", [None, []])
573+
def test_empty_record_path_and_not_empty_meta(self, state_data, path):
574+
ex_data = [
575+
{
576+
"shortname": "FL",
577+
"state": "Florida",
578+
"info.governor": "Rick Scott",
579+
},
580+
{
581+
"shortname": "OH",
582+
"state": "Ohio",
583+
"info.governor": "John Kasich",
584+
},
585+
]
586+
expected = DataFrame(ex_data)
587+
588+
result = json_normalize(
589+
state_data,
590+
record_path=path,
591+
meta=["shortname", "state", ["info", "governor"]],
592+
)
593+
tm.assert_frame_equal(result, expected)
594+
572595

573596
class TestNestedToRecord:
574597
def test_flat_stays_flat(self):

0 commit comments

Comments
 (0)