-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix: Handle proper type conversion on sort nodes. #228
Conversation
…ncoding inconsistency
Codecov Report
@@ Coverage Diff @@
## develop #228 +/- ##
===========================================
- Coverage 57.95% 57.94% -0.01%
===========================================
Files 99 99
Lines 9636 9648 +12
===========================================
+ Hits 5585 5591 +6
- Misses 3426 3432 +6
Partials 625 625
|
@@ -87,6 +87,20 @@ func (e EncProperty) Decode() (core.CType, interface{}, error) { | |||
} | |||
val = stringArray | |||
} | |||
} else { // CBOR often encodes values typed as floats as ints | |||
switch e.Desc.Kind { | |||
case base.FieldKind_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.
not sure all these cases are needed - only uint64 is hit according to codecov - it would be wierd if it used int/unit, but int64 might be due to lack of negative number testing. Happy(ier?) for them all to stay in for now, but maybe (in an ideal world with lots of free time) we could revist this
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.
I know at the very least it uses int64 and uint64 depending on if its a negative number. Im pretty sure I can drop the other cases.
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.
Looks good - cheers for sorting this out, is a nice oddity to get rid of
* Handled CBOR encoding edge case * Fixed tests which manually casted results to uint64 due to previous encoding inconsistency
Closes #227.
This ensures that decoded values from the fetcher are consistent with respect to the float/int edge case of the CBOR encoding/decoding.