diff --git a/ibis/backends/tests/test_interactive.py b/ibis/backends/tests/test_interactive.py index 6acda4055866..05b40a3f72fd 100644 --- a/ibis/backends/tests/test_interactive.py +++ b/ibis/backends/tests/test_interactive.py @@ -16,6 +16,7 @@ import pytest import ibis +import ibis.common.exceptions as exc from ibis import config @@ -89,3 +90,18 @@ def test_isin_rule_suppressed_exception_repr_not_fail(table): expr = table.filter(bool_clause)["string_col"].value_counts() repr(expr) + + +def test_no_recursion_error(con, monkeypatch): + monkeypatch.setattr(ibis.options, "interactive", True) + monkeypatch.setattr(ibis.options, "default_backend", con) + + a = ibis.memtable({"a": [1]}) + b = ibis.memtable({"b": [1]}) + + expr = a.count() + b.count() + + with pytest.raises( + exc.RelationError, match="The scalar expression cannot be converted" + ): + repr(expr) diff --git a/ibis/expr/types/generic.py b/ibis/expr/types/generic.py index 76d357484c7e..68df1d4d88f3 100644 --- a/ibis/expr/types/generic.py +++ b/ibis/expr/types/generic.py @@ -1366,7 +1366,7 @@ def as_table(self) -> ir.Table: return parent.to_expr().aggregate(self) else: raise com.RelationError( - f"The scalar expression {self} cannot be converted to a " + "The scalar expression cannot be converted to a " "table expression because it involves multiple base table " "references" )