mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
[pycharm] PY-77455 Tables(Jupyter, DataView): Add the correct separator
(cherry picked from commit 7d83ea766b39cc05cb2811aa3a2dd390aec9516b) IJ-MR-149724 GitOrigin-RevId: 14878906578828af11b06661729b9ea2f78d0db2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
04517028c6
commit
a537a9ddcf
@@ -5,6 +5,8 @@ TABLE_TYPE_NEXT_VALUE_SEPARATOR = '__pydev_table_column_type_val__'
|
|||||||
MAX_COLWIDTH_PYTHON_2 = 100000
|
MAX_COLWIDTH_PYTHON_2 = 100000
|
||||||
BATCH_SIZE = 10000
|
BATCH_SIZE = 10000
|
||||||
|
|
||||||
|
CSV_FORMAT_SEPARATOR = '~'
|
||||||
|
|
||||||
|
|
||||||
def get_type(table):
|
def get_type(table):
|
||||||
# type: (str) -> str
|
# type: (str) -> str
|
||||||
@@ -37,7 +39,7 @@ def get_data(table, use_csv_serialization, start_index=None, end_index=None, for
|
|||||||
# type: (datasets.arrow_dataset.Dataset, int, int) -> str
|
# type: (datasets.arrow_dataset.Dataset, int, int) -> str
|
||||||
|
|
||||||
def convert_data_to_csv(data):
|
def convert_data_to_csv(data):
|
||||||
return repr(data.to_csv(na_rep = "NaN", float_format=format))
|
return repr(data.to_csv(na_rep = "NaN", float_format=format, sep=CSV_FORMAT_SEPARATOR))
|
||||||
|
|
||||||
def convert_data_to_html(data):
|
def convert_data_to_html(data):
|
||||||
return repr(data.to_html(notebook=True))
|
return repr(data.to_html(notebook=True))
|
||||||
@@ -55,7 +57,7 @@ def display_data_csv(table, start_index, end_index):
|
|||||||
# type: (datasets.arrow_dataset.Dataset, int, int) -> None
|
# type: (datasets.arrow_dataset.Dataset, int, int) -> None
|
||||||
def ipython_display(data):
|
def ipython_display(data):
|
||||||
try:
|
try:
|
||||||
data = data.to_csv(na_rep = "NaN")
|
data = data.to_csv(na_rep = "NaN", sep=CSV_FORMAT_SEPARATOR)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
print(data)
|
print(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user