deephaven / deephaven-core

Deephaven Community Core
Other
249 stars 79 forks source link

catPlot freezes up when using language native arrays #1560

Open jakemulf opened 2 years ago

jakemulf commented 2 years ago

Description

The following Python code generates a simple category plot

from deephaven import Plot
from deephaven.TableTools import newTable, intCol, stringCol
source = newTable(
    stringCol("Categories", "A", "B", "C"),
    intCol("Values", 1, 3, 5)
)
result = Plot.catPlot("Categories Plot", source, "Categories", "Values")\
    .chartTitle("Categories And Values")\
    .show()

Our docs suggest that you can use native language arrays instead of Deephaven tables, so the following Python code should do the same thing. However it instead freezes up with no results

from deephaven import Plot
from numpy import array
categories = array(["A", "B", "C"], dtype=object)
values = array([1, 3, 5])
result = Plot.catPlot("Categories Plot", categories, values)\
    .chartTitle("Categories And Values")\
    .show()

This happens in Groovy as well, and for piePlot

Steps to reproduce

Described above

Expected results

Both code snippets should run with the same results

Actual results

The code snippet that uses arrays freezes up

Versions

niloc132 commented 2 years ago

This use case isn't supported in DHE either, though it should error out better than this. @mofojed is this a UI bug, or did the server stop sending "hey part of this figure doesnt make sense" errors?

jakemulf commented 2 years ago

Screen Shot 2021-11-12 at 11 32 33 AM

I don't see any errors in the server logs, and this is what the UI looks like

jakemulf commented 2 years ago

If this isn't a use case we plan to support I'll make sure to remove it from the docs

mofojed commented 2 years ago

There are errors in the browser logs (you can attach the UI logs by going to Export Logs on the right menu)

2021-11-12-113520_support_logs.zip

The UI never receives a request failed event, but there is a stack trace in the log from the API @niloc132

dh-core.js:21195 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getTableId')
    at Object.$tableForSeries (dh-core.js:21195)
    at JsFigure$9methodref$tableForSeries$Type.apply_144 [as apply_2] (dh-core.js:21443)
    at Object.lambda$3_5 (dh-core.js:35173)
    at Collectors$lambda$3$Type.accept_76 [as accept_0] (dh-core.js:35413)
    at Object.lambda$4_6 (dh-core.js:36231)
    at StreamImpl$lambda$4$Type.apply_214 [as apply_4] (dh-core.js:36640)
    at Object.lambda$5_7 (dh-core.js:36237)
    at StreamImpl$lambda$5$Type.accept_95 [as accept] (dh-core.js:36651)
    at Object.$lambda$0_19 (dh-core.js:36490)
    at StreamImpl$FilterSpliterator$lambda$0$Type.accept_89 [as accept] (dh-core.js:36518)
    at Object.$lambda$0_19 (dh-core.js:36490)
    at StreamImpl$FilterSpliterator$lambda$0$Type.accept_89 [as accept] (dh-core.js:36518)
    at Object.$consume (dh-core.js:34158)
    at Spliterators$ArraySpliterator.consume (dh-core.js:34168)
    at Object.$tryAdvance_2 (dh-core.js:34128)
    at Spliterators$ArraySpliterator.tryAdvance_2 [as tryAdvance] (dh-core.js:34176)
    at StreamImpl$1.tryAdvance_17 [as tryAdvance] (dh-core.js:36295)
    at StreamImpl$FilterSpliterator.tryAdvance_21 [as tryAdvance] (dh-core.js:36504)
    at StreamImpl$FilterSpliterator.tryAdvance_21 [as tryAdvance] (dh-core.js:36504)
    at Object.$forEachRemaining_5 (dh-core.js:33910)
    at StreamImpl$FilterSpliterator.forEachRemaining_19 [as forEachRemaining] (dh-core.js:34058)
    at Object.$reduce (dh-core.js:36198)
    at Object.$collect_1 (dh-core.js:36104)
    at Object.$updateSubscriptions (dh-core.js:21220)
    at Function.run_34 (dh-core.js:21370)
    at lambda (dh-core.js:148)
    at Function.onInvoke_158 (dh-core.js:23667)
    at lambda (dh-core.js:148)