From 3ac06e1f48a4599d05cdd010f4e844baa864a9bd Mon Sep 17 00:00:00 2001 From: "ekaterina.itsenko" Date: Thu, 20 Feb 2025 19:33:24 +0100 Subject: [PATCH] [pycharm] PY-79381 Tables(Jupyter, DataView): add repr to fix rendering GitOrigin-RevId: 8eb4fcea4985b505584c3dc15b8d7a90a4c2b694 --- python/helpers/pydev/_pydevd_bundle/tables/pydevd_dataset.py | 2 +- python/helpers/pydev/_pydevd_bundle/tables/pydevd_numpy.py | 2 +- .../helpers/pydev/_pydevd_bundle/tables/pydevd_numpy_based.py | 2 +- python/helpers/pydev/_pydevd_bundle/tables/pydevd_pandas.py | 2 +- python/helpers/pydev/_pydevd_bundle/tables/pydevd_polars.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_dataset.py b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_dataset.py index 90a8d4afe593..dff9057c7f1a 100644 --- a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_dataset.py +++ b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_dataset.py @@ -70,7 +70,7 @@ def display_data_csv(table, start_index, end_index): data = data.to_csv(na_rep = "NaN", sep=CSV_FORMAT_SEPARATOR, float_format=format) except AttributeError: pass - print(__convert_to_df(data)) + print(repr(__convert_to_df(data))) __compute_sliced_data(table, ipython_display, start_index, end_index) diff --git a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_numpy.py b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_numpy.py index ffce83dcc550..0e301eee6877 100644 --- a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_numpy.py +++ b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_numpy.py @@ -80,7 +80,7 @@ def display_data_html(table, start_index=None, end_index=None): def display_data_csv(table, start_index=None, end_index=None): # type: (np.ndarray, int, int) -> None def ipython_display(data, format): - print(__create_table(data, start_index, end_index).to_csv(na_rep ="None", sep=CSV_FORMAT_SEPARATOR, float_format=format)) + print(repr(__create_table(data, start_index, end_index).to_csv(na_rep ="None", sep=CSV_FORMAT_SEPARATOR, float_format=format))) __compute_data(table, ipython_display) diff --git a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_numpy_based.py b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_numpy_based.py index 5c032299bcff..30667f8b2f6c 100644 --- a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_numpy_based.py +++ b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_numpy_based.py @@ -91,7 +91,7 @@ def display_data_html(table, start_index=None, end_index=None): def display_data_csv(table, start_index=None, end_index=None): # type: (np.ndarray, int, int) -> None def ipython_display(data, format): - print(__create_table(data, start_index, end_index).to_csv(na_rep ="None", sep=CSV_FORMAT_SEPARATOR, float_format=format)) + print(repr(__create_table(data, start_index, end_index).to_csv(na_rep ="None", sep=CSV_FORMAT_SEPARATOR, float_format=format))) __compute_data(table, ipython_display) diff --git a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_pandas.py b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_pandas.py index b3458a7509e6..aa8969ff6b95 100644 --- a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_pandas.py +++ b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_pandas.py @@ -89,7 +89,7 @@ def display_data_csv(table, start_index, end_index): data = data.to_csv(na_rep = "NaN", sep=CSV_FORMAT_SEPARATOR, float_format=format) except AttributeError: pass - print(__convert_to_df(data)) + print(repr(__convert_to_df(data))) __compute_sliced_data(table, ipython_display, start_index, end_index) diff --git a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_polars.py b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_polars.py index 755ae52d7998..2f7b0229eb9a 100644 --- a/python/helpers/pydev/_pydevd_bundle/tables/pydevd_polars.py +++ b/python/helpers/pydev/_pydevd_bundle/tables/pydevd_polars.py @@ -72,7 +72,7 @@ def display_data_html(table, start_index, end_index): def display_data_csv(table, start_index, end_index): # type: (Union[pl.Series, pl.DataFrame], int, int) -> None with __create_config(): - print(__write_to_csv(__get_df_slice(table, start_index, end_index))) + print(repr(__write_to_csv(__get_df_slice(table, start_index, end_index)))) def get_column_descriptions(table):