From e2b572d9e229fee503128cab8d7bff02a9cd881b Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Sun, 19 Mar 2017 18:55:11 -0700 Subject: [PATCH] Prevent alarming users with stacktrace when using sqlite --- .../migrations/versions/db527d8c4c78_add_db_verbose_name.py | 2 +- superset/sql_lab.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/superset/migrations/versions/db527d8c4c78_add_db_verbose_name.py b/superset/migrations/versions/db527d8c4c78_add_db_verbose_name.py index e4a36197a3b67..4c0d4167f551f 100644 --- a/superset/migrations/versions/db527d8c4c78_add_db_verbose_name.py +++ b/superset/migrations/versions/db527d8c4c78_add_db_verbose_name.py @@ -23,7 +23,7 @@ def upgrade(): op.create_unique_constraint(None, 'dbs', ['verbose_name']) op.create_unique_constraint(None, 'clusters', ['verbose_name']) except Exception as e: - logging.exception(e) + logging.info('Constraint not created, expected when using sqlite') def downgrade(): diff --git a/superset/sql_lab.py b/superset/sql_lab.py index 864e0edea08b7..29cfc0360980a 100644 --- a/superset/sql_lab.py +++ b/superset/sql_lab.py @@ -109,6 +109,8 @@ def handle_error(msg): conn = engine.raw_connection() cursor = conn.cursor() try: + print(query.executed_sql) + logging.info(query.executed_sql) cursor.execute( query.executed_sql, **db_engine_spec.cursor_execute_kwargs) except Exception as e: