You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upgrade Django code to use pydash 6.0.0, I hit the following behaviour change. Not 100% sure if this was an intended change.
Code runs value = pydash.get(qs, "[0].field"), where qs is a Django queryset which may or may not be empty:
For pydash >=6.0.0 this fails with a call stack like this
.venv/lib/python3.9/site-packages/pydash/objects.py:528: in get my code.py: obj = base_get(obj, key, default=sentinel) .venv/lib/python3.9/site-packages/pydash/helpers.py:139: in base_get value = _base_get_object(obj, key, default=default) .venv/lib/python3.9/site-packages/pydash/helpers.py:181: in _base_get_object _raise_if_restricted_key(key)
I think (apologies if this is wrong) this may be a problem accessing "[0]" which was previously handled, returning None.
The text was updated successfully, but these errors were encountered:
AndyKilpatrick
changed the title
get(queryset[0].field) fails from 6.0.0
get(queryset[0].field) fails on upgrade to pydash 6.0.0
Feb 20, 2023
AndyKilpatrick
changed the title
get(queryset[0].field) fails on upgrade to pydash 6.0.0
get(queryset[0].field) on empty queryset fails on upgrade to pydash 6.0.0
Feb 20, 2023
Upgrade Django code to use pydash 6.0.0, I hit the following behaviour change. Not 100% sure if this was an intended change.
Code runs
value = pydash.get(qs, "[0].field")
, where qs is a Django queryset which may or may not be empty:For pydash >=6.0.0 this fails with a call stack like this
.venv/lib/python3.9/site-packages/pydash/objects.py:528: in get my code.py: obj = base_get(obj, key, default=sentinel) .venv/lib/python3.9/site-packages/pydash/helpers.py:139: in base_get value = _base_get_object(obj, key, default=default) .venv/lib/python3.9/site-packages/pydash/helpers.py:181: in _base_get_object _raise_if_restricted_key(key)
I think (apologies if this is wrong) this may be a problem accessing "[0]" which was previously handled, returning None.
The text was updated successfully, but these errors were encountered: