-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Fix json_normalize throwing TypeError when record_path has a sequence of dicts #22706 #22804
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
BUG: Fix json_normalize throwing TypeError when record_path has a sequence of dicts #22706 #22804
Conversation
Hello @vuminhle! Thanks for updating the PR.
Comment last updated on September 26, 2018 at 04:20 Hours UTC |
Codecov Report
@@ Coverage Diff @@
## master #22804 +/- ##
==========================================
+ Coverage 92.21% 92.21% +<.01%
==========================================
Files 162 162
Lines 51763 51770 +7
==========================================
+ Hits 47733 47741 +8
+ Misses 4030 4029 -1
Continue to review full report at Codecov.
|
…uence of dicts along its path pandas-dev#22706
9213f9f
to
da84997
Compare
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.
Code changes lgtm. Some minor nits around the docs
I think this PR also fixes #21605 |
Can you merge master? |
Done. |
Is there a reason for both |
The new if len(path) > 1:
...
else:
if not isinstance(data, list):
data = [data]
for obj in data:
# perform actual extraction Since we only have 1 function now, I think we can revert the change of returning tuples. IMO it looks ugly. What do you think? |
I'm pretty sure this is done quite a few other places so not out of the ordinary, though feel free to double check.
Not sure I fully understand what you have in mind but yea I don't think as is this is very readable. Any refactor / simplification here which does away with similar but separate functions and does not require mutation of an argument would be a great improvement |
Can you take another look at the changes? Since |
this also fixed #21605? can you add a test and add to the whatsnew |
hmm, though that is a list of dicts? |
list of dicts should work already. |
ok this lgtm then. @WillAyd over to you. |
git diff upstream/master -u -- "*.py" | flake8 --diff