Repository navigation
Is the Datastore Query object supposed to be immutable? #731
Copy link
Copy link
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Activity
- addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.
on Jul 20, 2015 No! If you have a chance to write those methods better, please do!
- addedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.and removedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
on Jul 20, 2015 - added a commit that references this issue
on Nov 17, 2022 - added a commit that references this issue
on Jul 23, 2025 11 remaining items
- added 2 commits that reference this issue
on Feb 2, 2026 - added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 17, 2026 - added a commit that references this issue
on Feb 23, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Feb 26, 2026
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
At first glance I assumed that the
Queryclass was supposed to be immutable -- each method creates a new query instance, copies all of the properties from the previous instance and then returns it.However, I noticed that for methods that can be called multiple times (
filter()andorder()) it holds a reference to the previous instance.e.g.
Is this the desired functionality?