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

Getting "mismatched type to binary operator" for int64/int64 or float64/float/64 in 0.13 #561

Closed
mtslzr opened this issue May 18, 2016 · 5 comments

Comments

@mtslzr
Copy link

mtslzr commented May 18, 2016

Working a script for checking memory usage. We pull total and used (in bytes) from InfluxDB, so I need to generate the percent myself. In 0.12, I was able to do something akin to this, an example of usage being over 50%:

.info(lambda: float("used") / float("total") > 0.50)

Unfortunatley, since 0.13, damn near any combination of the above (using float or int) results in an error like this:

E! error evaluating expression: mismatched type to binary operator. got int64 > int64. see bool(), int(), float()

Still learning this, so my gut say it's something silly I'm missing, but I can't seem to figure it out.

And FWIW, I've managed to get similar errors for float64 > float64, int64 / int64 and int64 * int64.

@nathanielc
Copy link
Contributor

@mtslzr We significantly changed the implementation of lambda expressions in 0.13 so something like probably messed up somewhere. I'll take a look.

@nathanielc
Copy link
Contributor

@mtslzr I can't reproduce this locally, could you share a more complete example where you are getting this error? Thanks.

@nathanielc
Copy link
Contributor

@mtslzr I figured it out, and I am chasing down the bug now....

@yosiat
Copy link
Contributor

yosiat commented May 19, 2016

@nathanielc what's the bug? Sounds very weird bug..

@nathanielc
Copy link
Contributor

@yosiat I just posted the PR #567

Besides some refactoring of the error messages, it boiled down to isDynamicNode not checking binary nodes. See https://github.com/influxdata/kapacitor/pull/567/files#diff-9de6492423b4172b3853bd681fd787ae

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants