Skip to content

Commit

Permalink
logging from upper pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed Oct 21, 2022
1 parent 67c3f20 commit a977e82
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions superset/sqllab/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,9 @@ def run( # pylint: disable=too-many-statements,useless-suppression
"payload": self._execution_context_convertor.serialize_payload(),
}
except (SupersetErrorsException, SupersetException) as ex:
if ex.status != 422:
query_id = query.id if query else -1
logger.exception("Query %d: %s", query_id, type(ex))
logger.warning("ExecuteSqlCommand failed with %s", str(ex))
raise ex
except Exception as ex:
query_id = query.id if query else -1
logger.exception("Query %d: %s", query_id, type(ex))
raise SqlLabException(self._execution_context, exception=ex) from ex

def _try_get_existing_query(self) -> Optional[Query]:
Expand Down
1 change: 0 additions & 1 deletion tests/integration_tests/celery_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ def test_run_sync_query_dont_exist(test_client, ctas_method):
engine_name = examples_db.db_engine_spec.engine_name
sql_dont_exist = "SELECT name FROM table_dont_exist"
result = run_sql(test_client, sql_dont_exist, cta=True, ctas_method=ctas_method)
print(result)
if backend() == "sqlite" and ctas_method == CtasMethod.VIEW:
assert QueryStatus.SUCCESS == result["status"], result
elif backend() == "presto":
Expand Down

0 comments on commit a977e82

Please sign in to comment.