Skip to content

Commit

Permalink
[BugFix] Replace sqlalchemy.util.raise with Python 3 raise (#54518)
Browse files Browse the repository at this point in the history
Signed-off-by: Edgar Ramírez-Mondragón <[email protected]>
  • Loading branch information
edgarrmondragon authored Dec 31, 2024
1 parent 1498c17 commit a703be9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions contrib/starrocks-python-client/starrocks/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,10 @@ def visit_create_table(self, create, **kw):
if column.primary_key:
first_pk = True
except exc.CompileError as ce:
util.raise_(
exc.CompileError(
util.u("(in table '%s', column '%s'): %s")
% (table.description, column.name, ce.args[0])
),
from_=ce,
)
raise exc.CompileError(
"(in table '%s', column '%s'): %s"
% (table.description, column.name, ce.args[0])
) from ce

# N.B. Primary Key is specified in post_create_table
# Indexes are created by SQLA after the creation of the table using CREATE INDEX
Expand Down Expand Up @@ -429,7 +426,7 @@ def _show_table_indexes(
).exec_driver_sql(st)
except exc.DBAPIError as e:
if self._extract_error_code(e.orig) == 1146:
util.raise_(exc.NoSuchTableError(full_name), replace_context=e)
raise exc.NoSuchTableError(full_name) from e
else:
raise
index_results = self._compat_fetchall(rp, charset=charset)
Expand Down

0 comments on commit a703be9

Please sign in to comment.