Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from cachetools import Cache, LRUCache, TTLCache
from httpx import Response

from confluent_kafka import version
from confluent_kafka.schema_registry.common.schema_registry_client import (
RegisteredSchema,
Schema,
Expand Down Expand Up @@ -479,6 +480,7 @@ async def send_request(
'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.
}

if self.bearer_auth_credentials_source:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from cachetools import Cache, LRUCache, TTLCache
from httpx import Response

from confluent_kafka import version
from confluent_kafka.schema_registry.common.schema_registry_client import (
RegisteredSchema,
Schema,
Expand Down Expand Up @@ -477,6 +478,7 @@ def send_request(self, url: str, method: str, body: Optional[dict] = None, query
'Content-Length': str(len(body_str)),
'Content-Type': "application/vnd.schemaregistry.v1+json",
'Confluent-Accept-Unknown-Properties': "true",
'Confluent-Client-Version': f"python/{version()}",
}

if self.bearer_auth_credentials_source:
Expand Down