This repository has been archived by the owner on Jul 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
When wild=True, getting Attribute error if keys are not strings #23
Comments
Easily fixed:
|
@RichPlannuh thanks! I fixed this upstream and pushed to pypi, thanks for the defect report. Fixes: |
Thanks so much. This is a useful little module for a project where I am building an incredibly large and deeply nested dictionary. I was about to write my own recursive search when I discovered your little module
-r
Rich Sadowsky
Engineering Lead
Plannuh, Inc.
rich@plannuh.com
https://www.plannuh.com
… On Jun 25, 2019, at 5:51 PM, Russell Ballestrini ***@***.***> wrote:
@RichPlannuh <https://github.com/RichPlannuh> thanks! I fixed this upstream and pushed to pypi, thanks for the defect report.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#23?email_source=notifications&email_token=AK3VU4LT6RN3KISXOPZEDBDP4KHOBA5CNFSM4H3MHGY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYRWNDY#issuecomment-505636495>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AK3VU4PIIIJUXX4EPEC5FKLP4KHOBANCNFSM4H3MHGYQ>.
|
@RichPlannuh your welcome, I hope it speeds up your progress! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have complex dict objects that have dictionaries with keys that are sometimes integers. If I do this following over one of these like so it works fine:
nested_results = nested_lookup.nested_lookup(document=my_map, key='amount')
if I change it to:
nested_results = nested_lookup.nested_lookup(document=my_map, key='amount', wild=True)
I get:
File "/usr/local/lib/python3.7/site-packages/nested_lookup/nested_lookup.py", line 29, in _nested_lookup
if key == k or (wild and key.lower() in k.lower()):
AttributeError: 'int' object has no attribute 'lower'
The text was updated successfully, but these errors were encountered: