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

Commit 1b1fd53

Browse files
fix bool handling
1 parent d918f36 commit 1b1fd53

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bigframes/core/blocks.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2792,10 +2792,13 @@ def _get_rows_as_json_values(self) -> Block:
27922792
column_types = list(self.index.dtypes) + list(self.dtypes)
27932793
column_references = []
27942794
for type_, col in zip(column_types, self.expr.column_ids):
2795-
if isinstance(type_, pd.ArrowDtype) and pa.types.is_binary(
2796-
type_.pyarrow_dtype
2797-
):
2795+
if type_ == bigframes.dtypes.BYTES_DTYPE:
27982796
column_references.append(ops.ToJSONString().as_expr(col))
2797+
elif type_ == bigframes.dtypes.BOOL_DTYPE:
2798+
# cast operator produces True/False, but function template expects lower case
2799+
column_references.append(
2800+
ops.where_op.as_expr(ex.const("true"), col, ex.const("false"))
2801+
)
27992802
else:
28002803
column_references.append(
28012804
ops.AsTypeOp(bigframes.dtypes.STRING_DTYPE).as_expr(col)

0 commit comments

Comments
 (0)