Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.
This repository was archived by the owner on May 6, 2026. It is now read-only.

count() hangs on 1.5.1 #530

@maininformer

Description

@maininformer

Hello, the following code runs prior to 1.5.1, but hangs on 1.5.1 on count():

   1 from google.cloud import ndb
   2 import redis
   3
   4 redis_client = redis.Redis(host="localhost", port=6379, db=0)
   5
   6 class Planet(ndb.Model):
   7     name = ndb.StringProperty()
   8
   9 def reset():
  10     [x.key.delete() for x in Planet.query()]
  11     redis_client.flushdb()
  12
  13
  14 if __name__ == '__main__':
  15     with ndb.Client().context(global_cache=ndb.RedisCache(redis_client)):
  16         reset()
  17
  18         planets = ['mercury', 'venus', 'earth', 'mars', 'jupiter', 'saturn', 'uranus', 'neptune']
  19
  20         list(map(lambda x: Planet(name=x).put(), planets))
  21
  22         assert len(Planet.query(Planet.name == 'mercury').fetch()) == 1
  23         assert Planet.query(Planet.name == 'mercury').count() == 1
  24

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the googleapis/python-ndb API.duplicateThis issue or pull request already exists

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions