Open mofojed opened 2 weeks ago
I can't run the reproducer yet, but I notice that the literal does indeed seem to be missing single-quotes.
This works on DHE, from the irisapi/table_viewport.html page in the browser console run:
var wcd = c.getKnownConfigs().find(q => q.name === 'WebClientData')
var workspaceData = await wcd.getTable('workspaceData')
var timeValue = '1730469472641000000';
var timeColumn = workspaceData.findColumn('LastModifiedTime')
var timeFilter = timeColumn.filter().lessThan(dh.FilterValue.ofNumber(timeValue))
workspaceData.applyFilter([timeFilter])
I can't run the reproducer yet, but I notice that the literal does indeed seem to be missing single-quotes.
@rcaudy You need to start the server in Anonymous authentication mode for the snippet to work, I'm assuming you did not and that could be the source of your connection errors.
This is one of those "we got lucky" sorts of situations, and I'm going to investigate putting up a guardrail to make this failure more obvious, rather than let it seem like this is unexpectedly broken. Short version, comparing a date against a number means we're subject to JS's Number
limitations, where an exact match of a timestamp will usually fail, and range matches will be subtly off.
FilterValue.ofNumber will accept a String, but can't do a lot with it - the best it can do is parse it to a number and assume that the numeric type selected is correct. The assumption exists that if the type matters and you want a long or instant, you'll use LongWrapper or DateWrapper, otherwise you're going to get a Js Number.
Given a value like "1254898894896696881"
, this will be truncated to 1254898894896696800
, as JS Number is defined to be an IEEE 754 64bit float. If the row to match equals the first value, you may end up matching more/less than what is expected when the second value is sent to the server.
Instead, it is expected that FilterValue.ofNumber will be passed a dh.DateWrapper
instance - perhaps the actual value read from the column to be filtered against, or created using the DateWrapper.ofJsDate method. We might need more factory methods here, to take strings or LongWrappers and convert to dates?
Description
A clear and concise description of what the bug is.
Steps to reproduce
Expected results
Actual results
Error details in the server logs:
Additional details and attachments
If applicable, add any additional screenshots, logs, or other attachments to help explain your problem.
Versions Engine Version: 0.36.1 Web UI Version: 0.90.0 Java Version: 11.0.24 Barrage Version: 0.6.0 Browser Name: Chrome 129 OS Name: Linux @deephaven/js-plugin-plotly-express: 0.11.2 @deephaven/js-plugin-ui: 0.22.0