Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 3.10 is now available in preview.

google.appengine.datastore.datastore_stub_util.CheckQuery

Check a datastore query with normalized filters, orders.

Raises an ApplicationError when any of the following conditions are violated:

  • transactional queries have an ancestor
  • queries that are not too large (sum of filters, orders, ancestor <= max_query_components)
  • ancestor (if any) app and namespace match query app and namespace
  • kindless queries only filter on key and only sort on key ascending
  • multiple inequality (<, <=, >, >=) filters all applied to the same property
  • filters on key compare to a reference in the same app and namespace as the query
  • if an inequality filter on prop X is used, the first order (if any) must be on X

query query to validate
filters normalized (by datastore_index.Normalize) filters from query
orders normalized (by datastore_index.Normalize) orders from query
max_query_components limit on query complexity