diff --git a/src/dt_browser/browser.py b/src/dt_browser/browser.py index f4fc1c2..15e7abc 100644 --- a/src/dt_browser/browser.py +++ b/src/dt_browser/browser.py @@ -92,13 +92,13 @@ def _get_row_bg_color_expr(self, cursor_row_idx: int) -> pl.Expr: tmp = super()._get_row_bg_color_expr(cursor_row_idx) if self.active_search_queue: tmp = ( - pl.when(pl.col(INDEX_COL).is_in(self.active_search_queue)) + pl.when(pl.col(INDEX_COL).is_in(pl.lit(pl.Series(self.active_search_queue)))) .then(pl.lit(_color_name(self._search_highlight.bgcolor))) .otherwise(tmp) ) if self._bookmarks.has_bookmarks: tmp = ( - pl.when(pl.col(INDEX_COL).is_in(self._bookmarks.meta_dt[INDEX_COL])) + pl.when(pl.col(INDEX_COL).is_in(pl.lit(self._bookmarks.meta_dt[INDEX_COL]))) .then(pl.lit(_color_name(self._bookmark_highlight.bgcolor))) .otherwise(tmp) ) diff --git a/tests/__snapshots__/test_auto_width/test_snap_auto_width_off.svg b/tests/__snapshots__/test_auto_width/test_snap_auto_width_off.svg index eeae9b4..8144071 100644 --- a/tests/__snapshots__/test_auto_width/test_snap_auto_width_off.svg +++ b/tests/__snapshots__/test_auto_width/test_snap_auto_width_off.svg @@ -145,37 +145,37 @@ - + -  Row # short_col growing_col                                                      ▔ Row Detail ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ -    1 s0        x                                                                 Field       dtype  Value        -    2 s1        xx                                                                Row #       UInt32 1            -    3 s2        xxx                                                               short_col   String s0           -    4 s3        xxxx                                                              growing_col String x            -    5 s4        xxxxx                                                             fixed_col   String fixed_0000   -    6 s5        xxxxxx                                                            -    7 s6        xxxxxxx                                                          ▁▁ -    8 s7        xxxxxxxx                                                          -    9 s8        xxxxxxxxx                                                         -   10 s9        xxxxxxxxxx                                                        -   11 s10       xxxxxxxxxxx                                                       -   12 s11       xxxxxxxxxxxx                                                      -   13 s12       xxxxxxxxxxxxx                                                     -   14 s13       xxxxxxxxxxxxxx                                                    -   15 s14       xxxxxxxxxxxxxxx                                                   -   16 s15       xxxxxxxxxxxxxxxx                                                  -   17 s16       xxxxxxxxxxxxxxxxx                                                 -   18 s17       xxxxxxxxxxxxxxxxxx                                                -   19 s18       xxxxxxxxxxxxxxxxxxx                                               -   20 s19       xxxxxxxxxxxxxxxxxxxx                                              -   21 s20       xxxxxxxxxxxxxxxxxxxxx                                             -   22 s21       xxxxxxxxxxxxxxxxxxxxxx                                            -   23 s22       xxxxxxxxxxxxxxxxxxxxxxx                                           -   24 s23       xxxxxxxxxxxxxxxxxxxxxxxx                                          -   25 s24       xxxxxxxxxxxxxxxxxxxxxxxxx                                         -   26 s25       xxxxxxxxxxxxxxxxxxxxxxxxxx                                        -   27 s26       xxxxxxxxxxxxxxxxxxxxxxxxxxx                                       -▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎ +  Row # short_col growing_col                              ▔ Row Detail ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ +    1 s0        x                                         Field       dtype  Value                                +    2 s1        xx                                        Row #       UInt32 1                                    +    3 s2        xxx                                       short_col   String s0                                   +    4 s3        xxxx                                      growing_col String x                                    +    5 s4        xxxxx                                     fixed_col   String fixed_0000                           +    6 s5        xxxxxx                                    +    7 s6        xxxxxxx                                  ▁▁ +    8 s7        xxxxxxxx                                  +    9 s8        xxxxxxxxx                                 +   10 s9        xxxxxxxxxx                                +   11 s10       xxxxxxxxxxx                               +   12 s11       xxxxxxxxxxxx                              +   13 s12       xxxxxxxxxxxxx                             +   14 s13       xxxxxxxxxxxxxx                            +   15 s14       xxxxxxxxxxxxxxx                           +   16 s15       xxxxxxxxxxxxxxxx                          +   17 s16       xxxxxxxxxxxxxxxxx                         +   18 s17       xxxxxxxxxxxxxxxxxx                        +   19 s18       xxxxxxxxxxxxxxxxxxx                       +   20 s19       xxxxxxxxxxxxxxxxxxxx                      +   21 s20       xxxxxxxxxxxxxxxxxxxxx                    ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎ +   22 s21       xxxxxxxxxxxxxxxxxxxxxx                   ▔ Column: Row # ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ +   23 s22       xxxxxxxxxxxxxxxxxxxxxxx                   Min                                                  1  +   24 s23       xxxxxxxxxxxxxxxxxxxxxxxx                  Q1                                                26.0  +   25 s24       xxxxxxxxxxxxxxxxxxxxxxxxx                 Median                                            50.5  +   26 s25       xxxxxxxxxxxxxxxxxxxxxxxxxx                Q3                                                75.0  +   27 s26       xxxxxxxxxxxxxxxxxxxxxxxxxxx               Max                                                100  +▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎  f Filter rows  / Search  b Add/Del Bookmark  x Compute Expressions...  c Columns...  r Toggle Row Detail  s^p palette diff --git a/tests/__snapshots__/test_auto_width/test_snap_auto_width_on.svg b/tests/__snapshots__/test_auto_width/test_snap_auto_width_on.svg index f2dac31..73d3321 100644 --- a/tests/__snapshots__/test_auto_width/test_snap_auto_width_on.svg +++ b/tests/__snapshots__/test_auto_width/test_snap_auto_width_on.svg @@ -145,37 +145,37 @@ - + -  Row # short_col growing_col                  fixed_col                           ▔ Row Detail ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ -    1 s0        x                            fixed_0000                           Field       dtype  Value        -    2 s1        xx                           fixed_0001                           Row #       UInt32 1            -    3 s2        xxx                          fixed_0002                           short_col   String s0           -    4 s3        xxxx                         fixed_0003                           growing_col String x            -    5 s4        xxxxx                        fixed_0004                           fixed_col   String fixed_0000   -    6 s5        xxxxxx                       fixed_0005                           -    7 s6        xxxxxxx                      fixed_0006                           -    8 s7        xxxxxxxx                     fixed_0007                          ▅▅ -    9 s8        xxxxxxxxx                    fixed_0008                           -   10 s9        xxxxxxxxxx                   fixed_0009                           -   11 s10       xxxxxxxxxxx                  fixed_0010                           -   12 s11       xxxxxxxxxxxx                 fixed_0011                           -   13 s12       xxxxxxxxxxxxx                fixed_0012                           -   14 s13       xxxxxxxxxxxxxx               fixed_0013                           -   15 s14       xxxxxxxxxxxxxxx              fixed_0014                           -   16 s15       xxxxxxxxxxxxxxxx             fixed_0015                           -   17 s16       xxxxxxxxxxxxxxxxx            fixed_0016                           -   18 s17       xxxxxxxxxxxxxxxxxx           fixed_0017                           -   19 s18       xxxxxxxxxxxxxxxxxxx          fixed_0018                           -   20 s19       xxxxxxxxxxxxxxxxxxxx         fixed_0019                           -   21 s20       xxxxxxxxxxxxxxxxxxxxx        fixed_0020                           -   22 s21       xxxxxxxxxxxxxxxxxxxxxx       fixed_0021                           -   23 s22       xxxxxxxxxxxxxxxxxxxxxxx      fixed_0022                           -   24 s23       xxxxxxxxxxxxxxxxxxxxxxxx     fixed_0023                           -   25 s24       xxxxxxxxxxxxxxxxxxxxxxxxx    fixed_0024                           -   26 s25       xxxxxxxxxxxxxxxxxxxxxxxxxx   fixed_0025    -   27 s26       xxxxxxxxxxxxxxxxxxxxxxxxxxx  fixed_0026   Auto column width: ON -   28 s27       xxxxxxxxxxxxxxxxxxxxxxxxxxxx fixed_0027   ▁▎ +  Row # short_col growing_col                  fixed_col   ▔ Row Detail ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ +    1 s0        x                            fixed_0000   Field       dtype  Value                                +    2 s1        xx                           fixed_0001   Row #       UInt32 1                                    +    3 s2        xxx                          fixed_0002   short_col   String s0                                   +    4 s3        xxxx                         fixed_0003   growing_col String x                                    +    5 s4        xxxxx                        fixed_0004   fixed_col   String fixed_0000                           +    6 s5        xxxxxx                       fixed_0005   +    7 s6        xxxxxxx                      fixed_0006   +    8 s7        xxxxxxxx                     fixed_0007  ▅▅ +    9 s8        xxxxxxxxx                    fixed_0008   +   10 s9        xxxxxxxxxx                   fixed_0009   +   11 s10       xxxxxxxxxxx                  fixed_0010   +   12 s11       xxxxxxxxxxxx                 fixed_0011   +   13 s12       xxxxxxxxxxxxx                fixed_0012   +   14 s13       xxxxxxxxxxxxxx               fixed_0013   +   15 s14       xxxxxxxxxxxxxxx              fixed_0014   +   16 s15       xxxxxxxxxxxxxxxx             fixed_0015   +   17 s16       xxxxxxxxxxxxxxxxx            fixed_0016   +   18 s17       xxxxxxxxxxxxxxxxxx           fixed_0017   +   19 s18       xxxxxxxxxxxxxxxxxxx          fixed_0018   +   20 s19       xxxxxxxxxxxxxxxxxxxx         fixed_0019   +   21 s20       xxxxxxxxxxxxxxxxxxxxx        fixed_0020  ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎ +   22 s21       xxxxxxxxxxxxxxxxxxxxxx       fixed_0021  ▔ Column: Row # ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ +   23 s22       xxxxxxxxxxxxxxxxxxxxxxx      fixed_0022   Min                                                  1  +   24 s23       xxxxxxxxxxxxxxxxxxxxxxxx     fixed_0023   Q1                                                26.0  +   25 s24       xxxxxxxxxxxxxxxxxxxxxxxxx    fixed_0024   Median                                            50.5  +   26 s25       xxxxxxxxxxxxxxxxxxxxxxxxxx   fixed_0025   +   27 s26       xxxxxxxxxxxxxxxxxxxxxxxxxxx  fixed_0026  Auto column width: ON +   28 s27       xxxxxxxxxxxxxxxxxxxxxxxxxxxx fixed_0027  ▁▎  f Filter rows  / Search  b Add/Del Bookmark  x Compute Expressions...  c Columns...  r Toggle Row Detail  s^p palette diff --git a/tests/__snapshots__/test_auto_width/test_snap_auto_width_on_scrolled_bottom.svg b/tests/__snapshots__/test_auto_width/test_snap_auto_width_on_scrolled_bottom.svg index 1cb5b20..6d62b1e 100644 --- a/tests/__snapshots__/test_auto_width/test_snap_auto_width_on_scrolled_bottom.svg +++ b/tests/__snapshots__/test_auto_width/test_snap_auto_width_on_scrolled_bottom.svg @@ -145,7 +145,7 @@ - +  Row # short_col growing_col                              ▔ Row Detail ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎    73 s72       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  Field       dtype  Value                                @@ -168,11 +168,11 @@    90 s89       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...     91 s90       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... ▁▁    92 s91       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  -   93 s92       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  -   94 s93       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  -   95 s94       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  -   96 s95       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  -   97 s96       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  +   93 s92       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎ +   94 s93       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... ▔ Column: Row # ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ +   95 s94       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  Min                                                  1  +   96 s95       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  Q1                                                26.0  +   97 s96       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...  Median                                            50.5     98 s97       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...     99 s98       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... Auto column width: ON ▁▎ diff --git a/tests/__snapshots__/test_auto_width/test_snap_auto_width_toggled_off_after_on.svg b/tests/__snapshots__/test_auto_width/test_snap_auto_width_toggled_off_after_on.svg index 1470e1e..5e3e1af 100644 --- a/tests/__snapshots__/test_auto_width/test_snap_auto_width_toggled_off_after_on.svg +++ b/tests/__snapshots__/test_auto_width/test_snap_auto_width_toggled_off_after_on.svg @@ -146,37 +146,37 @@ - + -  Row # short_col growing_col                                                      ▔ Row Detail ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ -    1 s0        x                                                                 Field       dtype  Value        -    2 s1        xx                                                                Row #       UInt32 1            -    3 s2        xxx                                                               short_col   String s0           -    4 s3        xxxx                                                              growing_col String x            -    5 s4        xxxxx                                                             fixed_col   String fixed_0000   -    6 s5        xxxxxx                                                            -    7 s6        xxxxxxx                                                          ▁▁ -    8 s7        xxxxxxxx                                                          -    9 s8        xxxxxxxxx                                                         -   10 s9        xxxxxxxxxx                                                        -   11 s10       xxxxxxxxxxx                                                       -   12 s11       xxxxxxxxxxxx                                                      -   13 s12       xxxxxxxxxxxxx                                                     -   14 s13       xxxxxxxxxxxxxx                                                    -   15 s14       xxxxxxxxxxxxxxx                                                   -   16 s15       xxxxxxxxxxxxxxxx                                                  -   17 s16       xxxxxxxxxxxxxxxxx                                                 -   18 s17       xxxxxxxxxxxxxxxxxx                                                -   19 s18       xxxxxxxxxxxxxxxxxxx                                               -   20 s19       xxxxxxxxxxxxxxxxxxxx                                              -   21 s20       xxxxxxxxxxxxxxxxxxxxx                                             -   22 s21       xxxxxxxxxxxxxxxxxxxxxx                     -   23 s22       xxxxxxxxxxxxxxxxxxxxxxx                   Auto column width: ON -   24 s23       xxxxxxxxxxxxxxxxxxxxxxxx                   -   25 s24       xxxxxxxxxxxxxxxxxxxxxxxxx                                         -   26 s25       xxxxxxxxxxxxxxxxxxxxxxxxxx                 -   27 s26       xxxxxxxxxxxxxxxxxxxxxxxxxxx               Auto column width: OFF -▁▎ +  Row # short_col growing_col                              ▔ Row Detail ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▎ +    1 s0        x                                         Field       dtype  Value                                +    2 s1        xx                                        Row #       UInt32 1                                    +    3 s2        xxx                                       short_col   String s0                                   +    4 s3        xxxx                                      growing_col String x                                    +    5 s4        xxxxx                                     fixed_col   String fixed_0000                           +    6 s5        xxxxxx                                    +    7 s6        xxxxxxx                                  ▁▁ +    8 s7        xxxxxxxx                                  +    9 s8        xxxxxxxxx                                 +   10 s9        xxxxxxxxxx                                +   11 s10       xxxxxxxxxxx                               +   12 s11       xxxxxxxxxxxx                              +   13 s12       xxxxxxxxxxxxx                             +   14 s13       xxxxxxxxxxxxxx                            +   15 s14       xxxxxxxxxxxxxxx                           +   16 s15       xxxxxxxxxxxxxxxx                          +   17 s16       xxxxxxxxxxxxxxxxx                         +   18 s17       xxxxxxxxxxxxxxxxxx                        +   19 s18       xxxxxxxxxxxxxxxxxxx                       +   20 s19       xxxxxxxxxxxxxxxxxxxx                      +   21 s20       xxxxxxxxxxxxxxxxxxxxx                    ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▎ +   22 s21       xxxxxxxxxxxxxxxxxxxxxx                   ▔▎ +   23 s22       xxxxxxxxxxxxxxxxxxxxxxx                  Auto column width: ON +   24 s23       xxxxxxxxxxxxxxxxxxxxxxxx                  +   25 s24       xxxxxxxxxxxxxxxxxxxxxxxxx                 Median                                            50.5  +   26 s25       xxxxxxxxxxxxxxxxxxxxxxxxxx                +   27 s26       xxxxxxxxxxxxxxxxxxxxxxxxxxx              Auto column width: OFF +▁▎  f Filter rows  / Search  b Add/Del Bookmark  x Compute Expressions...  c Columns...  r Toggle Row Detail  s^p palette