Skip to content

Support for schema id in header #1978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Support for schema id in header #1978

wants to merge 12 commits into from

Conversation

rayokota
Copy link
Member

@rayokota rayokota commented May 4, 2025

What

Checklist

  • Contains customer facing changes? Including API/behavior changes
  • Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required

References

JIRA:

Test & Review

Open questions / Follow-ups

@Copilot Copilot AI review requested due to automatic review settings May 4, 2025 02:57
@rayokota rayokota requested review from a team as code owners May 4, 2025 02:57
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copy link

@Copilot 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 adds support for including the schema ID (or GUID) in the message header as well as updates multiple tests and service‐side logic accordingly. Key changes include:

  • New serialization logic (via header_schema_id_serializer and dual_schema_id_deserializer) that uses a SchemaId object carrying both numeric and GUID values.
  • Updates to schema caching and lookup in SchemaRegistryClient to support GUID‐based queries.
  • New and updated test cases for schema ID/GUID in the header for protobuf, JSON, and Avro serdes.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

File Description
tests/schema_registry/*.py Test updates to exercise schema ID in header via new serializer configuration
src/confluent_kafka/schema_registry/serde.py New SchemaId class to handle both numeric ID and GUID conversions
src/confluent_kafka/schema_registry/schema_registry_client.py Changes in schema cache and registered schema functions to support GUID storage and lookup
src/confluent_kafka/schema_registry/init.py Addition of header_schema_id_serializer and related serializer/deserializer changes

@sonarqube-confluent

This comment has been minimized.

2 similar comments
@sonarqube-confluent

This comment has been minimized.

@sonarqube-confluent

This comment has been minimized.

@sonarqube-confluent
Copy link

Failed

  • 75.20% Coverage on New Code (is less than 80.00%)

Analysis Details

20 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 20 Code Smells

Coverage and Duplications

  • Coverage 75.20% Coverage (61.10% Estimated after merge)
  • Duplications No duplication information (1.00% Estimated after merge)

Project ID: confluent-kafka-python

View in SonarQube

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.

1 participant