cloud-custodian / cloud-custodian/cel-python

type coercion inconsistently fails depending on order of arguments

オープン
#114 コメント 2 件 リアクション 0 件 担当者 1 名 @klarose が担当を希望しています GitHub で見る
bug
主要言語
Python
スター
174
フォーク
40
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。