Skip to content

Commit

Permalink
fix(pyspark): raise proper error when trying to generate sql
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and jcrist committed Mar 24, 2023
1 parent 946202b commit 51afc13
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ibis/backends/pyspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,3 +704,6 @@ def _register_failure(self):
f"Cannot infer appropriate read function for input, "
f"please call one of {msg} directly"
)

def _to_sql(self, expr: ir.Expr, **kwargs) -> str:
raise NotImplementedError(f"Backend '{self.name}' backend doesn't support SQL")
4 changes: 3 additions & 1 deletion ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,9 @@ def test_memtable_construct(backend, con, monkeypatch):
raises=NotImplementedError,
reason="not a SQL backend",
)
@pytest.mark.notimpl(["pyspark"], raises=com.OperationNotDefinedError)
@pytest.mark.notimpl(
["pyspark"], reason="pyspark doesn't generate SQL", raises=NotImplementedError
)
@pytest.mark.notimpl(["druid"], reason="no sqlglot dialect", raises=ValueError)
def test_many_subqueries(con, snapshot):
def query(t, group_cols):
Expand Down

0 comments on commit 51afc13

Please sign in to comment.