From 2d5ca9811074500e734fbfa184d603cd3d167bfe Mon Sep 17 00:00:00 2001 From: Enwei Jiao Date: Thu, 3 Aug 2023 14:10:44 +0800 Subject: [PATCH] Remove time travel params Signed-off-by: Enwei Jiao --- pymilvus/client/check.py | 5 ----- pymilvus/client/grpc_handler.py | 3 +-- pymilvus/client/prepare.py | 8 +------- pymilvus/client/stub.py | 6 ------ pymilvus/orm/collection.py | 6 ------ pymilvus/orm/partition.py | 6 ------ 6 files changed, 2 insertions(+), 32 deletions(-) diff --git a/pymilvus/client/check.py b/pymilvus/client/check.py index 3a4e3fdee..ae8321134 100644 --- a/pymilvus/client/check.py +++ b/pymilvus/client/check.py @@ -239,10 +239,6 @@ def is_legal_round_decimal(round_decimal: Any) -> bool: return isinstance(round_decimal, int) and -2 < round_decimal < 7 -def is_legal_travel_timestamp(ts: Any) -> bool: - return isinstance(ts, int) and ts >= 0 - - def is_legal_guarantee_timestamp(ts: Any) -> bool: return ts is None or isinstance(ts, int) and ts >= 0 @@ -317,7 +313,6 @@ def __init__(self) -> None: "search_data": is_legal_search_data, "output_fields": is_legal_output_fields, "round_decimal": is_legal_round_decimal, - "travel_timestamp": is_legal_travel_timestamp, "guarantee_timestamp": is_legal_guarantee_timestamp, "user": is_legal_user, "password": is_legal_password, diff --git a/pymilvus/client/grpc_handler.py b/pymilvus/client/grpc_handler.py index 70e141eac..6fc92d8b8 100644 --- a/pymilvus/client/grpc_handler.py +++ b/pymilvus/client/grpc_handler.py @@ -748,7 +748,6 @@ def search( search_data=data, partition_name_array=partition_names, output_fields=output_fields, - travel_timestamp=kwargs.get("travel_timestamp", 0), guarantee_timestamp=kwargs.get("guarantee_timestamp", None), ) @@ -1389,7 +1388,7 @@ def compact(self, collection_name: str, timeout: Optional[float] = None, **kwarg if response.status.error_code != 0: raise MilvusException(response.status.error_code, response.status.reason) - req = Prepare.manual_compaction(response.collectionID, 0) + req = Prepare.manual_compaction(response.collectionID) future = self._stub.ManualCompaction.future(req, timeout=timeout) response = future.result() if response.status.error_code != 0: diff --git a/pymilvus/client/prepare.py b/pymilvus/client/prepare.py index 6e034617c..58977704e 100644 --- a/pymilvus/client/prepare.py +++ b/pymilvus/client/prepare.py @@ -625,7 +625,6 @@ def dump(v: Dict): partition_names=partition_names, output_fields=output_fields, guarantee_timestamp=kwargs.get("guarantee_timestamp", 0), - travel_timestamp=kwargs.get("travel_timestamp", 0), use_default_consistency=use_default_consistency, consistency_level=kwargs.get("consistency_level", 0), nq=nq, @@ -820,7 +819,6 @@ def query_request( output_fields=output_fields, partition_names=partition_names, guarantee_timestamp=kwargs.get("guarantee_timestamp", 0), - travel_timestamp=kwargs.get("travel_timestamp", 0), use_default_consistency=use_default_consistency, consistency_level=kwargs.get("consistency_level", 0), ) @@ -862,16 +860,12 @@ def load_balance_request( ) @classmethod - def manual_compaction(cls, collection_id: int, timetravel: int): + def manual_compaction(cls, collection_id: int): if collection_id is None or not isinstance(collection_id, int): raise ParamError(message=f"collection_id value {collection_id} is illegal") - if timetravel is None or not isinstance(timetravel, int): - raise ParamError(message=f"timetravel value {timetravel} is illegal") - request = milvus_types.ManualCompactionRequest() request.collectionID = collection_id - request.timetravel = timetravel return request diff --git a/pymilvus/client/stub.py b/pymilvus/client/stub.py index 3f327e3f2..fb6a4de86 100644 --- a/pymilvus/client/stub.py +++ b/pymilvus/client/stub.py @@ -865,9 +865,6 @@ def search( * *graceful_time* (``int``) -- Only used in bounded consistency level. If graceful_time is set, PyMilvus will use current timestamp minus the graceful_time as the `guarantee_timestamp`. This option is 5s by default if not set. - * *travel_timestamp* (``int``) -- - Users can specify a timestamp in a search to get results based on a data view - at a specified point in time. :return: Query result. QueryResult is iterable and is a 2d-array-like class, the first dimension is the number of vectors to query (nq), the second dimension is the number of limit(topk). @@ -996,9 +993,6 @@ def query( * *graceful_time* (``int``) -- Only used in bounded consistency level. If graceful_time is set, PyMilvus will use current timestamp minus the graceful_time as the `guarantee_timestamp`. This option is 5s by default if not set. - * *travel_timestamp* (``int``) -- - Users can specify a timestamp in a search to get results based on a data view - at a specified point in time. :raises RpcError: If gRPC encounter an error :raises ParamError: If parameters are invalid diff --git a/pymilvus/orm/collection.py b/pymilvus/orm/collection.py index 792020868..c555dd252 100644 --- a/pymilvus/orm/collection.py +++ b/pymilvus/orm/collection.py @@ -723,9 +723,6 @@ def search( Note: only valid in Bounded consistency level - * *travel_timestamp* (``int``, optional) - A specific timestamp to get results based on a data view at. - Returns: SearchResult: Returns ``SearchResult`` if `_async` is False , otherwise ``SearchFuture`` @@ -868,9 +865,6 @@ def query( Note: only valid in Bounded consistency level - * *travel_timestamp* (``int``, optional) - A specific timestamp to get results based on a data view at. - * *offset* (``int``) Combined with limit to enable pagination diff --git a/pymilvus/orm/partition.py b/pymilvus/orm/partition.py index 669320fa3..95d11de48 100644 --- a/pymilvus/orm/partition.py +++ b/pymilvus/orm/partition.py @@ -457,9 +457,6 @@ def search( Note: only valid in Bounded consistency level - * *travel_timestamp* (``int``, optional) - A specific timestamp to get results based on a data view at. - Returns: SearchResult: Returns ``SearchResult`` if `_async` is False , otherwise ``SearchFuture`` @@ -562,9 +559,6 @@ def query( Note: only valid in Bounded consistency level - * *travel_timestamp* (``int``, optional) - A specific timestamp to get results based on a data view at. - * *offset* (``int``) Combined with limit to enable pagination