cloud-custodian / cloud-custodian/cel-python

type coercion inconsistently fails depending on order of arguments

Ouverte
#114 2 commentaires 0 réactions 1 personne assignée Réclamée par @klarose Voir sur GitHub
bug
Langage dominant
Python
Étoiles
174
Forks
40
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.