Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: stop logging "SyntaxError" as exceptions #21787

Merged
merged 4 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion superset/sql_lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ def execute_sql_statement( # pylint: disable=too-many-arguments,too-many-statem
if query.status == QueryStatus.STOPPED:
raise SqlLabQueryStoppedException() from ex

logger.error("Query %d: %s", query.id, type(ex), exc_info=True)
logger.debug("Query %d: %s", query.id, ex)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep the debug? Or does it also show up as exceptions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naw we end up eating it and converting to a payload i'll add it back

raise SqlLabException(db_engine_spec.extract_error_message(ex)) from ex

Expand Down
2 changes: 2 additions & 0 deletions superset/sqllab/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def run( # pylint: disable=too-many-statements,useless-suppression
) from ex
raise ex
except Exception as ex:
query_id = query.id if query else None
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