Open
Description
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:
- doing a thing in python
- hit an error
- convert to groovy (in an effort to debug, seeing if it is a python-only bug or also exists in groovy)
- miss some
[
and]
syntax to remove during the conversion - get an obfuscated error message
Steps to reproduce
In a groovy DnD console
t = db.historicalTable("LearnDeephaven", "StockTrades").where("Date=`2017-08-25`").update("Price=Last").sort("Timestamp")
myTrades = t.where("Exchange=`Nasdaq`").update("Price=Last")
j1 = myTrades.aj(t, "Timestamp=Timestamp", "PriceBeforeMyTrade=Price").view(["Sym", "Price", "PriceBeforeMyTrade", "Timestamp"])
Expected results
An error message indicating that there should not be an array input to the view
method. Items to potentially highlight:
- mention of the
view
method - mention of the actual string of params that doesn't match an overload (even if parsing of method isn't correct, echo-ing back whatever-it-was would help narrow it down)
- mention of the line number (separate ticket may address this missing line reference for error cases in groovy #3568)
Actual results
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)
at io.deephaven.api.TableOperations$view.call(null:-1)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
at io.deephaven.dynamic.Script_22.run(Script_22.groovy:44)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:427)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:461)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:436)
at io.deephaven.engine.util.GroovyDeephavenSession.evaluateCommand(GroovyDeephavenSession.java:206)
at io.deephaven.engine.util.GroovyDeephavenSession.lambda$evaluate$0(GroovyDeephavenSession.java:228)
at io.deephaven.util.locks.FunctionalLock.doLockedInterruptibly(FunctionalLock.java:50)
at io.deephaven.engine.util.GroovyDeephavenSession.evaluate(GroovyDeephavenSession.java:228)
at io.deephaven.engine.util.AbstractScriptSession.lambda$evaluateScript$1(AbstractScriptSession.java:145)
at io.deephaven.engine.context.ExecutionContext.lambda$apply$0(ExecutionContext.java:129)
at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:140)
at io.deephaven.engine.context.ExecutionContext.apply(ExecutionContext.java:128)
at io.deephaven.engine.util.AbstractScriptSession.evaluateScript(AbstractScriptSession.java:145)
at io.deephaven.engine.util.DelegatingScriptSession.evaluateScript(DelegatingScriptSession.java:87)
at io.deephaven.engine.util.ScriptSession.evaluateScript(ScriptSession.java:113)
at io.deephaven.server.console.ConsoleServiceGrpcImpl.lambda$executeCommand$7(ConsoleServiceGrpcImpl.java:168)
at io.deephaven.server.session.SessionState$ExportBuilder.lambda$submit$2(SessionState.java:1348)
at io.deephaven.server.session.SessionState$ExportObject.doExport(SessionState.java:891)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at io.deephaven.server.runner.DeephavenApiServerModule$ThreadFactory.lambda$newThread$0(DeephavenApiServerModule.java:162)
at java.lang.Thread.run(Thread.java:833)
Additional details and attachments
If we fix #3568 arguably the priority/need for this ticket to be addressed is greatly reduced.
Versions
- Deephaven: 0.21.1 DnD, 1.20230131.087 DHE and demo systems from https://controller.try-dh.demo.community.deephaven.io/
- OS: Mac (or NA - not running locally)
- Browser: Chrome 110.0.5481.177 (Official Build) (x86_64)
- Docker: NA - not running locally