Skip to content

Commit b9226b6

Browse files
committed
refactor: fix ops.StrStripOp
1 parent 3f3ad87 commit b9226b6

File tree

2 files changed

+2
-2
lines changed
  • bigframes/core/compile/sqlglot/expressions
  • tests/unit/core/compile/sqlglot/expressions/snapshots/test_string_ops/test_strip

2 files changed

+2
-2
lines changed

bigframes/core/compile/sqlglot/expressions/string_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def to_startswith(pat: str) -> sge.Expression:
243243

244244
@register_unary_op(ops.StrStripOp, pass_op=True)
245245
def _(expr: TypedExpr, op: ops.StrStripOp) -> sge.Expression:
246-
return sge.Trim(this=sge.convert(op.to_strip), expression=expr.expr)
246+
return sge.Trim(this=expr.expr, expression=sge.convert(op.to_strip))
247247

248248

249249
@register_unary_op(ops.StringSplitOp, pass_op=True)

tests/unit/core/compile/sqlglot/expressions/snapshots/test_string_ops/test_strip/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ WITH `bfcte_0` AS (
55
), `bfcte_1` AS (
66
SELECT
77
*,
8-
TRIM(' ', `string_col`) AS `bfcol_1`
8+
TRIM(`string_col`, ' ') AS `bfcol_1`
99
FROM `bfcte_0`
1010
)
1111
SELECT

0 commit comments

Comments
 (0)