mirror of
https://github.com/valitydev/redash.git
synced 2024-11-08 01:48:54 +00:00
Less verbose logging in data sources.
This commit is contained in:
parent
24cd55f5cc
commit
3513d84bb8
@ -10,7 +10,7 @@ logger = logging.getLogger(__name__)
|
||||
try:
|
||||
from pyhive import hive
|
||||
enabled = True
|
||||
except ImportError, e:
|
||||
except ImportError:
|
||||
enabled = False
|
||||
|
||||
COLUMN_NAME = 0
|
||||
@ -125,9 +125,6 @@ class Hive(BaseSQLQueryRunner):
|
||||
connection.cancel()
|
||||
error = "Query cancelled by user."
|
||||
json_data = None
|
||||
except Exception as e:
|
||||
logging.exception(e)
|
||||
raise sys.exc_info()[1], None, sys.exc_info()[2]
|
||||
finally:
|
||||
if connection:
|
||||
connection.close()
|
||||
|
@ -125,20 +125,15 @@ class Impala(BaseSQLQueryRunner):
|
||||
error = None
|
||||
cursor.close()
|
||||
except DatabaseError as e:
|
||||
logging.exception(e)
|
||||
json_data = None
|
||||
error = e.message
|
||||
except RPCError as e:
|
||||
logging.exception(e)
|
||||
json_data = None
|
||||
error = "Metastore Error [%s]" % e.message
|
||||
except KeyboardInterrupt:
|
||||
connection.cancel()
|
||||
error = "Query cancelled by user."
|
||||
json_data = None
|
||||
except Exception as e:
|
||||
logging.exception(e)
|
||||
raise sys.exc_info()[1], None, sys.exc_info()[2]
|
||||
finally:
|
||||
if connection:
|
||||
connection.close()
|
||||
|
@ -162,7 +162,6 @@ class SqlServer(BaseSQLQueryRunner):
|
||||
|
||||
cursor.close()
|
||||
except pymssql.Error as e:
|
||||
logging.exception(e)
|
||||
try:
|
||||
# Query errors are at `args[1]`
|
||||
error = e.args[1]
|
||||
|
@ -158,15 +158,12 @@ class Oracle(BaseSQLQueryRunner):
|
||||
error = 'Query completed but it returned no data.'
|
||||
json_data = None
|
||||
except cx_Oracle.DatabaseError as err:
|
||||
logging.exception(err.message)
|
||||
error = "Query failed. {}.".format(err.message)
|
||||
error = u"Query failed. {}.".format(err.message)
|
||||
json_data = None
|
||||
except KeyboardInterrupt:
|
||||
connection.cancel()
|
||||
error = "Query cancelled by user."
|
||||
json_data = None
|
||||
except Exception as err:
|
||||
raise sys.exc_info()[1], None, sys.exc_info()[2]
|
||||
finally:
|
||||
connection.close()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user