Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ coverage.xml

# Example data
/examples/bulk_writer

# uv
uv.lock
6 changes: 3 additions & 3 deletions pymilvus/milvus_client/async_milvus_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
from typing import Dict, List, Optional, Union
from uuid import uuid4

from pymilvus.client.abstract import AnnSearchRequest, BaseRanker
from pymilvus.client.constants import DEFAULT_CONSISTENCY_LEVEL
Expand Down Expand Up @@ -586,8 +585,9 @@ def _create_connection(
**kwargs,
) -> str:
"""Create the connection to the Milvus server."""
# TODO: Implement reuse with new uri style
using = uuid4().hex
using = kwargs.pop("alias", None)
if not using:
using = f"async-{uri}{user}"
try:
connections.connect(
using, user, password, db_name, token, uri=uri, _async=True, **kwargs
Expand Down
6 changes: 3 additions & 3 deletions pymilvus/milvus_client/milvus_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
from typing import Dict, List, Optional, Union
from uuid import uuid4

from pymilvus.client.abstract import AnnSearchRequest, BaseRanker
from pymilvus.client.constants import DEFAULT_CONSISTENCY_LEVEL
Expand Down Expand Up @@ -908,8 +907,9 @@ def _create_connection(
**kwargs,
) -> str:
"""Create the connection to the Milvus server."""
# TODO: Implement reuse with new uri style
using = kwargs.pop("alias", None) or uuid4().hex
using = kwargs.pop("alias", None)
if not using:
using = f"{uri}{user}"
try:
connections.connect(using, user, password, db_name, token, uri=uri, **kwargs)
except Exception as ex:
Expand Down
3 changes: 2 additions & 1 deletion pymilvus/orm/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ def connect(
"""
Constructs a milvus connection and register it under given alias.

:param alias: The name of milvus connection
:param alias: The name of milvus connection. For each alias, there will be one and only one
connection created.
:type alias: str

:param kwargs:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pyparsing==2.4.7
six==1.16.0
toml==0.10.2
ujson>=2.0.0
urllib3==1.26.19
urllib3==2.5.0
m2r==0.3.1
Sphinx==4.0.0
sphinx-copybutton
Expand Down