matrixone-python-sdk 0.1.0__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_client.py CHANGED
@@ -1488,11 +1488,12 @@ class AsyncClient(BaseMatrixOneClient):
1488
1488
 
1489
1489
  async def connect(
1490
1490
  self,
1491
- host: str,
1492
- port: int,
1493
- user: str,
1494
- password: str,
1495
- database: str = None,
1491
+ *,
1492
+ host: str = "localhost",
1493
+ port: int = 6001,
1494
+ user: str = "root",
1495
+ password: str = "111",
1496
+ database: str,
1496
1497
  account: Optional[str] = None,
1497
1498
  role: Optional[str] = None,
1498
1499
  charset: str = "utf8mb4",
@@ -1573,8 +1574,12 @@ class AsyncClient(BaseMatrixOneClient):
1573
1574
 
1574
1575
  self.logger.log_connection(host, port, final_user, database or "default", success=True)
1575
1576
 
1576
- # Setup connection hook if provided
1577
- if on_connect:
1577
+ # Setup connection hook (default to ENABLE_ALL if not provided)
1578
+ # Allow empty list [] to explicitly disable hooks
1579
+ if on_connect is None:
1580
+ on_connect = [ConnectionAction.ENABLE_ALL]
1581
+
1582
+ if on_connect: # Only setup if not empty list
1578
1583
  self._setup_connection_hook(on_connect)
1579
1584
  # Execute the hook once immediately for the initial connection
1580
1585
  await self._execute_connection_hook_immediately(on_connect)
@@ -1582,7 +1587,18 @@ class AsyncClient(BaseMatrixOneClient):
1582
1587
  except Exception as e:
1583
1588
  self.logger.log_connection(host, port, final_user, database or "default", success=False)
1584
1589
  self.logger.log_error(e, context="Async connection")
1585
- raise ConnectionError(f"Failed to connect to MatrixOne: {e}")
1590
+
1591
+ # Provide user-friendly error messages for common issues
1592
+ error_msg = str(e)
1593
+ if 'Unknown database' in error_msg or '1049' in error_msg:
1594
+ db_name = database or "default"
1595
+ raise ConnectionError(
1596
+ f"Database '{db_name}' does not exist. Please create it first:\n"
1597
+ f" mysql -h{host} -P{port} -u{user.split('#')[0] if '#' in user else user} -p{password} "
1598
+ f"-e \"CREATE DATABASE {db_name}\""
1599
+ ) from e
1600
+ else:
1601
+ raise ConnectionError(f"Failed to connect to MatrixOne: {e}") from e
1586
1602
 
1587
1603
  def _setup_connection_hook(
1588
1604
  self, on_connect: Union[ConnectionHook, List[Union[ConnectionAction, str]], Callable]
@@ -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.L2_SQ
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
@@ -244,10 +244,11 @@ class Client(BaseMatrixOneClient):
244
244
 
245
245
  def connect(
246
246
  self,
247
- host: str,
248
- port: int,
249
- user: str,
250
- password: str,
247
+ *,
248
+ host: str = "localhost",
249
+ port: int = 6001,
250
+ user: str = "root",
251
+ password: str = "111",
251
252
  database: str,
252
253
  ssl_mode: str = "preferred",
253
254
  ssl_ca: Optional[str] = None,
@@ -345,8 +346,12 @@ class Client(BaseMatrixOneClient):
345
346
  except Exception as e:
346
347
  self.logger.warning(f"Failed to detect backend version: {e}")
347
348
 
348
- # Setup connection hook if provided
349
- if on_connect:
349
+ # Setup connection hook (default to ENABLE_ALL if not provided)
350
+ # Allow empty list [] to explicitly disable hooks
351
+ if on_connect is None:
352
+ on_connect = [ConnectionAction.ENABLE_ALL]
353
+
354
+ if on_connect: # Only setup if not empty list
350
355
  self._setup_connection_hook(on_connect)
351
356
  # Execute the hook once immediately for the initial connection
352
357
  self._execute_connection_hook_immediately(on_connect)
@@ -354,7 +359,17 @@ class Client(BaseMatrixOneClient):
354
359
  except Exception as e:
355
360
  self.logger.log_connection(host, port, final_user, database, success=False)
356
361
  self.logger.log_error(e, context="Connection")
357
- raise ConnectionError(f"Failed to connect to MatrixOne: {e}")
362
+
363
+ # Provide user-friendly error messages for common issues
364
+ error_msg = str(e)
365
+ if 'Unknown database' in error_msg or '1049' in error_msg:
366
+ raise ConnectionError(
367
+ f"Database '{database}' does not exist. Please create it first:\n"
368
+ f" mysql -h{host} -P{port} -u{user.split('#')[0] if '#' in user else user} -p{password} "
369
+ f"-e \"CREATE DATABASE {database}\""
370
+ ) from e
371
+ else:
372
+ raise ConnectionError(f"Failed to connect to MatrixOne: {e}") from e
358
373
 
359
374
  def _setup_connection_hook(
360
375
  self, on_connect: Union[ConnectionHook, List[Union[ConnectionAction, str]], Callable]
@@ -1686,7 +1701,25 @@ class Client(BaseMatrixOneClient):
1686
1701
  from .sqlalchemy_ext import FulltextIndex, VectorIndex
1687
1702
  from sqlalchemy.schema import CreateTable, CreateIndex
1688
1703
 
1689
- with self.get_sqlalchemy_engine().begin() as conn:
1704
+ try:
1705
+ engine_context = self.get_sqlalchemy_engine().begin()
1706
+ except Exception as e:
1707
+ # Handle database connection errors with user-friendly messages
1708
+ error_msg = str(e)
1709
+ if 'Unknown database' in error_msg or '1049' in error_msg:
1710
+ db_name = self._connection_params.get('database', 'unknown')
1711
+ raise ConnectionError(
1712
+ f"Database '{db_name}' does not exist. Please create it first:\n"
1713
+ f" mysql -h{self._connection_params.get('host', 'localhost')} "
1714
+ f"-P{self._connection_params.get('port', 6001)} "
1715
+ f"-u{self._connection_params.get('user', 'root')} "
1716
+ f"-p{self._connection_params.get('password', '***')} "
1717
+ f"-e \"CREATE DATABASE {db_name}\""
1718
+ ) from e
1719
+ else:
1720
+ raise ConnectionError(f"Failed to connect to database: {error_msg}") from e
1721
+
1722
+ with engine_context as conn:
1690
1723
  # Create table without indexes first
1691
1724
  # Build CREATE TABLE statement without indexes
1692
1725
  create_table_sql = str(CreateTable(table).compile(dialect=conn.dialect))
@@ -3599,6 +3632,12 @@ class VectorManager:
3599
3632
  if not success:
3600
3633
  raise Exception(f"Failed to create IVFFLAT vector index {name} on table {table_name}")
3601
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
+
3602
3641
  return self
3603
3642
 
3604
3643
  def create_hnsw(
@@ -3652,6 +3691,7 @@ class VectorManager:
3652
3691
  if op_type is None:
3653
3692
  op_type = VectorOpType.VECTOR_L2_OPS
3654
3693
 
3694
+ # Build index creation SQL
3655
3695
  success = HnswVectorIndex.create_index(
3656
3696
  engine=self.client.get_sqlalchemy_engine(),
3657
3697
  table_name=table_name,
@@ -3666,6 +3706,13 @@ class VectorManager:
3666
3706
  if not success:
3667
3707
  raise Exception(f"Failed to create HNSW vector index {name} on table {table_name}")
3668
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
+
3669
3716
  return self
3670
3717
 
3671
3718
  def create_ivf_in_transaction(
@@ -3805,6 +3852,9 @@ class VectorManager:
3805
3852
  if not success:
3806
3853
  raise Exception(f"Failed to drop vector index {name} from table {table_name}")
3807
3854
 
3855
+ # Add summary log
3856
+ self.client.logger.info(f"✓ Dropped vector index '{name}' from {table_name}")
3857
+
3808
3858
  return self
3809
3859
 
3810
3860
  def enable_ivf(self, probe_limit: int = 1) -> "VectorManager":
@@ -4018,7 +4068,9 @@ class VectorManager:
4018
4068
 
4019
4069
  # Convert distance type to enum
4020
4070
  if distance_type == "l2":
4021
- distance_func = DistanceFunction.L2_SQ
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
4022
4074
  elif distance_type == "cosine":
4023
4075
  distance_func = DistanceFunction.COSINE
4024
4076
  elif distance_type == "inner_product":
matrixone/restore.py CHANGED
@@ -204,7 +204,9 @@ class RestoreManager:
204
204
  result = self._client.execute(sql)
205
205
  return result is not None
206
206
  except Exception as e:
207
- raise RestoreError(f"Failed to restore database '{database_name}' from snapshot '{snapshot_name}': {e}") from None
207
+ raise RestoreError(
208
+ f"Failed to restore database '{database_name}' from snapshot '{snapshot_name}': {e}"
209
+ ) from None
208
210
 
209
211
  def restore_table(
210
212
  self,
@@ -323,7 +325,9 @@ class RestoreManager:
323
325
  )
324
326
  elif restore_type == "table":
325
327
  if not all([account_name, database_name, table_name]):
326
- raise RestoreError("Account name, database name, and table name are required for table restore") from None
328
+ raise RestoreError(
329
+ "Account name, database name, and table name are required for table restore"
330
+ ) from None
327
331
  if to_account:
328
332
  sql = (
329
333
  f"RESTORE ACCOUNT {self._client._escape_identifier(account_name)} "
@@ -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.0
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
@@ -185,6 +185,22 @@ print(f"MatrixOne version: {version}")
185
185
  client.disconnect()
186
186
  ```
187
187
 
188
+ > **📝 Connection Parameters**
189
+ >
190
+ > The `connect()` method requires **keyword arguments** (not positional):
191
+ > - `database` - **Required**, no default value
192
+ > - `host` - Default: `'localhost'`
193
+ > - `port` - Default: `6001`
194
+ > - `user` - Default: `'root'`
195
+ > - `password` - Default: `'111'`
196
+ >
197
+ > **Minimal connection** (uses all defaults):
198
+ > ```python
199
+ > client.connect(database='test')
200
+ > ```
201
+ >
202
+ > By default, all features (IVF, HNSW, fulltext) are automatically enabled via `on_connect=[ConnectionAction.ENABLE_ALL]`.
203
+
188
204
  ### Async Usage
189
205
 
190
206
  ```python
@@ -1,11 +1,11 @@
1
1
  matrixone/__init__.py,sha256=7bePzwzerZTiZIlbUT9zI_u4fp49DvQNcIqyiIvEVVs,3966
2
2
  matrixone/account.py,sha256=0r9xLNTiUfXa3xWZQUhEJ_uUcNp_gja-YulOR5iYDU4,24712
3
- matrixone/async_client.py,sha256=HeuUDJbABLi9O-4-2OF8oYW_fSvobcD8z-bKsQl0DO4,150693
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=i881732IV4shT4NqqLBbEW9_z7XYCNlaJgPitCyIkhM,22953
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=XkDphVnmoOyhISmOy0zz6ZhX7QVyW3Yq3Xp6qxTqHWU,180877
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
@@ -15,7 +15,7 @@ matrixone/moctl.py,sha256=rLt69ZlhIr_pCbyu8cImKgdR_YOGf85XvqCHcW12sc0,6714
15
15
  matrixone/orm.py,sha256=QWNdfJ067KcgWU-eB__vXwJuANBaDUeVVG7thFH5kiU,90473
16
16
  matrixone/pitr.py,sha256=NPsexPsJXIAiJTH3oMyFOwiXWjvfohPzWQyFHhQKh5k,21632
17
17
  matrixone/pubsub.py,sha256=ckaG6Z3IuEtcdwp11qvB88PrCDHYymocSOJ1v4TftzY,26893
18
- matrixone/restore.py,sha256=V6NbMcCQb5h2YONVNL_CCXtoqI-Vyl5Hp_lTzYAPVCY,15715
18
+ matrixone/restore.py,sha256=xAbsRUL-2hCk6YpuouVLbiwc3GwUNzCoIVEFtcmghkg,15791
19
19
  matrixone/search_vector_index.py,sha256=NjQpluaPcja66herm-OYq3nNeNAqY_-FGGL4SOBOWNA,46075
20
20
  matrixone/snapshot.py,sha256=cOatk26Z6Jt6aAdasOMejxxiv73S7Z2o2if_va20Ihg,18103
21
21
  matrixone/sql_builder.py,sha256=ZR9TpRkV4cN_RiDJQXMLwSzodpESyxAqV-TTIr--ZbY,29009
@@ -28,14 +28,14 @@ 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=UIWuU30HjWypyfq30UiqUJ078DoD7Q5HtD_7iWwjnb0,54832
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.0.dist-info/licenses/LICENSE,sha256=-PpUMwDyMyFlH9H7cnzkTh0Uo42tRvz43k7hnxe7G_I,11252
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
37
37
  tests/offline/test_account.py,sha256=uCHKPOBGiJrpEwXdyF2CoNoS5yqxuyKJgLTPMvKZQbk,26723
38
- tests/offline/test_async_client_query_comprehensive.py,sha256=ZS-HcaQmQFlF9_QjVYn4cgAS6Mg3ZDwguFxqDXpc_Ak,45356
38
+ tests/offline/test_async_client_query_comprehensive.py,sha256=HmLg8iYlD6l5K4lJN5VSXhJDtKGg17vym-9KaX6WDzY,45416
39
39
  tests/offline/test_basic.py,sha256=pVyPnidD5jIoC8_40U1iXND29399G-0O5e4itm-2uhc,1710
40
40
  tests/offline/test_case_sensitivity.py,sha256=aYlhA5F8RSlSy6wl3HWIrPylE3Z3eAUf4RWQohwD0eA,8715
41
41
  tests/offline/test_connection_hooks_offline.py,sha256=pMbkjiEdn5ShljuX8QZRVnsMQLbJxI43tfb0saohBRw,11678
@@ -75,12 +75,12 @@ tests/online/__init__.py,sha256=91rCeFIUZe6Ld-d4PonsoBc2rSHxPGlt6pYGSNsjyzY,692
75
75
  tests/online/conftest.py,sha256=1xOqAAFYsx9Io0e3m7DUQNX60B3sqvY98l8JhXY1CAA,7504
76
76
  tests/online/test_account_management.py,sha256=mWIF3kPaegcb-JEhHBM9LrSae2xZ3ppjkRefWEzzwH4,6929
77
77
  tests/online/test_advanced_features.py,sha256=f0oOe1bB6dT4bXZqx4LzrWd4ljwwcr9iIZLDHnTdPhU,13641
78
- tests/online/test_async_client_interfaces.py,sha256=jWVIoVGpzhziYzdohThtnio5Zv8DeAwrNppPHn5idBo,12262
79
- tests/online/test_async_client_online.py,sha256=g_BCdRlLFWF7XNFp0_EE0cTc_LpVAyfiDzA6oi9Z2oI,10873
78
+ tests/online/test_async_client_interfaces.py,sha256=ZT2kWm-ZT_O-_ZkGE7mVLE5c52_eRsbCC_wEksrUis0,12295
79
+ tests/online/test_async_client_online.py,sha256=LZp0QXk4l4FfuQOHNNg__degRTwh9K61StFtEmeUmZ8,10906
80
80
  tests/online/test_async_model_insert_online.py,sha256=YPlcNjuaeimvG355JjjgyZUPfa9J0HtC5FVJr9uIp_k,10857
81
- tests/online/test_async_orm_online.py,sha256=ed2y3PyvnWURC-O-lNnWXPVSrVZQu9VmZtNVSwlU_UY,10918
81
+ tests/online/test_async_orm_online.py,sha256=8wjQb9oXMyNh4HQ1YkwiFYfHo73_YVPicOR_aiXrbEg,11039
82
82
  tests/online/test_async_simple_query_online.py,sha256=nBMsCv-GaEiSRxh1juLNCiXNNsfUwWRApQvStzLeGr4,31021
83
- tests/online/test_async_transaction_simple_query.py,sha256=25z0GN2MiAFGEN3Q4xTEUeOgOkDoGswhgqqkE4FVDmU,11792
83
+ tests/online/test_async_transaction_simple_query.py,sha256=cLOH4C1fWW6vaCmBK33XjswQafxOMitMU0S4r-PAUxU,11825
84
84
  tests/online/test_basic_connection.py,sha256=rDukB2MN3Gy_yLCG9_lHtUCcfFoSdkABCTpLsdwJYWo,5010
85
85
  tests/online/test_client_online.py,sha256=w9ainOy0VnjSFOkGsSzrdB0jE-0wc87Hp4IqQTJS0OM,8716
86
86
  tests/online/test_config.py,sha256=YwghdNuw5VBXP99kxKwxO47-fn5Hv6tXmtRxCCUZQMs,3323
@@ -109,14 +109,14 @@ tests/online/test_simple_fulltext_online.py,sha256=gNHETrSZ9sXZENmI0YkJ1fTJm2cK9
109
109
  tests/online/test_snapshot_comprehensive.py,sha256=A8_Qvzxg5f6hkFF0tkESTyDQJSPsMX7nnBEsyY5Vmcc,40603
110
110
  tests/online/test_sqlalchemy_engine_integration.py,sha256=XmdgvkJc9TOzkCP4O_GBCTRBdjQ5RncYfuKkcuHqick,12096
111
111
  tests/online/test_sqlalchemy_integration.py,sha256=Za2s5Z55SxSAGdwTAfee2I7xoDuH6KLGSBGd-rsF_Wo,15439
112
- tests/online/test_transaction_contexts.py,sha256=adliTmahWdGuXgbrqZuH7yPGXaHMzh4txoTCpiCiwus,49663
113
- tests/online/test_transaction_insert_methods.py,sha256=lxBcNKTlpc_m_bJFu12bgiju-8Z_tydAufJp7skXSiA,14009
114
- tests/online/test_transaction_query_methods.py,sha256=esBk2Ru6CbAbHNcsU3WtpUm41vbsNAvLnaC-MmDt3D8,10909
115
- tests/online/test_unified_filter_online.py,sha256=A_rxj3lnY8LrQNy-FXSpmxXFLPle2OznAQxAptFl6cM,21181
112
+ tests/online/test_transaction_contexts.py,sha256=ZPsP5vtN1dspCmgZvZ5AUVmX171pymdaIMj_JJ-5_14,49993
113
+ tests/online/test_transaction_insert_methods.py,sha256=TgonknmyidAk_86K8QVowqOG6nLlJ056msGR0tykhxU,14075
114
+ tests/online/test_transaction_query_methods.py,sha256=VaPvHOYskwJVyM7lvVvBJ6HqhdPsXAibFfDyIv1Ox1A,10975
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.0.dist-info/METADATA,sha256=hXnXd7Pf1V_VyRVY4VFSSA4hr_0bVJIAJpYm3bPnjvc,20299
119
- matrixone_python_sdk-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
120
- matrixone_python_sdk-0.1.0.dist-info/entry_points.txt,sha256=4wUGPC_7_f5ZDR33JRo1LZmmTuyfkYAv41_5H5Qy-Ik,138
121
- matrixone_python_sdk-0.1.0.dist-info/top_level.txt,sha256=LQZabpBx_dtQk8JbKeH3MbjmC8HYDLE8UQeEf6NfQJA,16
122
- matrixone_python_sdk-0.1.0.dist-info/RECORD,,
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,,
@@ -263,7 +263,7 @@ class TestAsyncClientConnection(unittest.IsolatedAsyncioTestCase):
263
263
  # Mock create_async_engine to return our mock engine
264
264
  mock_create_async_engine.return_value = mock_engine
265
265
 
266
- await self.client.connect(host="localhost", port=6001, user="root", password="111", database="test")
266
+ await self.client.connect(host="localhost", port=6001, user="root", password="111", database="test", on_connect=[])
267
267
 
268
268
  # Verify create_async_engine was called
269
269
  mock_create_async_engine.assert_called_once()
@@ -280,7 +280,9 @@ class TestAsyncClientConnection(unittest.IsolatedAsyncioTestCase):
280
280
  mock_create_async_engine.side_effect = Exception("Connection failed")
281
281
 
282
282
  with self.assertRaises(Exception):
283
- await self.client.connect(host="localhost", port=6001, user="root", password="111", database="test")
283
+ await self.client.connect(
284
+ host="localhost", port=6001, user="root", password="111", database="test", on_connect=[]
285
+ )
284
286
 
285
287
  async def test_disconnect(self):
286
288
  """Test async disconnection"""
@@ -38,7 +38,7 @@ class TestAsyncClientMissingInterfaces:
38
38
  """Create and connect AsyncClient for testing"""
39
39
  host, port, user, password, database = get_connection_params()
40
40
  client = AsyncClient(logger=create_default_logger())
41
- await client.connect(host, port, user, password, database)
41
+ await client.connect(host=host, port=port, user=user, password=password, database=database)
42
42
  try:
43
43
  yield client
44
44
  finally:
@@ -40,7 +40,7 @@ class TestAsyncClientOnline:
40
40
  """Create and connect AsyncClient for testing"""
41
41
  host, port, user, password, database = online_config.get_connection_params()
42
42
  client = AsyncClient()
43
- await client.connect(host, port, user, password, database)
43
+ await client.connect(host=host, port=port, user=user, password=password, database=database)
44
44
  try:
45
45
  yield client
46
46
  finally:
@@ -100,13 +100,15 @@ class TestAsyncORMOnline:
100
100
 
101
101
  # First create the database using default connection
102
102
  temp_client = AsyncClient()
103
- await temp_client.connect(host, port, user, password, "test") # Connect to default database
103
+ await temp_client.connect(
104
+ host=host, port=port, user=user, password=password, database="test"
105
+ ) # Connect to default database
104
106
  await temp_client.execute(f"CREATE DATABASE IF NOT EXISTS {test_database}")
105
107
  await temp_client.disconnect()
106
108
 
107
109
  # Now connect to the test database
108
110
  client = AsyncClient()
109
- await client.connect(host, port, user, password, test_database)
111
+ await client.connect(host=host, port=port, user=user, password=password, database=test_database)
110
112
 
111
113
  try:
112
114
  # Create test tables
@@ -158,7 +160,7 @@ class TestAsyncORMOnline:
158
160
  await client.disconnect()
159
161
  # Clean up database
160
162
  cleanup_client = AsyncClient()
161
- await cleanup_client.connect(host, port, user, password, "test")
163
+ await cleanup_client.connect(host=host, port=port, user=user, password=password, database="test")
162
164
  await cleanup_client.execute(f"DROP DATABASE IF EXISTS {test_database}")
163
165
  await cleanup_client.disconnect()
164
166
  except Exception as e:
@@ -29,7 +29,7 @@ class TestAsyncTransactionSimpleQuery:
29
29
  async def async_client_setup(self):
30
30
  """Setup async client for testing"""
31
31
  client = AsyncClient()
32
- await client.connect("127.0.0.1", 6001, "root", "111", "test")
32
+ await client.connect(host="127.0.0.1", port=6001, user="root", password="111", database="test")
33
33
 
34
34
  # Enable fulltext indexing
35
35
  await client.execute("SET experimental_fulltext_index=1")
@@ -34,7 +34,7 @@ class TestSyncTransactionContexts:
34
34
  """Setup sync client for testing"""
35
35
  client = Client()
36
36
  host, port, user, password, database = online_config.get_connection_params()
37
- client.connect(host, port, user, password, database)
37
+ client.connect(host=host, port=port, user=user, password=password, database=database)
38
38
 
39
39
  # Enable fulltext indexing
40
40
  client.execute("SET experimental_fulltext_index=1")
@@ -154,7 +154,7 @@ class TestAsyncTransactionContexts:
154
154
  """Setup async client for testing"""
155
155
  client = AsyncClient()
156
156
  host, port, user, password, database = online_config.get_connection_params()
157
- await client.connect(host, port, user, password, database)
157
+ await client.connect(host=host, port=port, user=user, password=password, database=database)
158
158
 
159
159
  # Enable fulltext indexing
160
160
  await client.execute("SET experimental_fulltext_index=1")
@@ -295,7 +295,7 @@ class TestTransactionContextCompatibility:
295
295
  """Setup sync client for testing"""
296
296
  client = Client()
297
297
  host, port, user, password, database = online_config.get_connection_params()
298
- client.connect(host, port, user, password, database)
298
+ client.connect(host=host, port=port, user=user, password=password, database=database)
299
299
 
300
300
  # Enable fulltext indexing
301
301
  client.execute("SET experimental_fulltext_index=1")
@@ -364,7 +364,7 @@ class TestTransactionContextCompatibility:
364
364
  """Test that async transaction wrapper has all necessary managers"""
365
365
  client = AsyncClient()
366
366
  host, port, user, password, database = online_config.get_connection_params()
367
- await client.connect(host, port, user, password, database)
367
+ await client.connect(host=host, port=port, user=user, password=password, database=database)
368
368
 
369
369
  try:
370
370
  # Enable fulltext indexing
@@ -432,7 +432,7 @@ class TestTransactionContextFeatures:
432
432
  """Setup sync client for testing"""
433
433
  client = Client()
434
434
  host, port, user, password, database = online_config.get_connection_params()
435
- client.connect(host, port, user, password, database)
435
+ client.connect(host=host, port=port, user=user, password=password, database=database)
436
436
 
437
437
  # Enable fulltext indexing
438
438
  client.execute("SET experimental_fulltext_index=1")
@@ -537,7 +537,7 @@ class TestTransactionContextFeatures:
537
537
  """Test fulltext features in async transaction context"""
538
538
  client = AsyncClient()
539
539
  host, port, user, password, database = online_config.get_connection_params()
540
- await client.connect(host, port, user, password, database)
540
+ await client.connect(host=host, port=port, user=user, password=password, database=database)
541
541
 
542
542
  try:
543
543
  # Enable fulltext indexing
@@ -648,7 +648,7 @@ class TestGetConnectionInterface:
648
648
  """Setup sync client for testing"""
649
649
  client = Client()
650
650
  host, port, user, password, database = online_config.get_connection_params()
651
- client.connect(host, port, user, password, database)
651
+ client.connect(host=host, port=port, user=user, password=password, database=database)
652
652
 
653
653
  # Create test database and table
654
654
  test_db = "get_conn_test"
@@ -758,7 +758,7 @@ class TestGetConnectionInterface:
758
758
  """Test basic usage of get_connection in async transaction"""
759
759
  client = AsyncClient()
760
760
  host, port, user, password, database = online_config.get_connection_params()
761
- await client.connect(host, port, user, password, database)
761
+ await client.connect(host=host, port=port, user=user, password=password, database=database)
762
762
 
763
763
  try:
764
764
  # Create test database and table
@@ -869,7 +869,7 @@ class TestAsyncTransactionManagerConsistency:
869
869
  """Setup sync client for testing"""
870
870
  client = Client()
871
871
  host, port, user, password, database = online_config.get_connection_params()
872
- client.connect(host, port, user, password, database)
872
+ client.connect(host=host, port=port, user=user, password=password, database=database)
873
873
 
874
874
  # Create test database and table
875
875
  test_db = "sync_async_consistency_test"
@@ -920,7 +920,7 @@ class TestAsyncTransactionManagerConsistency:
920
920
  """Setup async client for testing"""
921
921
  client = AsyncClient()
922
922
  host, port, user, password, database = online_config.get_connection_params()
923
- await client.connect(host, port, user, password, database)
923
+ await client.connect(host=host, port=port, user=user, password=password, database=database)
924
924
 
925
925
  # Create test database and table
926
926
  test_db = "async_consistency_test"
@@ -30,7 +30,7 @@ class TestTransactionInsertMethods:
30
30
  """Setup sync client for testing"""
31
31
  client = Client()
32
32
  host, port, user, password, database = online_config.get_connection_params()
33
- client.connect(host, port, user, password, database)
33
+ client.connect(host=host, port=port, user=user, password=password, database=database)
34
34
 
35
35
  # Create test database
36
36
  test_db = "sync_insert_test"
@@ -64,7 +64,7 @@ class TestTransactionInsertMethods:
64
64
  """Setup async client for testing"""
65
65
  client = AsyncClient()
66
66
  host, port, user, password, database = online_config.get_connection_params()
67
- await client.connect(host, port, user, password, database)
67
+ await client.connect(host=host, port=port, user=user, password=password, database=database)
68
68
 
69
69
  # Create test database
70
70
  test_db = "async_insert_test"
@@ -30,7 +30,7 @@ class TestTransactionQueryMethods:
30
30
  """Setup sync client for testing"""
31
31
  client = Client()
32
32
  host, port, user, password, database = online_config.get_connection_params()
33
- client.connect(host, port, user, password, database)
33
+ client.connect(host=host, port=port, user=user, password=password, database=database)
34
34
 
35
35
  # Create test database
36
36
  test_db = "sync_query_test"
@@ -74,7 +74,7 @@ class TestTransactionQueryMethods:
74
74
  """Setup async client for testing"""
75
75
  client = AsyncClient()
76
76
  host, port, user, password, database = online_config.get_connection_params()
77
- await client.connect(host, port, user, password, database)
77
+ await client.connect(host=host, port=port, user=user, password=password, database=database)
78
78
 
79
79
  # Create test database
80
80
  test_db = "async_query_test"
@@ -71,7 +71,7 @@ class TestUnifiedFilterOnline(unittest.TestCase):
71
71
 
72
72
  # Create client
73
73
  cls.client = Client()
74
- cls.client.connect(host, port, user, password, database)
74
+ cls.client.connect(host=host, port=port, user=user, password=password, database=database)
75
75
 
76
76
  # Create test database
77
77
  cls.test_db = "unified_filter_test"