Skip to content

Commit 43adb2e

Browse files
committed
fix: ensure select_columns preserves hidden ordering columns
1 parent f278db8 commit 43adb2e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bigframes/core/blocks.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,8 +1373,14 @@ def select_column(self, id: str) -> Block:
13731373

13741374
def select_columns(self, ids: typing.Sequence[str]) -> Block:
13751375
# Allow renames as may end up selecting same columns multiple times
1376+
# Also need to make sure we don't drop any hidden columns
1377+
hidden_cols = [
1378+
col
1379+
for col in self._expr.column_ids
1380+
if col not in self.index_columns and col not in self.value_columns
1381+
]
13761382
expr = self._expr.select_columns(
1377-
[*self.index_columns, *ids], allow_renames=True
1383+
[*self.index_columns, *ids, *hidden_cols], allow_renames=True
13781384
)
13791385
col_labels = self._get_labels_for_columns(ids)
13801386
return Block(expr, self.index_columns, col_labels, self.index.names)

0 commit comments

Comments
 (0)