Skip to content

feat: implement ProtobufNative schema - #299

Merged
BewareMyPower merged 4 commits into
apache:mainfrom
BewareMyPower:bewaremypower/protobuf-native-schema
May 12, 2026
Merged

feat: implement ProtobufNative schema#299
BewareMyPower merged 4 commits into
apache:mainfrom
BewareMyPower:bewaremypower/protobuf-native-schema

Conversation

@BewareMyPower

Copy link
Copy Markdown
Contributor

fixes #294

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Implements support for Pulsar’s PROTOBUF_NATIVE schema type in the Python client, enabling producers/consumers to use native Protobuf binary encoding with a schema definition compatible with the Java client’s ProtobufNativeSchema.

Changes:

  • Add ProtobufNativeSchema implementation that builds a fileDescriptorSet-based schema definition and encodes/decodes using Protobuf binary.
  • Export SchemaType.PROTOBUF_NATIVE from the _pulsar extension and expose the new schema from pulsar.schema.
  • Add unit tests and CI install updates for protobuf-backed schema tests.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pulsar/schema/schema_protobuf.py Adds ProtobufNativeSchema implementation and schema definition construction from Protobuf descriptors.
pulsar/schema/__init__.py Exposes ProtobufNativeSchema from the schema package.
src/enums.cc Exports SchemaType.PROTOBUF_NATIVE into the Python bindings.
setup.py Adds a protobuf extra and reuses it from the functions extra.
tests/schema_test.py Adds brokerless unit tests for ProtobufNativeSchema and imports generated test messages.
tests/test_schema.proto Defines test Protobuf messages used by the new unit tests.
tests/test_schema_pb2.py Adds checked-in generated Protobuf Python code for the test messages.
.github/workflows/ci-pr-validation.yaml Installs wheel with [avro,protobuf] extras for CI unit tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_schema_pb2.py Outdated
Comment thread tests/test_schema_pb2.py Outdated
Comment thread tests/schema_test.py Outdated
Comment thread setup.py Outdated
@BewareMyPower BewareMyPower self-assigned this May 11, 2026
@BewareMyPower BewareMyPower added this to the 3.12.0 milestone May 11, 2026
@BewareMyPower
BewareMyPower merged commit 7e03a4d into apache:main May 12, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants