Skip to content

Commit

Permalink
refactor(compiler): fix Compiler.dialect type hint, remove unneeded…
Browse files Browse the repository at this point in the history
… `duckdb` compilation rule for `RegexReplace` (#10400)
  • Loading branch information
NickCrews authored Oct 31, 2024
1 parent 07abe70 commit 273de85
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion ibis/backends/sql/compilers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions ibis/backends/sql/compilers/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 273de85

Please sign in to comment.