fix:replace gopkg.in/yaml.v3 to fix float serialization issue#2687
fix:replace gopkg.in/yaml.v3 to fix float serialization issue#2687xhebox merged 3 commits intopingcap:masterfrom
Conversation
The original yaml.v3 serializes float 1 as "1" (without decimal point), which causes deserialization to infer it as integer type. This can lead to type mismatch errors for callers expecting float. Replace with fork that serializes float 1 as "1.0", preserving the float type during round-trip serialization.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2687 +/- ##
==========================================
- Coverage 42.37% 42.34% -0.03%
==========================================
Files 424 424
Lines 47043 47043
==========================================
- Hits 19932 19916 -16
- Misses 24425 24440 +15
- Partials 2686 2687 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ation fix Add a dedicated test to ensure the forked yaml.v3 correctly serializes float values with decimal points preserved (e.g., 1.0 -> "1.0" not "1"). This prevents type mismatch errors during YAML round-trip serialization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add test cases for 0.0 and 1000.1 float values - Verify values are correctly parsed as float64 - Use require.Contains for cleaner assertions - Remove unused bytes import
[LGTM Timeline notifier]Timeline:
|
The original yaml.v3 serializes float 1 as "1" (without decimal point), which causes deserialization to infer it as integer type. This can lead to type mismatch errors for callers expecting float.
Replace with fork that serializes float 1 as "1.0", preserving the float type during round-trip serialization.
What problem does this PR solve?
Fixes the float serialization issue where yaml.v3 serializes float values like 1.0 as 1 (without decimal point),
causing type inference issues during deserialization.
close #xxx
What is changed and how it works?
Replace gopkg.in/yaml.v3 with github.com/WizardWuuu/yaml (v3_decimal branch) which preserves float type during serialization by outputting 1.0 instead of 1.
Check List
Tests
Code changes
Side effects
Related changes
Release notes: