Pymilvus

Latest version: v2.4.1

Safety actively analyzes 625831 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 9

2.1.1

Fix some bugs

2.1

1. New APIs

Support RBAC (Role Based Access Control)

Renamed APIs in `utility`

|Methods in 2.1.x| Methods in 2.2.x|
|----------------|-----------------|
|`utility.create_credential` | `utility.create_user` |
|[No change]`utility.reset_password`| `utility.reset_password`
|`utility.update_credential`|`utility.update_password`|
|`utility.delete_credential`|`utility.delete_user`|
|`utility.list_cred_users`|`utility.list_usernames`|
|-|`utility.list_roles`|
|-|`utility.list_user`|
|-|`utility.list_users`|

New class `Role`

- property:
- Role.name
- methods:
- Role.create
- Role.drop
- Role.add_user
- Role.remove_user
- Role.get_users
- Role.is_exist
- Role.grant
- Role.revoke
- Role.list_grant
- Role.list_grants

Support bulk insert data

1. `utility.do_bulk_insert`
2. `utility.get_bulk_insert_state`
3. `utility.list_bulk_insert_tasks`

Add `flush`
1. `Collection.flush()`

2. More functional and compatible APIs
Support search/query pagination
Support collection TTL (Time to Live)

Add *properties* support when init Collection
python
Collection(name="a", data=data, schema=schema, properties={"collection.ttl.seconds": 1800})


3. Enhanced APIs

`num_entities` doesn't invoke `flush` inside
`create_index`:
- doesn't invoke `flush` inside.
- support FLAT, DiskANN, and, AutoIndex index type
- support naming an index
- support to create index for string field

`Collection.drop`:

- doesn't invoke `Collection.release()` and `index.drop()` inside.

4. Removed APIs

1. `calc_distance()`

2.1.0

New Features
Load multiple memory replicas
python
collection.load(replica_number=2)

collection.get_replicas()


Support `VARCHAR` data type

1. You can define `VARCHAR` field in schema, also `VARCHAR` field can be used as primary field:

python
FieldSchema(name="pk", dtype=DataType.VARCHAR, is_primary=True, auto_id=False, max_length=100)


2. Just like other data type, you can insert string into `VARCHAR` field:

python
entities = [
[str(i) for i in range(num_entities)],
]
insert_result = collection.insert(entities)


3. You can also choose to build index for `VARCHAR` field, for now, the only supported index for string is `Trie`:

python
collection.create_index(field_name="pk", index_name="index_on_varchar")


4. Just like other data type, scalar filtering expression on `VARCHAR` field is also supported, besides basic filters, prefix match is also supported. Please visist `milvus.io` for more detailed information.

5. `VARCHAR` field as output fields is also supported when you are about to do a search or query:

python
res = collection.query(expr='pk > "str"', output_fields=["pk"])


Support to specify index name for index-related operations

Now, you can specify index name when you create index for field.

python
collection.create_index(field_name="field", index_name="index_name", index_params={})
collection.drop_index(index_name="index_name")


For backward compatibility, if you don't specify the index name, `_default_idx` will be used.

Support Basic Authentication

We add some APIs to support basic authentication:

- create_credential
- update_credential
- delete_credential
- list_cred_users

If there are any users in Milvus server, then the `user` and `password` are required to setup a connection:

python
connections.connect(host="host", port="port", user="user", password="password")


For more detailed information, please refer to [mep27](https://wiki.lfaidata.foundation/display/MIL/MEP+27+--+Support+Basic+Authentication).

Support tls in RPC

Besides basic authentication, we also support to tls in RPC, you can setup a secure connection.

For one-way tls:

python
connections.connect(host=_HOST, port=_PORT, secure=True, server_pem_path="server.pem", server_name="localhost")


For two-way tls:

python
connections.connect(host=_HOST,
port=_PORT,
secure=True,
client_pem_path="client.pem",
client_key_path="client.key",
ca_pem_path="ca.pem",
server_name="localhost")


Enhancement
1. Extend version range of grpcio and ujson
2. Add milvus-proto as submodule
3. Support full uri in connection
python
connections.connect(alias="test", uri="https://example.com:19530")

2.0.2

**Release date**: 2022-04-02

Features:

- Add support for numpy.ndarray for vector field (937)

Fixed bugs:

- Fix pymilvus unable to download on python3.8 (931)
- Fix loading progress output (936)

Enhancements:

- Remove load balance from doc (929)
- Fix readme bug (934)
- Fix create_partition doc string (935)

2.0.1

**Release date**: 2022-02-23

Features:

- Support secure gRPC channel for AWS (894)

Fixed bugs:

- Fix string consistency level not work (896)
- Fix partition unable to delete bug (879)

Enhancements:

- Speed up pack operation on float vector (898)

2.0.0

Along with Milvus 2.0.0, we are so glad to announce the release of PyMilvus 2.0.0.

From this version, PyMilvus's releases will no longer follow the release of Milvus. We'll focus on improving the codes quality and ease-of-use, and of course, support for new features from Milvus.

As for PyMilvus 2.0.0, there are some exciting news we want to share with you.

A. 1.x APIs (for Milvus 1.x) and orm-styled APIs (for Milvus 2.x) are *finally physically separated*.

For the convenience of the Milvus 1.x users, we had reserved PyMilvus 1.x APIs within all release-candidates versions of PyMilvus. Now it's time to say goodbye to those 1.x APIs if you're using Milvus 2.0.0.

> Note: 1.x APIs means the usage of `Milvus()` class.

Here's why:

- 1.x APIs won't be supported for Milvus 2.0.0 in long term.
- No documentations were provided concerning 1.x API usage on Milvus 2.0.0.

The mixed usage of the 1.x APIs and the orm-styled APIs is not recommended, **but you still can use 1.x APIs for Milvus 2.0.0 in PyMilvus2.0.0**.

Here's what we've done to avoid the mixed usage:

1. Separate the 1.x APIs and the orm-styled APIs completely. Now you cannot get a `Milvus` object through the orm-styled APIs.
2. Mark `Milvus` class as **deprecated**. There'll be a warning every time you try to use 1.x `Milvus` class on Milvus 2.0.0.
3. `Flush` in Milvus 2.0.0 refers to a completely different method. Whereas reads and writes are completely separated in Milvus 2.0.0, you don't need to flush to make the entity searchable by query node. Instead, consistency level is what you need to worry about.

**If you encounter any problems while upgrading PyMilvus to 2.0.0, don't worry, it's just a few steps away, and we're always here to help. Here're some tips:**

- If you want to use the 1.x APIs on Milvus 2.0.0, just init `Milvus()` class and you are good to go.

> Note: There is no documentation elaborating the usage of the 1.x APIs on Milvus 2.0.0, and we're planning to remove these APIs in the next release of PyMilvus.

- If you're unaware of the mixed usage of these two sets of APIs, please refer to [Milvus.io](https://milvus.io/docs/v2.0.0/example_code.md) or `examples/hello_milvus.py` in PyMilvus GitHub repository for the correct usages.
- If you want to use any of the 1.x APIs that is unavailable in orm-styled APIs, let us know. We'll be happy to support it in future releases.

B. Support delete

C. Consistency level

Page 6 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.