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.

CloudNdb Version 0.2.0 - query filter with key property is not working #246

Description

@ekor15

Environment details

google-cloud-ndb 0.2.0
OS mac 10.15.1 (19B88)
Python 3.7.5

Steps to reproduce

  1. Do a filter with a property that is a key

Code example

defget_folder_model_by_name(self, folder_name, site_id, parent_folder_id=None, namespace=None):
folder_model_kind=models.SiteFolderancestor=ndb.Key(models.Site, site_id)
parent_folder_id=parent_folder_idorPredefinedFolderID.media_rootparent_folder_key=ndb.Key(folder_model_kind, parent_folder_id, parent=ancestor)
query=folder_model_kind.query(ancestor=ancestor)
query=query.filter(folder_model_kind.folder_name==folder_name)
query=query.filter(folder_model_kind.parent_folder_key==parent_folder_key)
query=query.filter(folder_model_kind.state==FileState.mediaifparent_folder_id!=PredefinedFolderID.visitor_uploads_rootelseFileState.visitor)
returnquery.fetch(limit=1)

when using ndb-0.1.0 you can see each filter has the name of the property and the value we set
image

When using ndb-0.2.0 you can see the parent_folder_key filter does not exist instead we see a filter with the kind of the key that is the value for the filter
image

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions