Skip to content

Commit 64d203f

Browse files
committed
refactor: fix ops.MapOp
1 parent c58acfa commit 64d203f

File tree

2 files changed

+2
-1
lines changed
  • bigframes/core/compile/sqlglot/expressions
  • tests/unit/core/compile/sqlglot/expressions/snapshots/test_generic_ops/test_map

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def _(expr: TypedExpr, op: ops.MapOp) -> sge.Expression:
107107
sge.If(this=sge.convert(key), true=sge.convert(value))
108108
for key, value in op.mappings
109109
],
110+
default=expr.expr,
110111
)
111112

112113

tests/unit/core/compile/sqlglot/expressions/snapshots/test_generic_ops/test_map/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-
CASE `string_col` WHEN 'value1' THEN 'mapped1' END AS `bfcol_1`
8+
CASE `string_col` WHEN 'value1' THEN 'mapped1' ELSE `string_col` END AS `bfcol_1`
99
FROM `bfcte_0`
1010
)
1111
SELECT

0 commit comments

Comments
 (0)