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.
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.