Skip to content

Avro codec API cleanup#1269

Merged
plokhotnyuk merged 1 commit intozio:mainfrom
plokhotnyuk:main
Mar 25, 2026
Merged

Avro codec API cleanup#1269
plokhotnyuk merged 1 commit intozio:mainfrom
plokhotnyuk:main

Conversation

@plokhotnyuk
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 25, 2026 10:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cleans up the Avro codec API in schema-avro by renaming AvroBinaryCodec to AvroCodec and refactoring derivation logic in AvroFormat accordingly, with accompanying updates to tests, docs, and benchmarks.

Changes:

  • Replace AvroBinaryCodec with AvroCodec across the Avro module and update codec derivation in AvroFormat.
  • Update Avro-related tests/utilities and documentation to reference AvroCodec.
  • Update Avro benchmarks to use the renamed codec type.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
schema-avro/src/test/scala/zio/blocks/schema/avro/AvroTestUtils.scala Update test helpers to use AvroCodec and cache derived codecs by schema.
schema-avro/src/test/scala/zio/blocks/schema/avro/AvroFormatSpec.scala Update custom injected codecs in tests to implement AvroCodec.
schema-avro/src/main/scala/zio/blocks/schema/avro/AvroFormat.scala Switch Deriver from AvroBinaryCodec to AvroCodec and refactor record encoding/decoding dispatch.
schema-avro/src/main/scala/zio/blocks/schema/avro/AvroCodec.scala Rename/reshape the codec abstraction and companion codecs under AvroCodec.
docs/reference/formats.md Update format summary and schema generation text to reference AvroCodec.
docs/reference/codec.md Update the codec hierarchy diagram to reference AvroCodec.
benchmarks/src/main/scala/zio/blocks/schema/avro/AvroNestedRecordsBenchmark.scala Update benchmark type references to AvroCodec.
benchmarks/src/main/scala/zio/blocks/schema/avro/AvroListOfRecordsBenchmark.scala Update benchmark to AvroCodec (but currently introduces an import name conflict).
Comments suppressed due to low confidence (1)

schema-avro/src/main/scala/zio/blocks/schema/avro/AvroCodec.scala:35

  • AvroBinaryCodec was renamed/replaced with the public AvroCodec type, but the new public abstract class currently has no Scaladoc. To keep docs consistent with other codecs (e.g., JsonCodec), please add Scaladoc describing what AvroCodec does, how decodeUnsafe/encode relate to BinaryDecoder/BinaryEncoder, and include an example of deriving a codec via AvroFormat plus accessing avroSchema.

@plokhotnyuk plokhotnyuk merged commit b2fdaa2 into zio:main Mar 25, 2026
14 checks passed
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