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

Bug: comparing list to null throws error #59

Open
shahargl opened this issue Apr 4, 2024 · 1 comment
Open

Bug: comparing list to null throws error #59

shahargl opened this issue Apr 4, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@shahargl
Copy link

shahargl commented Apr 4, 2024

Current behavior
running CEL queue == null on {'queue': None} raises

CELEvalError(*("found no matching overload for 'relation_eq' applied to '(<class 'celpy.celtypes.ListType'>, <class 'NoneType'>)'", <class 'TypeError'>, ("no such overload: ListType == <class 'NoneType'>",)), tree='queue ==  null')

Although in the spect it should return true - https://playcel.undistro.io/?content=H4sIAAAAAAAAA3WRTWsCQQyG%2F0o6PdiC1bvgQYpQim2lpUhhL3E3rgMzmWU%2BtCL%2B92am20%2FwNGGSPO%2Bb5KgajKgm6hLuyBPoAHErD3cpQk5JCG%2BzhwU4D%2FcvT4%2Bwcd5iHFVc8bFSWNcucQyVmgAnY04Vq6Gi985TCNqxkMdjWJGpnSWIrtBv5wtYGjy0Xnqbi4ql5O9f9oEs2pE81lHvSBjrWQhk1%2BYAnduL2QaId9o7tsQxs0XWOBkCBSAxeV0yex23n7rOWscw%2F3YHC%2BQ2YUtwJfrXo%2BykuLmBldeR4OCSL9Z%2BJoKtSPdFr4EKGD0hSCrHQTeUl%2FRrh8MzS%2Bwpy0yGwXPiQZlihybhGXFsUXOI%2F47Ug%2Bb9%2FLmvdsaQbE563EYIaDtDoTcWOu0x5%2FIVv04I02k5oTp9AKJvo6kVAgAA

@slott56
Copy link
Collaborator

slott56 commented May 21, 2024

Technically, None is raw Python. This isn't exactly the same thing has a CEL NullType instance.

We could raise a better exception for "raw" Python objects.

We could try to implicitly wrap raw Python objects in the most closely-associated CEL types.

@slott56 slott56 added documentation Improvements or additions to documentation enhancement New feature or request labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants