From 273de851ef410d51a9b083b47407cdd39295b0cc Mon Sep 17 00:00:00 2001 From: Nick Crews Date: Thu, 31 Oct 2024 05:11:31 -0800 Subject: [PATCH] refactor(compiler): fix `Compiler.dialect` type hint, remove unneeded `duckdb` compilation rule for `RegexReplace` (#10400) --- ibis/backends/sql/compilers/base.py | 2 +- ibis/backends/sql/compilers/duckdb.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ibis/backends/sql/compilers/base.py b/ibis/backends/sql/compilers/base.py index 88dce966b763..ea19955feed1 100644 --- a/ibis/backends/sql/compilers/base.py +++ b/ibis/backends/sql/compilers/base.py @@ -522,7 +522,7 @@ def impl(self, op, *, left, right): @property @abc.abstractmethod - def dialect(self) -> str: + def dialect(self) -> type[sg.Dialect]: """Backend dialect.""" @property diff --git a/ibis/backends/sql/compilers/duckdb.py b/ibis/backends/sql/compilers/duckdb.py index b0b3fa088d15..9534180878eb 100644 --- a/ibis/backends/sql/compilers/duckdb.py +++ b/ibis/backends/sql/compilers/duckdb.py @@ -523,9 +523,6 @@ def visit_TimestampNow(self, op): """DuckDB current timestamp defaults to timestamp + tz.""" return self.cast(super().visit_TimestampNow(op), dt.timestamp) - def visit_RegexReplace(self, op, *, arg, pattern, replacement): - return self.f.regexp_replace(arg, pattern, replacement, "g") - def visit_First(self, op, *, arg, where, order_by, include_null): if not include_null: cond = arg.is_(sg.not_(NULL, copy=False))