Skip to content

Commit

Permalink
fix(mysql): fix UUID type reflection for sqlalchemy 2.0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrist committed Jul 6, 2023
1 parent b632063 commit ec313da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ibis/backends/mysql/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sqlalchemy.dialects import mysql

import ibis.expr.datatypes as dt
from ibis.backends.base.sql.alchemy.datatypes import AlchemyType
from ibis.backends.base.sql.alchemy.datatypes import AlchemyType, UUID

# binary character set
# used to distinguish blob binary vs blob text
Expand Down Expand Up @@ -214,6 +214,7 @@ def result_processor(self, *_):
mysql.TIME: dt.Time,
mysql.YEAR: dt.Int8,
MySQLDateTime: dt.Timestamp,
UUID: dt.String,
}


Expand Down Expand Up @@ -247,7 +248,7 @@ def to_ibis(cls, typ, nullable=True):
return dt.Timestamp(timezone="UTC", nullable=nullable)
elif isinstance(typ, mysql.SET):
return dt.Set(dt.string, nullable=nullable)
elif dtype := _from_mysql_types[type(typ)]:
elif dtype := _from_mysql_types.get(type(typ)):
return dtype(nullable=nullable)
else:
return super().to_ibis(typ, nullable=nullable)

0 comments on commit ec313da

Please sign in to comment.