diff --git a/qdrant_client/local/local_collection.py b/qdrant_client/local/local_collection.py index 314763a1..dedd6a12 100644 --- a/qdrant_client/local/local_collection.py +++ b/qdrant_client/local/local_collection.py @@ -2195,7 +2195,7 @@ def upsert(self, points: Union[Sequence[models.PointStruct], models.Batch]) -> N "Consider using Qdrant in Docker or Qdrant Cloud for better performance with large datasets.", category=UserWarning, idx="large-local-collection", - stacklevel=4, + stacklevel=6, ) def _update_named_vectors( diff --git a/qdrant_client/local/qdrant_local.py b/qdrant_client/local/qdrant_local.py index d020f505..9dae08c0 100644 --- a/qdrant_client/local/qdrant_local.py +++ b/qdrant_client/local/qdrant_local.py @@ -81,7 +81,7 @@ def close(self, **kwargs: Any) -> None: message=f"Collection appears to be None before closing. The existing collections are: " f"{list(self.collections.keys())}", category=UserWarning, - stacklevel=1, + stacklevel=5, ) try: @@ -121,7 +121,7 @@ def _load(self) -> None: "with large datasets.", category=UserWarning, idx="large-local-collection", - stacklevel=4, + stacklevel=6, ) self.aliases = meta["aliases"] @@ -1140,7 +1140,7 @@ def create_payload_index( message="Payload indexes have no effect in the local Qdrant. Please use server Qdrant if you need payload indexes.", category=UserWarning, idx="server-payload-indexes", - stacklevel=1, + stacklevel=5, ) return self._default_update_result() @@ -1151,7 +1151,7 @@ def delete_payload_index( message="Payload indexes have no effect in the local Qdrant. Please use server Qdrant if you need payload indexes.", category=UserWarning, idx="server-payload-indexes", - stacklevel=1, + stacklevel=5, ) return self._default_update_result() diff --git a/qdrant_client/qdrant_remote.py b/qdrant_client/qdrant_remote.py index 9cd86397..25487008 100644 --- a/qdrant_client/qdrant_remote.py +++ b/qdrant_client/qdrant_remote.py @@ -131,7 +131,7 @@ def __init__( show_warning( message="Api key is used with an insecure connection.", category=RuntimeWarning, - stacklevel=2, + stacklevel=4, ) # http2 = True @@ -177,7 +177,7 @@ def __init__( show_warning( message="Auth token provider is used with an insecure connection.", category=RuntimeWarning, - stacklevel=2, + stacklevel=4, ) bearer_auth = BearerAuth(self._auth_token_provider) @@ -214,7 +214,7 @@ def close(self, grpc_grace: Optional[float] = None, **kwargs: Any) -> None: show_warning( message="Unable to close grpc_channel. Connection was interrupted on the server side", category=RuntimeWarning, - stacklevel=2, + stacklevel=4, ) if hasattr(self, "_aio_grpc_channel") and self._aio_grpc_channel is not None: @@ -225,7 +225,7 @@ def close(self, grpc_grace: Optional[float] = None, **kwargs: Any) -> None: show_warning( message="Unable to close aio_grpc_channel. Connection was interrupted on the server side", category=RuntimeWarning, - stacklevel=2, + stacklevel=4, ) except RuntimeError: pass @@ -236,7 +236,7 @@ def close(self, grpc_grace: Optional[float] = None, **kwargs: Any) -> None: show_warning( message="Unable to close http connection. Connection was interrupted on the server side", category=RuntimeWarning, - stacklevel=2, + stacklevel=4, ) self._closed = True @@ -2780,7 +2780,7 @@ def create_collection( ) -> bool: if init_from is not None: show_warning( - message="init_from is deprecated", category=DeprecationWarning, stacklevel=2 + message="init_from is deprecated", category=DeprecationWarning, stacklevel=4 ) if self._prefer_grpc: @@ -3064,7 +3064,7 @@ def create_payload_index( show_warning( message="field_type is deprecated, use field_schema instead", category=DeprecationWarning, - stacklevel=2, + stacklevel=4, ) field_schema = field_type