Skip to content

Commit

Permalink
Remove time travel params (#1635)
Browse files Browse the repository at this point in the history
Signed-off-by: Enwei Jiao <[email protected]>
  • Loading branch information
jiaoew1991 authored Aug 3, 2023
1 parent 11d0aa0 commit 7896d05
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 32 deletions.
5 changes: 0 additions & 5 deletions pymilvus/client/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions pymilvus/client/grpc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)

Expand Down Expand Up @@ -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:
Expand Down
8 changes: 1 addition & 7 deletions pymilvus/client/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
)
Expand Down Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions pymilvus/client/stub.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions pymilvus/orm/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions pymilvus/orm/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7896d05

Please sign in to comment.