chore(dev): add generate-fixtures feature#1711
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 440297abba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| while value.is_nan() || value == -0.0 { | ||
| value = f64::arbitrary(g) % MAX_F64_SIZE; | ||
| } | ||
| (value * 10_000.0).round() / 10_000.0 |
There was a problem hiding this comment.
Recheck rounded float before returning
In generate-fixtures mode, the pre-filter only rejects NaN/zero before rounding, but (value * 10_000.0).round() / 10_000.0 can still produce signed zero from small negative inputs (for example -0.00001 rounds to -0.0). That means this path can emit the exact -0.0 representation the feature is intended to avoid for stable JSON/protobuf fixtures, so the result should be normalized or validated again after rounding.
Useful? React with 👍 / 👎.
Summary
This cfg-gates the following patch: https://github.com/vectordotdev/vector/blob/v0.54.0/lib/codecs/tests/data/native_encoding/vrl_generate_fixtures.patch
Change Type
Is this a breaking change?
How did you test this PR?
See the counterpart Vector PR
Does this PR include user facing changes?
our guidelines.
Checklist
run
dd-rust-license-tool writeand commit the changes. More details here.References