Skip to content

Commit

Permalink
Do not send any kwargs when getting server info
Browse files Browse the repository at this point in the history
  • Loading branch information
tellet-q committed Dec 6, 2024
1 parent fba60f7 commit df69478
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion qdrant_client/async_qdrant_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(
self._closed: bool = False
if check_compatibility:
client_version = importlib.metadata.version("qdrant-client")
server_version = get_server_version(self.rest_uri, **self._rest_args)
server_version = get_server_version(self.rest_uri)
if not is_versions_compatible(client_version, server_version):
warnings.warn(
f"Qdrant client version {client_version} is incompatible with server version {server_version}. Major versions should mathc and minor version difference must not exceed 1. Set check_version=False to skip version check."
Expand Down
9 changes: 3 additions & 6 deletions qdrant_client/common/version_check.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import logging
import warnings
from typing import Union, Any
from typing import Union
from collections import namedtuple

from qdrant_client.http import SyncApis, ApiClient

Version = namedtuple("Version", ["major", "minor", "rest"])


def get_server_version(rest_uri: str, **kwargs: Any) -> Union[str, None]:
def get_server_version(rest_uri: str) -> Union[str, None]:
try:
openapi_client: SyncApis[ApiClient] = SyncApis(
host=rest_uri,
**kwargs,
)
openapi_client: SyncApis[ApiClient] = SyncApis(host=rest_uri)
version_info = openapi_client.service_api.root()

try:
Expand Down
2 changes: 1 addition & 1 deletion qdrant_client/qdrant_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def __init__(

if check_compatibility:
client_version = importlib.metadata.version("qdrant-client")
server_version = get_server_version(self.rest_uri, **self._rest_args)
server_version = get_server_version(self.rest_uri)
if not is_versions_compatible(client_version, server_version):
warnings.warn(
f"Qdrant client version {client_version} is incompatible with server version {server_version}. Major versions should mathc and minor version difference must not exceed 1. Set check_version=False to skip version check."
Expand Down

0 comments on commit df69478

Please sign in to comment.