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
cast integers outside of 32bits to float in StringifyValue #1443
Conversation
Refactored Integer class as well, as it caused circular imports |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1443 +/- ##
==========================================
- Coverage 79.60% 73.28% -6.32%
==========================================
Files 281 281
Lines 13976 13690 -286
==========================================
- Hits 11125 10033 -1092
- Misses 2851 3657 +806
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
Co-authored-by: Siddhant Sadangi <siddhant.sadangi@neptune.ai>
0f7ad72
# check if it's an integer outside 32bit range and cast it to float | ||
if isinstance(value, int) and (value > MAX_32_BIT_INT or value < MIN_32_BIT_INT): | ||
logger.info( | ||
"Value '%d' is outside the range of 32-bit integers ('%d' to '%d') and will be logged as float", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to cast it to float if we want to stringify it anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integers are not be stringified. This would serve like an additional functionality of stringify_unsupported - for unsupported types it will cast to string and for unsupported values (like ints outside of the range) it would cast those values to float
Before submitting checklist