You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@nbauernfeind reported this problem to me. This is what I have found after some some digging. I don't see a simple solution for use cases like this. One thing we can improve is to add to the docs the recommendation to always do type casting for Py functions that aren't return type hinted.
importrandomfromdeephavenimportempty_tableT=3t=empty_table(10).update(
formulas=["X = random.randint(1, 5)", "Y = X == T ? null : i"])
t1=empty_table(10).update(
formulas=["X = random.randint(1, 5)", "Y = X == 3 ? null : i"])
t2=empty_table(10).update(
formulas=["X = (int)random.randint(1, 5)", "Y = X == 3 ? null : i"])
@nbauernfeind reported this problem to me. This is what I have found after some some digging. I don't see a simple solution for use cases like this. One thing we can improve is to add to the docs the recommendation to always do type casting for Py functions that aren't return type hinted.
Generated formula code -
working case:
Why: The call to
random.randint
returns a Byte object and T is also resolved as a Byte object, which makes eq() happy.failure case:
cause: The call to
random.randint
returns a Byte object which fails the eq() test because 3 is parsed as an Integer.The text was updated successfully, but these errors were encountered: