def download(request, id, format):
  try:
    query_history = authorized_get_query_history(request, id, must_exist=True)
    db = dbms.get(request.user, query_history.get_query_server_config())
    LOG.debug((query_history.server_id, query_history.query) % 'Download results for query %s: [ %s ]')

    return data_export.download(query_history.get_handle(), format, db)
  except Exception, e:
    if not hasattr(e, 'message') or not e.message:
      message = e
    else:
      message = e.message
    raise PopupException(message, detail='')
dataset/ETHPy150Open cloudera/hue/apps/beeswax/src/beeswax/views.py/download/swapped operands of `%`