File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -493,14 +493,14 @@ def _subset_data_view(selected: bool) -> pd.DataFrame:
493
493
if cell_selection is not None and cell_selection ["type" ] == "row" :
494
494
# Use a `set` for faster lookups
495
495
selected_row_indices_set = set (cell_selection ["rows" ])
496
+ nrow = data .shape [0 ]
496
497
497
498
# Subset the data view indices to only include the selected rows that are in the data
498
499
data_view_indices = [
499
500
index
500
501
for index in data_view_indices
501
- if index in selected_row_indices_set
502
- and index
503
- in data .index # pyright: ignore[reportUnknownMemberType]
502
+ # Make sure the index is not larger than the number of rows
503
+ if index in selected_row_indices_set and index < nrow
504
504
]
505
505
506
506
return data .iloc [data_view_indices ]
You can’t perform that action at this time.
0 commit comments