diff --git a/tests/python_client/chaos/scripts/hello_milvus.py b/tests/python_client/chaos/scripts/hello_milvus.py index 6db8c25272d546b3575c96a6c091b9df514fd380..a7198b1fb46555ea162b447c6715510fdd88aaba 100644 --- a/tests/python_client/chaos/scripts/hello_milvus.py +++ b/tests/python_client/chaos/scripts/hello_milvus.py @@ -11,7 +11,8 @@ import random - +import time +import argparse from pymilvus import ( connections, list_collections, FieldSchema, CollectionSchema, DataType, @@ -19,6 +20,7 @@ from pymilvus import ( ) TIMEOUT = 120 + def hello_milvus(host="127.0.0.1"): import time # create connection @@ -93,7 +95,6 @@ def hello_milvus(host="127.0.0.1"): # Get value of the random value field for search result print(hit, hit.entity.get("random_value")) - # query expr = "count in [2,4,6,8]" output_fields = ["count", "random_value"] @@ -104,14 +105,9 @@ def hello_milvus(host="127.0.0.1"): # collection.release() -import argparse - parser = argparse.ArgumentParser(description='host ip') parser.add_argument('--host', type=str, default='127.0.0.1', help='host ip') args = parser.parse_args() - # add time stamp -import time - print(f"\nStart time: {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))}") hello_milvus(args.host)