Python 3.9 is now generally available.

google.appengine.datastore.datastore_query.inject_results

Creates a query object that will inject changes into results.

query The datastore_query.Query to augment
updated_entities A list of entity_pb2.EntityProto's that have been updated and should take priority over any values returned by query.
deleted_keys A list of entity_pb2.Reference's for entities that have been deleted and should be removed from query results.

A datastore_query.AugmentedQuery if in memory filtering is required,

query otherwise.