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

protubuf comparisons #6650

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

protubuf comparisons #6650

wants to merge 4 commits into from

Conversation

xurui-c
Copy link
Member

@xurui-c xurui-c commented Dec 11, 2024

During the investigation of https://github.com/getsentry/eap-planning/issues/117, we realized that comparing protobuf objects containing floats does not run into floating point precision errors; however, extracting the floats fields out and comparing them does.

In test_single_float_comparison, we demonstrate that the value (0.123456) that we send to RPC is exactly the value we get back - no floating point precision errors

Copy link

codecov bot commented Dec 11, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2745 1 2744 5
View the top 1 failed tests by shortest run time
tests.web.rpc.v1.test_endpoint_trace_item_table.test_endpoint_trace_item_table.TestTraceItemTable::test_rounding
Stack Traces | 0.277s run time
Traceback (most recent call last):
  File ".../v1/test_endpoint_trace_item_table/test_endpoint_trace_item_table.py", line 1062, in test_rounding
    assert result.column_values[0].results[0].val_float == 0.475
AssertionError: assert 0.4749999940395355 == 0.475
 +  where 0.4749999940395355 = val_float: 0.475\n.val_float

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@xurui-c xurui-c changed the title c protubuf comparisons Dec 11, 2024
@xurui-c xurui-c force-pushed the rachel/rounding branch 2 times, most recently from da05daa to 4243f36 Compare December 11, 2024 22:56
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.

1 participant