Skip to content

Commit 76a4475

Browse files
committed
test: error when sqlglot tells us a compilation is unsupported
1 parent d441860 commit 76a4475

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ibis/backends/sql/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,17 @@ def compile(
118118
Compiled expression
119119
"""
120120
query = self.compiler.to_sqlglot(expr, limit=limit, params=params)
121-
sql = query.sql(dialect=self.dialect, pretty=pretty, copy=False)
121+
try:
122+
sql = query.sql(
123+
dialect=self.dialect,
124+
pretty=pretty,
125+
copy=False,
126+
unsupported_level=sg.ErrorLevel.RAISE,
127+
)
128+
except sg.UnsupportedError as e:
129+
raise exc.UnsupportedOperationError(
130+
f"Operation not supported in {self.name} backend: {e}"
131+
) from e
122132
self._log(sql)
123133
return sql
124134

0 commit comments

Comments
 (0)