matrixone-python-sdk 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- matrixone/async_vector_index_manager.py +3 -1
- matrixone/client.py +20 -1
- matrixone/sqlalchemy_ext/vector_index.py +28 -0
- {matrixone_python_sdk-0.1.1.dist-info → matrixone_python_sdk-0.1.2.dist-info}/METADATA +1 -1
- {matrixone_python_sdk-0.1.1.dist-info → matrixone_python_sdk-0.1.2.dist-info}/RECORD +9 -9
- {matrixone_python_sdk-0.1.1.dist-info → matrixone_python_sdk-0.1.2.dist-info}/WHEEL +0 -0
- {matrixone_python_sdk-0.1.1.dist-info → matrixone_python_sdk-0.1.2.dist-info}/entry_points.txt +0 -0
- {matrixone_python_sdk-0.1.1.dist-info → matrixone_python_sdk-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {matrixone_python_sdk-0.1.1.dist-info → matrixone_python_sdk-0.1.2.dist-info}/top_level.txt +0 -0
@@ -395,7 +395,9 @@ class AsyncVectorManager:
|
|
395
395
|
|
396
396
|
# Convert distance type to enum
|
397
397
|
if distance_type == "l2":
|
398
|
-
distance_func = DistanceFunction.
|
398
|
+
distance_func = DistanceFunction.L2 # Use L2 for consistency with ORM l2_distance()
|
399
|
+
elif distance_type == "l2_sq":
|
400
|
+
distance_func = DistanceFunction.L2_SQ # Explicitly use squared distance if needed
|
399
401
|
elif distance_type == "cosine":
|
400
402
|
distance_func = DistanceFunction.COSINE
|
401
403
|
elif distance_type == "inner_product":
|
matrixone/client.py
CHANGED
@@ -3632,6 +3632,12 @@ class VectorManager:
|
|
3632
3632
|
if not success:
|
3633
3633
|
raise Exception(f"Failed to create IVFFLAT vector index {name} on table {table_name}")
|
3634
3634
|
|
3635
|
+
# Add summary log
|
3636
|
+
op_type_str = op_type.value if hasattr(op_type, 'value') else op_type
|
3637
|
+
self.client.logger.info(
|
3638
|
+
f"✓ Created IVF index '{name}' on {table_name}.{column} | " f"lists={lists} | op_type={op_type_str}"
|
3639
|
+
)
|
3640
|
+
|
3635
3641
|
return self
|
3636
3642
|
|
3637
3643
|
def create_hnsw(
|
@@ -3685,6 +3691,7 @@ class VectorManager:
|
|
3685
3691
|
if op_type is None:
|
3686
3692
|
op_type = VectorOpType.VECTOR_L2_OPS
|
3687
3693
|
|
3694
|
+
# Build index creation SQL
|
3688
3695
|
success = HnswVectorIndex.create_index(
|
3689
3696
|
engine=self.client.get_sqlalchemy_engine(),
|
3690
3697
|
table_name=table_name,
|
@@ -3699,6 +3706,13 @@ class VectorManager:
|
|
3699
3706
|
if not success:
|
3700
3707
|
raise Exception(f"Failed to create HNSW vector index {name} on table {table_name}")
|
3701
3708
|
|
3709
|
+
# Add summary log
|
3710
|
+
op_type_str = op_type.value if hasattr(op_type, 'value') else op_type
|
3711
|
+
self.client.logger.info(
|
3712
|
+
f"✓ Created HNSW index '{name}' on {table_name}.{column} | "
|
3713
|
+
f"m={m} | ef_construction={ef_construction} | ef_search={ef_search} | op_type={op_type_str}"
|
3714
|
+
)
|
3715
|
+
|
3702
3716
|
return self
|
3703
3717
|
|
3704
3718
|
def create_ivf_in_transaction(
|
@@ -3838,6 +3852,9 @@ class VectorManager:
|
|
3838
3852
|
if not success:
|
3839
3853
|
raise Exception(f"Failed to drop vector index {name} from table {table_name}")
|
3840
3854
|
|
3855
|
+
# Add summary log
|
3856
|
+
self.client.logger.info(f"✓ Dropped vector index '{name}' from {table_name}")
|
3857
|
+
|
3841
3858
|
return self
|
3842
3859
|
|
3843
3860
|
def enable_ivf(self, probe_limit: int = 1) -> "VectorManager":
|
@@ -4051,7 +4068,9 @@ class VectorManager:
|
|
4051
4068
|
|
4052
4069
|
# Convert distance type to enum
|
4053
4070
|
if distance_type == "l2":
|
4054
|
-
distance_func = DistanceFunction.
|
4071
|
+
distance_func = DistanceFunction.L2 # Use L2 for consistency with ORM l2_distance()
|
4072
|
+
elif distance_type == "l2_sq":
|
4073
|
+
distance_func = DistanceFunction.L2_SQ # Explicitly use squared distance if needed
|
4055
4074
|
elif distance_type == "cosine":
|
4056
4075
|
distance_func = DistanceFunction.COSINE
|
4057
4076
|
elif distance_type == "inner_product":
|
@@ -247,7 +247,21 @@ class IVFVectorIndex(Index):
|
|
247
247
|
# Enable IVF indexing
|
248
248
|
_exec_sql_safe(conn, "SET experimental_ivf_index = 1")
|
249
249
|
_exec_sql_safe(conn, "SET probe_limit = 1")
|
250
|
+
|
251
|
+
# Execute CREATE INDEX
|
250
252
|
_exec_sql_safe(conn, sql)
|
253
|
+
|
254
|
+
# Try to log using the connection's info attribute if available
|
255
|
+
try:
|
256
|
+
from ..client import logger
|
257
|
+
|
258
|
+
logger.info(
|
259
|
+
f"✓ | CREATE INDEX {name} USING ivfflat ON {table_name}({column}) "
|
260
|
+
f"LISTS {lists} op_type '{op_type}'"
|
261
|
+
)
|
262
|
+
except Exception:
|
263
|
+
pass # Silently skip logging if not available (for tests)
|
264
|
+
|
251
265
|
return True
|
252
266
|
except Exception as e:
|
253
267
|
print(f"Failed to create IVFFLAT vector index: {e}")
|
@@ -648,7 +662,21 @@ class HnswVectorIndex(Index):
|
|
648
662
|
with engine.begin() as conn:
|
649
663
|
# Enable HNSW indexing
|
650
664
|
_exec_sql_safe(conn, "SET experimental_hnsw_index = 1")
|
665
|
+
|
666
|
+
# Execute CREATE INDEX
|
651
667
|
_exec_sql_safe(conn, sql)
|
668
|
+
|
669
|
+
# Try to log using the connection's info attribute if available
|
670
|
+
try:
|
671
|
+
from ..client import logger
|
672
|
+
|
673
|
+
logger.info(
|
674
|
+
f"✓ | CREATE INDEX {name} USING hnsw ON {table_name}({column}) "
|
675
|
+
f"M {m} EF_CONSTRUCTION {ef_construction} EF_SEARCH {ef_search} op_type '{op_type}'"
|
676
|
+
)
|
677
|
+
except Exception:
|
678
|
+
pass # Silently skip logging if not available (for tests)
|
679
|
+
|
652
680
|
return True
|
653
681
|
except Exception as e:
|
654
682
|
print(f"Failed to create HNSW vector index: {e}")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: matrixone-python-sdk
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.2
|
4
4
|
Summary: A comprehensive Python SDK for MatrixOne database operations with vector search, fulltext search, and advanced features
|
5
5
|
Home-page: https://github.com/matrixorigin/matrixone
|
6
6
|
Author: MatrixOne Team
|
@@ -3,9 +3,9 @@ matrixone/account.py,sha256=0r9xLNTiUfXa3xWZQUhEJ_uUcNp_gja-YulOR5iYDU4,24712
|
|
3
3
|
matrixone/async_client.py,sha256=krF9xtn_aGS45VcShV5eYy89FHk0mCI9Ig-8RufBJmY,151518
|
4
4
|
matrixone/async_metadata_manager.py,sha256=7k5qtQbKO-52IXzhDN0qhvYdp5wars5M6ZjdSLfD8RM,10230
|
5
5
|
matrixone/async_orm.py,sha256=O4Rf85MnZg0_fuLvbHGfOPrHI2OLznYwLk9eam5J5ik,4864
|
6
|
-
matrixone/async_vector_index_manager.py,sha256=
|
6
|
+
matrixone/async_vector_index_manager.py,sha256=fVnS00zgbUXw4YmZR-wRCzm541n30TLlmXXmXV34ELU,23134
|
7
7
|
matrixone/base_client.py,sha256=PUhq0c7Si9OIk83B4ZZ73ozwaHDRZ1zi0Q94YixseqY,6952
|
8
|
-
matrixone/client.py,sha256=
|
8
|
+
matrixone/client.py,sha256=XWEXEq8FlMfAJ4O4qbnriy2S7qmYGmpLeWe37HHrzg0,183615
|
9
9
|
matrixone/config.py,sha256=jrm1rLBhLWrX3dVdPx67sFaZ_9M8Vj4hImVrAmFaYbw,13917
|
10
10
|
matrixone/connection_hooks.py,sha256=kjv0HMCUZkma-9nTndNBV66NVcp4cTWs-8u5b6KCj2E,13530
|
11
11
|
matrixone/exceptions.py,sha256=oUQUY_TD8UTSzZzbwGdUgQ0kFJIYZq5Fx-vFsMaOfvw,1787
|
@@ -28,9 +28,9 @@ matrixone/sqlalchemy_ext/fulltext_search.py,sha256=1pCMxw9GyTjRhjsJ9KbKq_YsMEPuC
|
|
28
28
|
matrixone/sqlalchemy_ext/hnsw_config.py,sha256=5NYZXK1jsIKlSTrtqpv8n2V_yhbMsmOhItFrbmS5Vs4,5498
|
29
29
|
matrixone/sqlalchemy_ext/ivf_config.py,sha256=-esAijWMfyF1GUJivpZh-F4lvyKRmY8LYIzVgmMVtVo,6367
|
30
30
|
matrixone/sqlalchemy_ext/table_builder.py,sha256=JVritBPnCXZt0eJUivDrmGdlpaYO-uL7i2n24HiarEE,12870
|
31
|
-
matrixone/sqlalchemy_ext/vector_index.py,sha256=
|
31
|
+
matrixone/sqlalchemy_ext/vector_index.py,sha256=dasW3kT4f69io9y6DLQMarvf1FTbzh0UN-HALs0kBVs,55907
|
32
32
|
matrixone/sqlalchemy_ext/vector_type.py,sha256=HaOJ9dRdW_yrecD9qGUucW9bMfM3zCxbDC-0Ca32Kmk,30669
|
33
|
-
matrixone_python_sdk-0.1.
|
33
|
+
matrixone_python_sdk-0.1.2.dist-info/licenses/LICENSE,sha256=-PpUMwDyMyFlH9H7cnzkTh0Uo42tRvz43k7hnxe7G_I,11252
|
34
34
|
tests/__init__.py,sha256=odB22tIaJIHSwRhumhDlQYD6Fug_C0opWa07dSKkeQs,694
|
35
35
|
tests/offline/__init__.py,sha256=M13mz7gtVDS0_dJUW1EFyyiAGhEj282k3ia7eWA3dPs,703
|
36
36
|
tests/offline/conftest.py,sha256=Mz_NT6GBOxqSZsSCR2SXe1pkSpLGKT2-ssWNHhh9xOg,2494
|
@@ -115,8 +115,8 @@ tests/online/test_transaction_query_methods.py,sha256=VaPvHOYskwJVyM7lvVvBJ6Hqhd
|
|
115
115
|
tests/online/test_unified_filter_online.py,sha256=86JwEKUaBLNuLGJlR4E0zjzdWL5xVFyYLvyxbzkdEVI,21214
|
116
116
|
tests/online/test_vector_comprehensive.py,sha256=vmnwwVXLA7lUI_zSK3fJcf1HKx2AvrVDcUT0_d-gQwg,26980
|
117
117
|
tests/online/test_version_management.py,sha256=BU8Vc1fDKNCwhRliZi6XmEnd0HYdHuki9Xxi09vnriA,11416
|
118
|
-
matrixone_python_sdk-0.1.
|
119
|
-
matrixone_python_sdk-0.1.
|
120
|
-
matrixone_python_sdk-0.1.
|
121
|
-
matrixone_python_sdk-0.1.
|
122
|
-
matrixone_python_sdk-0.1.
|
118
|
+
matrixone_python_sdk-0.1.2.dist-info/METADATA,sha256=eZci5V6XBGdSXpvmVs7SNdkFcLWvRCx2Lh9F-xBiG2c,20815
|
119
|
+
matrixone_python_sdk-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
120
|
+
matrixone_python_sdk-0.1.2.dist-info/entry_points.txt,sha256=4wUGPC_7_f5ZDR33JRo1LZmmTuyfkYAv41_5H5Qy-Ik,138
|
121
|
+
matrixone_python_sdk-0.1.2.dist-info/top_level.txt,sha256=LQZabpBx_dtQk8JbKeH3MbjmC8HYDLE8UQeEf6NfQJA,16
|
122
|
+
matrixone_python_sdk-0.1.2.dist-info/RECORD,,
|
File without changes
|
{matrixone_python_sdk-0.1.1.dist-info → matrixone_python_sdk-0.1.2.dist-info}/entry_points.txt
RENAMED
File without changes
|
{matrixone_python_sdk-0.1.1.dist-info → matrixone_python_sdk-0.1.2.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|