diff --git a/ibis/backends/base/sql/alchemy/datatypes.py b/ibis/backends/base/sql/alchemy/datatypes.py index 84e16ca49dfc..214a80956259 100644 --- a/ibis/backends/base/sql/alchemy/datatypes.py +++ b/ibis/backends/base/sql/alchemy/datatypes.py @@ -142,6 +142,7 @@ class Unknown(sa.Text): sat.BOOLEAN: dt.Boolean, sat.Boolean: dt.Boolean, sat.BINARY: dt.Binary, + sat.BLOB: dt.Binary, sat.LargeBinary: dt.Binary, sat.DATE: dt.Date, sat.Date: dt.Date, diff --git a/ibis/backends/sqlite/tests/test_types.py b/ibis/backends/sqlite/tests/test_types.py index ab7813086e9f..8d2fbec6a834 100644 --- a/ibis/backends/sqlite/tests/test_types.py +++ b/ibis/backends/sqlite/tests/test_types.py @@ -39,6 +39,7 @@ def db(tmp_path_factory): con.execute("CREATE TABLE timestamps (ts TIMESTAMP)") con.execute("CREATE TABLE timestamps_tz (ts TIMESTAMP)") con.execute("CREATE TABLE weird (str_col STRING, date_col ITSADATE)") + con.execute("CREATE TABLE blobs (data BLOB)") with con: con.executemany("INSERT INTO timestamps VALUES (?)", [(t,) for t in TIMESTAMPS]) con.executemany( @@ -54,6 +55,7 @@ def db(tmp_path_factory): ("d", "2022-01-04"), ], ) + con.execute("INSERT INTO blobs (data) VALUES (?)", (b"\x00\x01\x02\x03",)) con.close() return path @@ -90,3 +92,9 @@ def test_type_map(db): } ) assert res.equals(sol) + + +def test_read_blob(db): + con = ibis.sqlite.connect(db) + t = con.table("blobs") + assert t["data"].type() == dt.binary