Skip to content

Commit

Permalink
fix(clickhouse): check dispatching instead of membership in the regis…
Browse files Browse the repository at this point in the history
…try for `has_operation`
  • Loading branch information
cpcloud committed Jul 28, 2023
1 parent c1b7dbc commit acb7f3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ibis/backends/clickhouse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def _get_schema_using_query(self, query: str) -> sch.Schema:
def has_operation(cls, operation: type[ops.Value]) -> bool:
from ibis.backends.clickhouse.compiler.values import translate_val

return operation in translate_val.registry
return translate_val.dispatch(operation) is not translate_val.dispatch(object)

def create_database(
self, name: str, *, force: bool = False, engine: str = "Atomic"
Expand Down
4 changes: 2 additions & 2 deletions ibis/backends/clickhouse/compiler/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ def _log(op, **kw):


@translate_val.register(tuple)
def _node_list(op, punct="()", **kw):
def _node_list(op, **kw):
values = ", ".join(map(_sql, map(partial(translate_val, **kw), op)))
return f"{punct[0]}{values}{punct[1]}"
return f"({values})"


def _interval_format(op):
Expand Down

0 comments on commit acb7f3f

Please sign in to comment.