-
-
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
Conversation
doc/source/whatsnew/v2.1.0.rst
Outdated
@@ -372,10 +372,10 @@ I/O | |||
^^^ | |||
- :meth:`DataFrame.to_orc` now raising ``ValueError`` when non-default :class:`Index` is given (:issue:`51828`) | |||
- :meth:`DataFrame.to_sql` now raising ``ValueError`` when the name param is left empty while using SQLAlchemy to connect (:issue:`52675`) | |||
- Bug in :func:`json_normalize`, json_normalize cannot parse metadata fields list type (:issue:`#37782`) |
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.
- Bug in :func:`json_normalize`, json_normalize cannot parse metadata fields list type (:issue:`#37782`) | |
- Bug in :func:`json_normalize`, json_normalize cannot parse metadata fields list type (:issue:`37782`) |
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
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke like that?
def test_fields_list_type_normalize(self):
parse_metadata_fields_list_type=[{"values": [1, 2, 3], "metadata": {"listdata": [1, 2]}}]
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)
Should I push it? I did this as function just by looking other examples in the file.
Let me know.
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.
Yes
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 just did it. But things looks different. I'm not sure if it was pushed properly. Can you check please?
(My first PR for a big project)
Thanks @felipemaion |
* Fix BUG: pandas-dev#37782 * Fix BUG: pandas-dev#37782 * Fix BUG: 37782 - Hardcoded test data * Fix BUG: 37782 - Hardcoded test data * Update pandas/io/json/_normalize.py Co-authored-by: Matthew Roeschke <[email protected]> * Fix BUG: 37782 - typo * Fix BUG: 37782 - typo * Update doc/source/whatsnew/v2.1.0.rst --------- Co-authored-by: Matthew Roeschke <[email protected]>
* Fix BUG: pandas-dev#37782 * Fix BUG: pandas-dev#37782 * Fix BUG: 37782 - Hardcoded test data * Fix BUG: 37782 - Hardcoded test data * Update pandas/io/json/_normalize.py Co-authored-by: Matthew Roeschke <[email protected]> * Fix BUG: 37782 - typo * Fix BUG: 37782 - typo * Update doc/source/whatsnew/v2.1.0.rst --------- Co-authored-by: Matthew Roeschke <[email protected]>
doc/source/whatsnew/v2.1.0.rst
file.