Skip to content

Commit

Permalink
fix(dataset): fetch metadata on dataset creation may raise broad exce…
Browse files Browse the repository at this point in the history
…ptions (#11973)

* fix(dataset): fetch metadata on dataset creation may raise broad driver exceptions
  • Loading branch information
dpgaspar authored Dec 11, 2020
1 parent 12d9d1e commit 916f7e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
Table,
Text,
)
from sqlalchemy.exc import CompileError
from sqlalchemy.orm import backref, Query, relationship, RelationshipProperty, Session
from sqlalchemy.schema import UniqueConstraint
from sqlalchemy.sql import column, ColumnElement, literal_column, table, text
Expand Down Expand Up @@ -666,7 +665,9 @@ def external_metadata(self) -> List[Dict[str, str]]:
col["type"] = db_engine_spec.column_datatype_to_string(
col["type"], db_dialect
)
except CompileError:
# Broad exception catch, because there are multiple possible exceptions
# from different drivers that fall outside CompileError
except Exception: # pylint: disable=broad-except
col["type"] = "UNKNOWN"
return cols

Expand Down

0 comments on commit 916f7e9

Please sign in to comment.