AttributeError: 'list' object has no attribute 'items' in GlobalCache
Closed this issue · 1 comments
iseebi commented
Hello,
I upgraded google-cloud-ndb to 1.10.2 from 1.8.0, and had a AttributeError in GlobalCache.
I'm using google-cloud-ndb with GAE/Python 3.7 or my local machine's Python 3.7 and Redis cache.
When I call get() method, I immediately got this error.
Can you tell what happened from the backtrace?
Traceback (most recent call last):
File "/Users/***/***/src/web/***/app/***.py", line 143, in ***
personal = login_data.personal.get()
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/_options.py", line 89, in wrapper
return wrapped(*pass_args, **kwargs)
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/utils.py", line 153, in positional_wrapper
return wrapped(*args, **kwds)
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/key.py", line 809, in get
return self.get_async(_options=_options).result()
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 214, in result
self.check_success()
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 161, in check_success
raise self._exception
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 334, in _advance_tasklet
yielded = self.generator.throw(type(error), error, traceback)
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/key.py", line 894, in get
entity_pb = yield _datastore_api.lookup(self._key, _options)
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 334, in _advance_tasklet
yielded = self.generator.throw(type(error), error, traceback)
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/_datastore_api.py", line 152, in lookup
yield _cache.global_watch(cache_key, lock)
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 334, in _advance_tasklet
yielded = self.generator.throw(type(error), error, traceback)
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/_cache.py", line 185, in wrapper
result = yield function(key, *args, **kwargs)
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/_cache.py", line 104, in idle_callback
cache_call = self.make_call()
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/_cache.py", line 514, in make_call
return _global_cache().watch(self.todo)
File "/Users/***/***/src/web/***/app/cache/global_cache.py", line 40, in watch
super().watch(self.__keys_to_base64(keys))
File "/Users/***/.local/share/virtualenvs/***-mUYIYosR/lib/python3.7/site-packages/google/cloud/ndb/global_cache.py", line 408, in watch
for key, value in items.items():
AttributeError: 'list' object has no attribute 'items'
Model code
class LoginData(ndb.Model):
personal = ndb.KeyProperty(kind=PersonalData)
class PersonalData(ndb.Model):
user_name = ndb.StringProperty(default="Guest", name="username")
iseebi commented
It may caused from my patch for redis-py.
I close issue for now. Sorry.