Skip to content

fix(codecs): preserve logical types in generated Avro schema fixtures - #26000

Open
omwbennett wants to merge 1 commit into
vectordotdev:masterfrom
omwbennett:fix-avro-test-generation
Open

fix(codecs): preserve logical types in generated Avro schema fixtures#26000
omwbennett wants to merge 1 commit into
vectordotdev:masterfrom
omwbennett:fix-avro-test-generation

Conversation

@omwbennett

Copy link
Copy Markdown

Summary

The current Avro schema fixtures drop any schema metadata such as logicalType which makes it impossible to test the encoding/decoding of fields containing logical types e.g.

{
  "type": "int",
  "logicalType": "date"
}

To fix, serialize the schema with serde_json instead of canonical_form() to preserve the logical type annotations.

Vector configuration

N/A

How did you test this PR?

Re-ran cargo run --package codecs --bin generate-avro-fixtures and cargo test -p codecs avro passes.

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

@omwbennett
omwbennett requested a review from a team as a code owner August 2, 2026 08:13
@pront
pront enabled auto-merge August 3, 2026 18:24
@cose-datadog

cose-datadog Bot commented Aug 3, 2026

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 1 Pipeline job failed

Changelog | validate-changelog   View in Datadog   GitHub Actions

See error No changelog fragments detected. Add the 'no-changelog' label or add fragments to changelog.d/.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 636964f | Docs | Datadog PR Page | Give us feedback!

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.

2 participants