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

Support float64 in enum processor #8911

Merged
merged 1 commit into from Apr 13, 2021

Conversation

tuannh99
Copy link
Contributor

This adds float64 support to enum processor.

Required for all PRs:

  • Associated README.md updated.
  • Has appropriate unit tests.

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Feb 26, 2021
Copy link
Contributor

@telegraf-tiger telegraf-tiger bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤝 ✅ CLA has been signed. Thank you!

@srebhan
Copy link
Contributor

srebhan commented Feb 26, 2021

@tuannh99 while the code looks good I wonder what your use case is. As far as I get it you want to replace a float value with something else?
However, float values are notoriously difficult to compare and your are trying to convert a dense quantity into a categorical value which is ill-defined anyway without quantization.
To cut a long story short, please outline your use-case. If you really need this I would expect at least an option float_precision and maybe additionally float_rounding which can be floor, ceil and round at least...

@srebhan srebhan self-assigned this Feb 26, 2021
@srebhan
Copy link
Contributor

srebhan commented Mar 15, 2021

@tuannh99 any news on this?

@tuannh99
Copy link
Contributor Author

@srebhan I should have a commit to update this in a few.

@srebhan
Copy link
Contributor

srebhan commented Mar 18, 2021

@tuannh99 can you please comment on my concern above that trying to map a raw floating point value is very fragile and explain what your use-case is

@ssoroka
Copy link
Contributor

ssoroka commented Apr 13, 2021

This is fine as is. In a future PR we may want to expose the FormatFloat() precision argument, to give users the ability to control how precisely the floats are matched.

@ssoroka ssoroka merged commit 7cbde18 into influxdata:master Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants