Skip to content

Commit 9485b00

Browse files
committed
Fix: Add defensive check for empty column_ids in unpivot function
1 parent bbb4096 commit 9485b00

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bigframes/core/blocks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3433,6 +3433,9 @@ def unpivot(
34333433
)
34343434
new_passthrough_cols = [column_mapping[col] for col in passthrough_columns]
34353435
# Last column is offsets
3436+
if not labels_array.column_ids:
3437+
# Handle empty column_ids case for multimodal DataFrames
3438+
return array_value, (tuple(), tuple(), tuple(passthrough_columns))
34363439
index_col_ids = [labels_mapping[col] for col in labels_array.column_ids[:-1]]
34373440
explode_offsets_id = labels_mapping[labels_array.column_ids[-1]]
34383441

0 commit comments

Comments
 (0)