cloud-custodian / cloud-custodian/cel-python

type coercion inconsistently fails depending on order of arguments

Abierto
#114 2 comentarios 0 reacciones 1 asignado Reclamado por @klarose Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
174
Forks
40
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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 (<=, >, >=)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.