diff --git a/pymilvus/client/grpc_handler.py b/pymilvus/client/grpc_handler.py index d40a8bc6d..d16da39a3 100644 --- a/pymilvus/client/grpc_handler.py +++ b/pymilvus/client/grpc_handler.py @@ -578,6 +578,11 @@ def _prepare_row_insert_request( schema_timestamp=schema_timestamp, ) + def get_schema_from_cache_or_remote( + self, collection_name: str, schema: Optional[dict] = None, timeout: Optional[float] = None + ): + return self._get_schema_from_cache_or_remote(collection_name, schema, timeout) + def _get_schema_from_cache_or_remote( self, collection_name: str, schema: Optional[dict] = None, timeout: Optional[float] = None ): diff --git a/pymilvus/milvus_client/milvus_client.py b/pymilvus/milvus_client/milvus_client.py index d0aa176cf..c4e84c340 100644 --- a/pymilvus/milvus_client/milvus_client.py +++ b/pymilvus/milvus_client/milvus_client.py @@ -710,7 +710,7 @@ def get( conn = self._get_connection() try: - schema_dict = conn.describe_collection(collection_name, timeout=timeout, **kwargs) + schema_dict, _ = conn.get_schema_from_cache_or_remote(collection_name, timeout=timeout) except Exception as ex: logger.error("Failed to describe collection: %s", collection_name) raise ex from ex @@ -796,7 +796,9 @@ def delete( conn = self._get_connection() if len(pks) > 0: try: - schema_dict = conn.describe_collection(collection_name, timeout=timeout, **kwargs) + schema_dict, _ = conn.get_schema_from_cache_or_remote( + collection_name, timeout=timeout + ) except Exception as ex: logger.error("Failed to describe collection: %s", collection_name) raise ex from ex