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

Commit 0196cb1

Browse files
committed
refactor: fix test_assign_new_column_w_literal on pa.Scalar None value
1 parent d6506ab commit 0196cb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bigframes/core/compile/sqlglot/sqlglot_ir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ def _literal(value: typing.Any, dtype: dtypes.Dtype) -> sge.Expression:
674674
expressions=[_literal(value=v, dtype=value_type) for v in value]
675675
)
676676
return values if len(value) > 0 else _cast(values, sqlglot_type)
677-
elif pd.isna(value):
677+
elif pd.isna(value) or (isinstance(value, pa.Scalar) and not value.is_valid):
678678
return _cast(sge.Null(), sqlglot_type)
679679
elif dtype == dtypes.JSON_DTYPE:
680680
return sge.ParseJSON(this=sge.convert(str(value)))

0 commit comments

Comments
 (0)