Skip to content

Commit 07cee38

Browse files
committed
fix(trino): ensure connecting works with trino 0.321
1 parent c437992 commit 07cee38

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ibis/backends/trino/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,16 @@ def do_connect(
4949
port=port,
5050
database=database,
5151
)
52-
connect_args.setdefault("experimental_python_types", True)
53-
super().do_connect(sa.create_engine(url, connect_args=connect_args))
52+
connect_args.setdefault("timezone", "UTC")
53+
try:
54+
super().do_connect(
55+
sa.create_engine(
56+
url,
57+
connect_args={**connect_args, "experimental_python_types": True},
58+
)
59+
)
60+
except TypeError:
61+
super().do_connect(sa.create_engine(url, connect_args=connect_args))
5462
self._meta = sa.MetaData(bind=self.con, schema=schema)
5563

5664
def _metadata(self, query: str) -> Iterator[tuple[str, dt.DataType]]:

0 commit comments

Comments
 (0)