deephaven-core icon indicating copy to clipboard operation
deephaven-core copied to clipboard

QueryScope May Overwrite NULL Constants Causing Permanent Compilation Errors

Open nbauernfeind opened this issue 1 year ago • 0 comments

For example:

from deephaven import new_table
from deephaven.column import float_col
from deephaven.constants import NULL_FLOAT # <-- IF I IMPORT THIS IT WONT WORK, OTHERWISE IT DOES

my_table = (
    new_table([float_col("MyFloat", [0, 1, 2, 3])])
    .update(["MyFloat = (MyFloat == 0) ? null : MyFloat"])
)

To work around, import the constant with a rename:

from deephaven.constants import NULL_FLOAT as DH_NULL_FLOAT

Fails due to the conversion of null to NULL_FLOAT within the QLP and now NULL_FLOAT is resolving as a query scope variable (which it should never do).

You can also trip it up with a variable such as NULL_FLOAT = "a".

I would expect the QLP to never resolve the special NULL values as variables.

nbauernfeind avatar Oct 03 '24 21:10 nbauernfeind