Skip to content

Commit 42e6c28

Browse files
michaelkedarCharlyReux
authored andcommitted
Use < OR > query in aliases to fix issue (#2094)
Fixing issues with the `!=` operator, see #2093
1 parent 42a176f commit 42e6c28

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docker/alias/alias_computation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ def main():
8787
AliasGroups and creating new AliasGroups for un-computed bugs."""
8888

8989
# Query for all bugs that have aliases.
90-
bugs = osv.Bug.query(osv.Bug.aliases != '')
90+
# Use (> '' OR < '') instead of (!= '') / (> '') to de-duplicate results
91+
# and avoid datastore emulator problems, see issue #2093
92+
bugs = osv.Bug.query(ndb.OR(osv.Bug.aliases > '', osv.Bug.aliases < ''))
9193
all_alias_group = osv.AliasGroup.query()
9294
allow_list = {
9395
allow_entry.bug_id for allow_entry in osv.AliasAllowListEntry.query()

0 commit comments

Comments
 (0)