PY-72210 DataView: improve speed of get_value_occurrences_count

1. Split additional computation for statistics and computation for visualizations
2. Computation for visualization is now called only by request

GitOrigin-RevId: d872fbd9ed5732633814228713acc734ee2043e5
This commit is contained in:
Natalia.Murycheva
2024-06-13 14:15:56 +02:00
committed by intellij-monorepo-bot
parent 39e19fc02c
commit 238ebb61de
2 changed files with 7 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ class TableCommandType:
DF_INFO = "DF_INFO"
SLICE = "SLICE"
DESCRIBE = "DF_DESCRIBE"
HISTOGRAM_DATA = "HISTOGRAM_DATA"
def is_error_on_eval(val):
@@ -49,10 +50,11 @@ def exec_table_command(init_command, command_type, start_index, end_index, f_glo
res.append(NEXT_VALUE_SEPARATOR)
res.append(table_provider.get_value_counts(table))
res.append(NEXT_VALUE_SEPARATOR)
elif command_type == TableCommandType.HISTOGRAM_DATA:
res.append(table_provider.get_value_occurrences_count(table))
res.append(NEXT_VALUE_SEPARATOR)
elif command_type == TableCommandType.SLICE:
res.append(table_provider.get_data(table, start_index, end_index))

View File

@@ -4,5 +4,8 @@ import com.intellij.openapi.util.IntellijInternalApi
@IntellijInternalApi
enum class TableCommandType {
DF_INFO, SLICE, DF_DESCRIBE
DF_INFO,
SLICE,
DF_DESCRIBE,
VISUALIZATION_DATA
}