Why not:

   raise BadRequest('Unable to construct query')