File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments