diff --git a/contrib/starrocks-python-client/starrocks/dialect.py b/contrib/starrocks-python-client/starrocks/dialect.py index 87d5969b73ec0..528c5f9133db2 100644 --- a/contrib/starrocks-python-client/starrocks/dialect.py +++ b/contrib/starrocks-python-client/starrocks/dialect.py @@ -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 @@ -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)