From 4e6303b96f7a9c8c9b558669b683e99608dc87f8 Mon Sep 17 00:00:00 2001 From: Anton Bragin Date: Wed, 14 Jun 2023 15:40:53 +0200 Subject: [PATCH] DS-5081 DS-5118 Polars display configuration added * No limits for number of columns being displayed * Long cell values are not truncated GitOrigin-RevId: ee4d6b4c9ddaf5a3921f814b05b11247082cdba8 --- .../pydev/_pydevd_bundle/tables/pydevd_polars.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_polars.py b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_polars.py index 0a9c32ef629f..f1f9179831d7 100644 --- a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_polars.py +++ b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_polars.py @@ -16,7 +16,8 @@ def get_shape(table): def get_head(table, max_cols): # type: (pl.DataFrame, int) -> str - return table.head()._repr_html_() + with __create_config(): + return table.head()._repr_html_() def get_column_types(table): @@ -30,10 +31,17 @@ def get_column_types(table): # used by pydevd, isDisplaySupported equals false def get_data(table, max_cols, max_colwidth, start_index=None, end_index=None): # type: (pl.DataFrame, int, int, int, int) -> str - return table[start_index:end_index]._repr_html_() + with __create_config(): + return table[start_index:end_index]._repr_html_() # used by DSTableCommands isDisplaySupported equals true def display_data(table, max_cols, max_colwidth, start, end): # type: (pl.DataFrame, int, int, int, int) -> None - print(table[start:end]._repr_html_()) + with __create_config(): + print(table[start:end]._repr_html_()) + + +def __create_config(): + # type: () -> pl.Config + return pl.Config(fmt_str_lengths=1000, set_tbl_cols=-1)