Skip to content

Commit

Permalink
chore: address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ncclementi committed Sep 15, 2024
1 parent 061860a commit c22979f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ibis/backends/mysql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pymysql
import sqlglot as sg
import sqlglot.expressions as sge
from pymysql.constants.ER import NO_SUCH_TABLE
from pymysql.constants import ER
from pymysql.err import ProgrammingError

import ibis
Expand Down Expand Up @@ -224,12 +224,10 @@ def get_schema(
).sql(self.dialect)

with self.begin() as cur:
query = sge.Describe(this=table).sql(self.dialect)

try:
cur.execute(query)
cur.execute(sge.Describe(this=table).sql(self.dialect))
except ProgrammingError as e:
if e.args[0] == NO_SUCH_TABLE:
if e.args[0] == ER.NO_SUCH_TABLE:
raise com.TableNotFound(name) from e
else:
result = cur.fetchall()
Expand Down Expand Up @@ -481,7 +479,7 @@ def _in_memory_table_exists(self, name: str) -> bool:
cur.fetchall()
except pymysql.err.ProgrammingError as e:
err_code, _ = e.args
if err_code == NO_SUCH_TABLE:
if err_code == ER.NO_SUCH_TABLE:
return False
raise
else:
Expand Down

0 comments on commit c22979f

Please sign in to comment.