Open rachelmbrubaker opened 1 year ago
In terms of the API itself, and "doing what you meant" (not "better feedback", which is what the issue is actually about):
java.lang.ClassCastException: class java.lang.String cannot be cast to class io.deephaven.api.Selectable (java.lang.String is in module java.base of loader 'bootstrap'; io.deephaven.api.Selectable is in unnamed module of loader 'app')
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at io.deephaven.engine.table.impl.select.SelectColumn.from(SelectColumn.java:35)
at io.deephaven.engine.table.impl.QueryTable.view(QueryTable.java:1350)
at io.deephaven.engine.table.impl.QueryTable.view(QueryTable.java:100)
This is pretty close to "the best that groovy/java can do here" - a List was passed to Table.view(Collection<? extends Selectable)
, which is totally allowed, but until we start walking the contents we can't see that it happened to be a List<String>
.
Table has another overload that takes Strings instead of Selectables, but it is declared as var-args, which is an array: Table.view(String...)
.
Groovy is very happy to leave things a bit fuzzy, which is sort of the point of it. One of its preferences is that a [...]
is a list rather than an array, since usually that's what you mean as a user. You can fix this error by telling groovy that this is an array, but I don't think we can tell it to assume this:
table.view(["Sym", "Price", "PriceBeforeMyTrade", "Timestamp"] as String[])
Description
Groovy with leftover python syntax has a painfully obfuscated error message. The use case is common... though potentially for internal users only (prod support), so pulling this issue out separately to allow for lower-priority triaging.
justification for frequent annoyance/inefficiency support/qa workflow:
[
and]
syntax to remove during the conversionSteps to reproduce In a groovy DnD console
Expected results
An error message indicating that there should not be an array input to the
view
method. Items to potentially highlight:view
methodActual results
Additional details and attachments
If we fix https://github.com/deephaven/deephaven-core/issues/3568 arguably the priority/need for this ticket to be addressed is greatly reduced.
Versions