-
Notifications
You must be signed in to change notification settings - Fork 934
Add Confluent-Client-Version header to requests to SR, Python client #2148
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
base: master
Are you sure you want to change the base?
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this 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
versionfunction from theconfluent_kafkapackage - Add
Confluent-Client-Versionheader with formatpython/{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()}" |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
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.
| 'Content-Length': str(len(body_str)), | ||
| 'Content-Type': "application/vnd.schemaregistry.v1+json", | ||
| 'Confluent-Accept-Unknown-Properties': "true", | ||
| 'Confluent-Client-Version': f"python/{version()}" |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
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.
|




What
Checklist
References
JIRA: https://confluentinc.atlassian.net/browse/DGS-22770
Test & Review
Open questions / Follow-ups