File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -543,6 +543,8 @@ def _generate_display_table(
543543 # - get the row numbers for the table
544544 # - convert the table to a Polars or Pandas DF
545545 if ibis_tbl :
546+ import ibis
547+
546548 # Get the Schema of the table
547549 tbl_schema = Schema (tbl = data )
548550
@@ -558,13 +560,15 @@ def _generate_display_table(
558560 if row_number_list is None :
559561 row_number_list = range (1 , n_rows + 1 )
560562 else :
561- # Get the first and last n rows of the table
563+ # Get the first n and last n rows of the table
562564 data_head = data .head (n_head )
563- row_numbers_head = range ( 1 , n_head + 1 )
564- data_tail = data [( n_rows - n_tail ) : n_rows ]
565- row_numbers_tail = range ( n_rows - n_tail + 1 , n_rows + 1 )
565+ data_tail = data . filter (
566+ [ ibis . row_number () >= ( n_rows - n_tail ), ibis . row_number () <= n_rows ]
567+ )
566568 data_subset = data_head .union (data_tail )
567569
570+ row_numbers_head = range (1 , n_head + 1 )
571+ row_numbers_tail = range (n_rows - n_tail + 1 , n_rows + 1 )
568572 if row_number_list is None :
569573 row_number_list = list (row_numbers_head ) + list (row_numbers_tail )
570574
You can’t perform that action at this time.
0 commit comments