Skip to content

Commit

Permalink
feat(clickhouse): improve error message for invalid types in literal
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-kwitt authored and cpcloud committed Jan 28, 2023
1 parent addd6a9 commit e4d7799
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ibis/backends/clickhouse/compiler/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def _literal(op, **kw):
fields = ", ".join(f"{value} as `{key}`" for key, value in op.value.items())
return f"tuple({fields})"
else:
raise NotImplementedError(type(op))
raise NotImplementedError(f'Unsupported type: {dtype!r}')


def _array_literal_values(op):
Expand Down
14 changes: 2 additions & 12 deletions ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1036,12 +1036,7 @@ def test_exists(batting, awards_players, method_name):
raises=sqlalchemy.exc.StatementError,
),
pytest.mark.broken(
['clickhouse'],
"<class 'ibis.expr.operations.generic.Literal'>",
raises=NotImplementedError,
),
pytest.mark.broken(
['impala'],
['clickhouse', 'impala'],
"Unsupported type: Binary(nullable=True)",
raises=NotImplementedError,
),
Expand Down Expand Up @@ -1160,12 +1155,7 @@ def test_exists(batting, awards_players, method_name):
raises=ProgrammingError,
),
pytest.mark.broken(
['clickhouse'],
"<class 'ibis.expr.operations.generic.Literal'>",
raises=NotImplementedError,
),
pytest.mark.broken(
['impala'],
['clickhouse', 'impala'],
"Unsupported type: UUID(nullable=True)",
raises=NotImplementedError,
),
Expand Down

0 comments on commit e4d7799

Please sign in to comment.