-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Fix bug #37782 #53099
Fix bug #37782 #53099
Changes from 2 commits
38b6339
ff1907d
190d50c
30a754f
600208c
5c3c6dd
9e25b98
df46747
47b6166
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 |
---|---|---|
|
@@ -137,6 +137,11 @@ def max_level_test_input_data(): | |
] | ||
|
||
|
||
@pytest.fixture | ||
def parse_metadata_fields_list_type(): | ||
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. Can you just hardcode this in the function? 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. @mroeschke like that?
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. Yes 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. @mroeschke I just did it. But things looks different. I'm not sure if it was pushed properly. Can you check please? |
||
return [{"values": [1, 2, 3], "metadata": {"listdata": [1, 2]}}] | ||
|
||
|
||
class TestJSONNormalize: | ||
def test_simple_records(self): | ||
recs = [ | ||
|
@@ -170,6 +175,17 @@ def test_simple_normalize(self, state_data): | |
|
||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_fields_list_type_normalize(self, parse_metadata_fields_list_type): | ||
result = json_normalize( | ||
parse_metadata_fields_list_type, | ||
record_path=["values"], | ||
meta=[["metadata", "listdata"]], | ||
) | ||
expected = DataFrame( | ||
{0: [1, 2, 3], "metadata.listdata": [[1, 2], [1, 2], [1, 2]]} | ||
) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
def test_empty_array(self): | ||
result = json_normalize([]) | ||
expected = DataFrame() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke I'm seeing the message: This branch has conflicts that must be resolved
Only those with write access to this repository can merge pull requests.
Conflicting files
doc/source/whatsnew/v2.1.0.rst
Can you please take a look and guide me on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow these constructions to update your branch and fix the conflict: https://pandas.pydata.org/docs/development/contributing.html#updating-your-pull-request