Well I found the solution myself; here it is.
Turns out that when a model inherits from EndpointsModel
, has a property with repeated=True
and you create an endpoints-proto-datastore query_method
to retrieve the list of your model, there is a call in the stack to the _PopulateFilters method in module model.py of the library; here's the relevant stack trace:
File "lib/endpoints_proto_datastore/ndb/model.py", line 229, in _PopulateFilters self._AddFilter(prop == current_value)
Lines around 229 in model.py read as follows:
# Only filter for non-null values
if current_value is not None:
self._AddFilter(prop == current_value)
If the model property in question has repeated=True
, then current_value
will be []
and that is where my code was breaking. I changed the relevant part in model.py as follows and that fixed the issue.
# Only filter for non-null values...
if current_value is not None:
# ...and non empty arrays in case of properties with repeated=True
if current_value:
self._AddFilter(prop == current_value)
Will create a comment on github to see if this gets included in the next release.