Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting evaluation error for string type, int type comparison with None #48

Open
hraj6056 opened this issue Nov 10, 2023 · 1 comment
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@hraj6056
Copy link

Got an evaluation error ("found no matching overload for 'relation_eq' applied to '(<class 'celpy.celtypes.StringType'>, <class 'NoneType'>)'", <class 'TypeError'>, ("no such overload: StringType('temp') <class 'celpy.celtypes.StringType'> != None <class 'NoneType'>",))

all_positive = "record.fullname != null"
breaks = celpy.json_to_cel({'record': {'fullname': 'temp', 'overdraftProtection': False} })

ast = env.compile(all_positive)
prgm = env.program(ast)

try:
    result =prgm.evaluate(breaks)
    print(result)
except CELEvalError as ex:
    print('Got an evaluation error', ex)
except TypeError as ex:
    print('Got a type error')

Is there any hack or something to succesfully evaluate this as it is working in this CELPlayground which is built in go.

@kapilt
Copy link
Collaborator

kapilt commented Dec 22, 2023

I think just needs us to add the additional type comparisons against None, I don't have bandwidth on the moment for this, but pull requests welcome.

@slott56 slott56 added the bug Something isn't working label May 21, 2024
@slott56 slott56 self-assigned this May 21, 2024
@slott56 slott56 added this to the 0.3 release milestone May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants