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

cast integers outside of 32bits to float in StringifyValue #1443

Merged
merged 8 commits into from Aug 29, 2023

Conversation

AleksanderWWW
Copy link
Contributor

@AleksanderWWW AleksanderWWW commented Aug 24, 2023

Before submitting checklist

  • Did you update the CHANGELOG? (not for test updates, internal changes/refactors or CI/CD setup)
  • Did you ask the docs owner to review all the user-facing changes?

@AleksanderWWW
Copy link
Contributor Author

Refactored Integer class as well, as it caused circular imports

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Patch coverage: 77.77% and project coverage change: -6.32% ⚠️

Comparison is base (bd1655b) 79.60% compared to head (0f7ad72) 73.28%.

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     
Flag Coverage Δ
e2e ?
e2e-management ?
e2e-s3 ?
e2e-s3-gcs ?
e2e-standard ?
macos 72.98% <77.77%> (-6.40%) ⬇️
py3.10 ?
py3.7 73.28% <77.77%> (-5.82%) ⬇️
py3.7.16 ?
py3.8 ?
py3.9 ?
ubuntu 73.14% <77.77%> (-6.28%) ⬇️
unit 73.28% <77.77%> (-0.59%) ⬇️
windows 72.43% <77.77%> (-6.98%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/neptune/internal/types/stringify_value.py 80.00% <60.00%> (-7.50%) ⬇️
src/neptune/attributes/atoms/integer.py 96.15% <100.00%> (+7.26%) ⬆️
src/neptune/constants.py 100.00% <100.00%> (ø)

... and 106 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

CHANGELOG.md Outdated Show resolved Hide resolved
AleksanderWWW and others added 3 commits August 24, 2023 16:44
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
Co-authored-by: Siddhant Sadangi <siddhant.sadangi@neptune.ai>
normandy7
normandy7 previously approved these changes Aug 24, 2023
# 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",
Copy link
Contributor

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?

Copy link
Contributor Author

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

@AleksanderWWW AleksanderWWW merged commit 1fdc141 into master Aug 29, 2023
4 checks passed
@AleksanderWWW AleksanderWWW deleted the aw/stringify-big-ints branch August 29, 2023 07:53
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

Successfully merging this pull request may close these issues.

None yet

4 participants