From acb7f3ff2d3b7f224307548698e003fac85bdff4 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 27 Jul 2023 05:27:41 -0400 Subject: [PATCH] fix(clickhouse): check dispatching instead of membership in the registry for `has_operation` --- ibis/backends/clickhouse/__init__.py | 2 +- ibis/backends/clickhouse/compiler/values.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ibis/backends/clickhouse/__init__.py b/ibis/backends/clickhouse/__init__.py index fb266e874782..cd1e6f84c2c7 100644 --- a/ibis/backends/clickhouse/__init__.py +++ b/ibis/backends/clickhouse/__init__.py @@ -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" diff --git a/ibis/backends/clickhouse/compiler/values.py b/ibis/backends/clickhouse/compiler/values.py index c41c11e59672..6c4d2e511ab4 100644 --- a/ibis/backends/clickhouse/compiler/values.py +++ b/ibis/backends/clickhouse/compiler/values.py @@ -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):