cloud-custodian / cloud-custodian/cel-python

type coercion inconsistently fails depending on order of arguments

Aperta
#114 2 commenti 0 reazioni 1 assegnatario Rivendicata da @klarose Vedi su GitHub
bug
Lingua principale
Python
Stelle
174
Fork
40
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I was surprised to find that a less-than comparison failed between an integer and a float, since I thought I had seen it work earlier. Sure enough, it works if the left hand side is a float, but not if the left hand side is an int.

Example:

```
# good
python -m celpy -n '4.0 < 10'
true

# bad
python -m celpy -n '10 < 4.0'
ERROR: :1:1 found no matching overload for 'relation_lt' applied to '(, )'
| 10 < 4.0

```

Both of these work in golang, see [cel playground](https://playcel.undistro.io/?trk=products_details_guest_secondary_call_to_action&content=H4sIAAAAAAAAA6tWSk7NUbJSiskzNFCwUTDRM1DSUUpJLEn0zCsoLQFKKCt4pBalKmQWK5RkACmQqAJIHshUiHT09VHIL1LwCvb3U0jLL8pNLNGLyYvJAxqRm5%2BSCtQNMrwWAPRTd6tkAAAA)

I expect both statements to properly evaluate. This appears to affect a bunch of other operators (<=, >, >=)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.