django-pandas icon indicating copy to clipboard operation
django-pandas copied to clipboard

Cache error with to_timeseries : 'dict_keys' object is not subscriptable

Open leopons opened this issue 5 years ago • 0 comments

Hi, I have the following error when using to_timeseries on my django project. What's weird is that it's working when I use my local cache, but when I use a Memcached cache I get the error.

Have any ideas of what could be happening ? (I haven't spend too much time going through your code yet, but I'm not familiar with cache usage so a little help will be greatly appreciated !)

Thank you,

File "/app/.heroku/python/lib/python3.6/site-packages/django_pandas/managers.py" in to_timeseries
  216.                                    coerce_float=coerce_float, datetime_index=True)

File "/app/.heroku/python/lib/python3.6/site-packages/django_pandas/managers.py" in to_dataframe
  272.                           datetime_index=datetime_index)

File "/app/.heroku/python/lib/python3.6/site-packages/django_pandas/io.py" in read_frame
  121.         update_with_verbose(df, fieldnames, fields)

File "/app/.heroku/python/lib/python3.6/site-packages/django_pandas/utils.py" in update_with_verbose
  83.             df[fieldname] = function(df[fieldname])

File "/app/.heroku/python/lib/python3.6/site-packages/django_pandas/utils.py" in inner
  53.         out_dict = cache.get_many(unique_cache_keys)

File "/app/.heroku/python/lib/python3.6/site-packages/django/core/cache/backends/memcached.py" in get_many
  88.         ret = self._cache.get_multi(key_map.keys())

File "/app/.heroku/python/lib/python3.6/site-packages/bmemcached/client/replicating.py" in get_multi
  82.                 results = server.get_multi(keys)

File "/app/.heroku/python/lib/python3.6/site-packages/bmemcached/protocol.py" in get_multi
  490.         keys, last = keys[:-1], str_to_bytes(keys[-1])

Exception Type: TypeError
Exception Value: 'dict_keys' object is not subscriptable

leopons avatar Sep 10 '19 09:09 leopons