Skip to content

Commit

Permalink
[BUG] Fix concat expression typing (#2868)
Browse files Browse the repository at this point in the history
#2863

Co-authored-by: Colin Ho <[email protected]>
  • Loading branch information
colin-ho and Colin Ho authored Sep 20, 2024
1 parent 53dec06 commit c481f1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions daft/expressions/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,7 @@ def split(self, pattern: str | Expression, regex: bool = False) -> Expression:
pattern_expr = Expression._to_expression(pattern)
return Expression._from_pyexpr(self._expr.utf8_split(pattern_expr._expr, regex))

def concat(self, other: str) -> Expression:
def concat(self, other: str | Expression) -> Expression:
"""Concatenates two string expressions together
.. NOTE::
Expand Down Expand Up @@ -2012,7 +2012,8 @@ def concat(self, other: str) -> Expression:
Expression: a String expression which is `self` concatenated with `other`
"""
# Delegate to + operator implementation.
return Expression._from_pyexpr(self._expr) + other
other_expr = Expression._to_expression(other)
return Expression._from_pyexpr(self._expr) + other_expr

def extract(self, pattern: str | Expression, index: int = 0) -> Expression:
r"""Extracts the specified match group from the first regex match in each string in a string column.
Expand Down

0 comments on commit c481f1b

Please sign in to comment.