Skip to content

Conversation

@fangnx
Copy link
Member

@fangnx fangnx commented Dec 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: https://confluentinc.atlassian.net/browse/DGS-22770

Test & Review

Open questions / Follow-ups

Copilot AI review requested due to automatic review settings December 4, 2025 15:30
@fangnx fangnx requested review from a team and MSeal as code owners December 4, 2025 15:30
@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 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 a Confluent-Client-Version header to all requests sent to Schema Registry to identify the Python client version being used.

Key Changes:

  • Import the version function from the confluent_kafka package
  • Add Confluent-Client-Version header with format python/{version()} to request headers

Reviewed changes

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

File Description
src/confluent_kafka/schema_registry/_sync/schema_registry_client.py Adds version import and Confluent-Client-Version header to synchronous Schema Registry client
src/confluent_kafka/schema_registry/_async/schema_registry_client.py Adds version import and Confluent-Client-Version header to asynchronous Schema Registry client

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

'Content-Length': str(len(body_str)),
'Content-Type': "application/vnd.schemaregistry.v1+json",
'Confluent-Accept-Unknown-Properties': "true",
'Confluent-Client-Version': f"python/{version()}"
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The version() function is called on every request. Consider caching the version string at the class or module level to avoid repeated function calls, especially if the version is unlikely to change during runtime.

Copilot uses AI. Check for mistakes.
'Content-Length': str(len(body_str)),
'Content-Type': "application/vnd.schemaregistry.v1+json",
'Confluent-Accept-Unknown-Properties': "true",
'Confluent-Client-Version': f"python/{version()}"
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

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

The version() function is called on every request. Consider caching the version string at the class or module level to avoid repeated function calls, especially if the version is unlikely to change during runtime.

Copilot uses AI. Check for mistakes.
@sonarqube-confluent
Copy link

@fangnx fangnx changed the title Add Confluent-Client-Version header to requests to SR Add Confluent-Client-Version header to requests to SR, Python client Dec 4, 2025
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