Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into pysdk_1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ami11111 committed Sep 6, 2024
2 parents 2c6e42c + 2712aa9 commit f1d4ac5
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 4 deletions.
10 changes: 9 additions & 1 deletion example/delete_update_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'''

import infinity
import sys

try:
# open a local directory to store the data
Expand All @@ -39,6 +40,7 @@
})

# Insert 3 rows of data into the 'my_table'
print('about to insert data')
table_instance.insert(
[
{
Expand All @@ -61,9 +63,11 @@

result = table_instance.output(["num", "body"]).to_pl()
print(result)
print('about to delete data')
table_instance.delete("num = 2")
result = table_instance.output(["num", "body"]).to_pl()
print(result)
print('about to insert data again')
table_instance.insert([
{
"num": 2,
Expand All @@ -79,11 +83,15 @@
result = table_instance.output(["num", "body"]).to_pl()
print(result)

table_instance.update("num = 2", [{"body": "unnecessary and harmful", "vec": [14.0, 7.2, 0.8, 10.9]}])
print('about to update data')
table_instance.update("num = 2", {"body": "unnecessary and harmful", "vec": [14.0, 7.2, 0.8, 10.9]})
result = table_instance.output(["*"]).to_pl()
print(result)

infinity_instance.disconnect()
print('test done')
sys.exit(0)

except Exception as e:
print(str(e))
sys.exit(-1)
6 changes: 5 additions & 1 deletion example/export_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import infinity
import os
import sys

current_path = os.path.abspath(__file__)
project_directory = os.path.dirname(current_path)
Expand Down Expand Up @@ -115,6 +116,9 @@


infinity_instance.disconnect()
print('test done')
sys.exit(0)

except Exception as e:
print(str(e))
print(str(e))
sys.exit(-1)
5 changes: 4 additions & 1 deletion example/filter_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


import infinity
from infinity.common import ConflictType, LOCAL_HOST
import sys

try:
# Open a local directory to store the data
Expand Down Expand Up @@ -96,5 +96,8 @@
print(result)
infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
4 changes: 4 additions & 0 deletions example/fulltext_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""

import infinity
import sys

try:
# open a local directory to store the data
Expand Down Expand Up @@ -94,5 +95,8 @@

infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
4 changes: 4 additions & 0 deletions example/fulltext_search_zh.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""

import infinity
import sys

"""
Checkout https://github.com/infiniflow/resource.git under /var/infinity (defined by 'resource_dir' of config file). The jieba dict is
Expand Down Expand Up @@ -117,5 +118,8 @@

infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
4 changes: 4 additions & 0 deletions example/hybrid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import infinity
from infinity.common import SparseVector
import sys

try:
# open a local directory to store the data
Expand Down Expand Up @@ -113,5 +114,8 @@
print(result)
infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
4 changes: 4 additions & 0 deletions example/import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import infinity
import os
import sys

current_path = os.path.abspath(__file__)
project_directory = os.path.dirname(current_path)
Expand Down Expand Up @@ -50,5 +51,8 @@

infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
4 changes: 4 additions & 0 deletions example/list_db_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'''

import infinity
import sys

try:
# open a local directory to store the data
Expand Down Expand Up @@ -81,5 +82,8 @@

infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
4 changes: 4 additions & 0 deletions example/secondary_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import infinity
import time
import sys

from infinity import index

Expand Down Expand Up @@ -60,5 +61,8 @@

infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
4 changes: 4 additions & 0 deletions example/simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'''

import infinity
import sys

try:
# open a local directory to store the data
Expand Down Expand Up @@ -64,5 +65,8 @@

infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
4 changes: 4 additions & 0 deletions example/sparse_vector_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import infinity
from infinity.common import SparseVector
import sys

try:
# open a local directory to store the data
Expand Down Expand Up @@ -64,5 +65,8 @@
print(result)
infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
5 changes: 4 additions & 1 deletion example/tensor_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


import infinity
from infinity.common import ConflictType, LOCAL_HOST
import sys

try:
# Open a local directory to store the data
Expand Down Expand Up @@ -67,5 +67,8 @@
print(result)
infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)
4 changes: 4 additions & 0 deletions example/vector_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'''

import infinity
import sys

try:
# open a local directory to store the data
Expand Down Expand Up @@ -64,5 +65,8 @@
print(result)
infinity_instance.disconnect()

print('test done')
sys.exit(0)
except Exception as e:
print(str(e))
sys.exit(-1)

0 comments on commit f1d4ac5

Please sign in to comment.