heavyai / rbc

Remote Backend Compiler
https://rbc.readthedocs.io
BSD 3-Clause "New" or "Revised" License
30 stars 10 forks source link

`if/else` not working with `TextEncodingNone` #487

Closed tupui closed 2 years ago

tupui commented 2 years ago

This is failing

@heavydb("string(double)")
def classify_slope(slope):
    if slope <= 5:
        res = TextEncodingNone("low")
    elif 5 < slope < 15:
        res = TextEncodingNone("med")
    else:
        res = TextEncodingNone("high")

    return res

This is working

@heavydb("string(double)")
def classify_slope(slope):
    if slope <= 5:
        res = TextEncodingNone("low")

    if 5 < slope < 15:
        res = TextEncodingNone("med")

    if slope >= 15:
        res = TextEncodingNone("high")

    return res