-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: fix nested meta path bug (GH 27220) #27667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
383f0e6
2fed9a8
f9d4319
04785e0
2a695e9
a1efe7e
9c568b6
1c186aa
9efda32
62ee093
4bdaf01
14996f6
cf53749
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,6 +287,32 @@ def test_shallow_nested(self): | |
expected = DataFrame(ex_data, columns=result.columns) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_nested_meta_path_with_nested_record_path(self, state_data): | ||
# GH 27220 | ||
result = json_normalize( | ||
state_data, | ||
another-green marked this conversation as resolved.
Show resolved
Hide resolved
|
||
["counties", "name"], | ||
["state", "shortname", ["info", "governor"]], | ||
errors="ignore", | ||
) | ||
ex_data = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of using a dict can you construct this with literal values? If you use a list of lists can circumvent 3.5 ordering issues with a dict If you can simplify expectation would help a lot as well so as not to write out the same values 21 times There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion. It is indeed better. I simply copied other test cases. I will change accordingly. |
||
0: [ | ||
i | ||
for word in ["Dade", "Broward", "Palm Beach", "Summit", "Cuyahoga"] | ||
for i in word | ||
], | ||
"state": ["Florida"] * 21 + ["Ohio"] * 14, | ||
"shortname": ["FL"] * 21 + ["OH"] * 14, | ||
"info.governor": ["Rick Scott"] * 21 + ["John Kasich"] * 14, | ||
"population": [12345] * 4 | ||
+ [40000] * 7 | ||
+ [60000] * 10 | ||
+ [1234] * 6 | ||
+ [1337] * 8, | ||
} | ||
expected = DataFrame(ex_data, columns=result.columns) | ||
another-green marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_meta_name_conflict(self): | ||
data = [ | ||
{ | ||
|
Uh oh!
There was an error while loading. Please reload this page.