clearwing

changeset 224:1e706591caff

..
author Stelios <stv@roe.ac.uk>
date Sun Aug 26 16:16:05 2018 +0300 (23 months ago)
parents de80574e4e26
children 62245bc577d1
files src/freeform_sql/misc.py
line diff
     1.1 --- a/src/freeform_sql/misc.py	Sun Aug 26 14:22:32 2018 +0300
     1.2 +++ b/src/freeform_sql/misc.py	Sun Aug 26 16:16:05 2018 +0300
     1.3 @@ -693,7 +693,7 @@
     1.4          data = urllib.urlencode(urlenc)
     1.5  
     1.6  
     1.7 -        request = urllib2.Request(query_space + firethorn_config.query_create_uri, data, headers={"Accept" : "application/json", "firethorn.auth.identity" : session.get("email","unknown user"), "firethorn.auth.community" : config.firethorn_admin_community, "firethorn.auth.username" : config.firethorn_admin_username, "firethorn.auth.password" : config.firethorn_admin_password})
     1.8 +        request = urllib2.Request(json.loads(read_json(query_space))["parent"] + firethorn_config.query_create_uri, data, headers={"Accept" : "application/json", "firethorn.auth.identity" : session.get("email","unknown user"), "firethorn.auth.community" : config.firethorn_admin_community, "firethorn.auth.username" : config.firethorn_admin_username, "firethorn.auth.password" : config.firethorn_admin_password})
     1.9  
    1.10          f = urllib2.urlopen(request)
    1.11          query_create_result = json.loads(f.read())
    1.12 @@ -740,8 +740,12 @@
    1.13              return ("ERROR",result_adql_table,query_identity)
    1.14              
    1.15      except Exception as e:
    1.16 -        logging.exception('Exception caught in run query:')
    1.17 -        logging.exception(e) 
    1.18 +
    1.19 +        if (str(e.__class__.__name__).lower().find("overflow")>=0):
    1.20 +            logging.exception("Overflow encountered!!")
    1.21 +            result = ("MAX ERROR",result_adql_table,query_identity)
    1.22 +            return result
    1.23 +
    1.24          return ("ERROR",result_adql_table,query_identity)
    1.25      
    1.26      if f!='':
    1.27 @@ -929,7 +933,7 @@
    1.28  
    1.29  
    1.30  
    1.31 -def execute_async_region_query(url,mode_local,q):
    1.32 +def execute_async_region_query(url,mode_local,q,db=""):
    1.33      """
    1.34      Execute an ADQL query (q) against a TAP service (url + mode:sync|async)       
    1.35      Starts by submitting a request for an async query, then uses the received job URL to call start_async_loop, to receive the final query results 
    1.36 @@ -992,11 +996,11 @@
    1.37                  else:
    1.38                      multiframeID_index = -1
    1.39  
    1.40 -            if getattr(session, "community_input","").lower()=="vphas":
    1.41 -                db = PRIVATE_SURVEY_DB_VPHAS
    1.42 -            else:
    1.43 -                db = SURVEY_DB
    1.44 -           
    1.45 +            #if getattr(session, "community_input","").lower()=="vphas":
    1.46 +            #    db = PRIVATE_SURVEY_DB_VPHAS
    1.47 +            #else:
    1.48 +            #    db = SURVEY_DB
    1.49 +            #db=db
    1.50              temp_row=[]
    1.51              for i in votable.data.tolist():
    1.52                  if framesetID_index == -1 and multiframeID_index == -1: