-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix NoneType error when pulling non existent field #30145
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
Conversation
37b4b33
to
d202ead
Compare
Can you add test(s)? Typically the first thing we look for in a PR |
d202ead
to
2a9d9b6
Compare
@WillAyd of course. Test has been added. |
Thanks for the test. I don't really agree with the change though - why wouldn't you want this to raise a |
Imagine if I have 3 records:
I cannot use json_normalize now with if the key is not there it should raise a |
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.
OK I think I see the point. Few things to improve this
9f134b0
to
1ece957
Compare
@WillAyd I have changed it to use the fixture, but I'm not entirely happy with it. The fixture sets it to float('NaN') which is different from 'None'. Now I am testing against an iterable and catching a What do you think? |
b0cf30d
to
8aef446
Compare
c93e987
to
a7fd904
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.
looks good. ping when green.
f48eda9
to
e17214d
Compare
@jreback ping |
1b489ef
to
2f34c5a
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.
Glad the last thing worked; definitely makes things simpler. A few more details to hash out but going in the right direction
2f34c5a
to
e5f89e5
Compare
351017f
to
623fe37
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.
lgtm. One comment that's not a blocker for me but others may disagree
Over to you @jreback
623fe37
to
184092b
Compare
Ping @jreback |
Friendly reminder @jreback |
can you merge master and will look again |
If normalizing a jsonstruct a field can be set to None due to a schema change. Co-Authored-By: William Ayd <[email protected]>
184092b
to
bcaa92c
Compare
@jreback rebased. Or do you truly want me to merge master into my branch? |
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.
Merge master. There are some CI failures that should be fixed by doing that.
@jreback all green again. |
thanks @bolkedebruin very nice |
If normalizing a jsonstruct a field can be absent
due to a schema change.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff