Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit ccfd3d5

Browse files
committed
refactor: fix test_string_astype_json
1 parent a7c11be commit ccfd3d5

File tree

2 files changed

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

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def _cast_to_json(expr: TypedExpr, op: ops.AsTypeOp) -> sge.Expression:
252252
sg_expr = expr.expr
253253

254254
if from_type == dtypes.STRING_DTYPE:
255-
func_name = "PARSE_JSON_IN_SAFE" if op.safe else "PARSE_JSON"
255+
func_name = "SAFE.PARSE_JSON" if op.safe else "PARSE_JSON"
256256
return sge.func(func_name, sg_expr)
257257
if from_type in (dtypes.INT_DTYPE, dtypes.BOOL_DTYPE, dtypes.FLOAT_DTYPE):
258258
sg_expr = sge.Cast(this=sg_expr, to="STRING")

tests/unit/core/compile/sqlglot/expressions/snapshots/test_generic_ops/test_astype_json/out.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITH `bfcte_0` AS (
1313
PARSE_JSON(CAST(`bool_col` AS STRING)) AS `bfcol_6`,
1414
PARSE_JSON(`string_col`) AS `bfcol_7`,
1515
PARSE_JSON(CAST(`bool_col` AS STRING)) AS `bfcol_8`,
16-
PARSE_JSON_IN_SAFE(`string_col`) AS `bfcol_9`
16+
SAFE.PARSE_JSON(`string_col`) AS `bfcol_9`
1717
FROM `bfcte_0`
1818
)
1919
SELECT

0 commit comments

Comments
 (0)