From 67a6cca880bb1e47df265bf8cf28c0f5fa5210e2 Mon Sep 17 00:00:00 2001 From: counter2015 Date: Mon, 30 Dec 2024 10:40:45 +0800 Subject: [PATCH] Add `db_name` parameter at `bulk_import` (#2446) The purpose of this PR is to align the parameter passing in the Python SDK with the RESTful API, and to add the missing "dbName" field. see: https://milvus.io/api-reference/restful/v2.4.x/v2/Import%20(v2)/Create.md > dbName string The name of the database that to which the collection belongs . Setting this to a non-existing database results in an error. Signed-off-by: counter2015 --- pymilvus/bulk_writer/bulk_import.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pymilvus/bulk_writer/bulk_import.py b/pymilvus/bulk_writer/bulk_import.py index a5893145d..6b74ddc0a 100644 --- a/pymilvus/bulk_writer/bulk_import.py +++ b/pymilvus/bulk_writer/bulk_import.py @@ -78,6 +78,7 @@ def _get_request( def bulk_import( url: str, collection_name: str, + db_name: str = "default", files: Optional[List[List[str]]] = None, object_url: str = "", cluster_id: str = "", @@ -91,6 +92,7 @@ def bulk_import( Args: url (str): url of the server collection_name (str): name of the target collection + db_name (str): name of target database partition_name (str): name of the target partition files (list of list of str): The files that contain the data to import. A sub-list contains a single JSON or Parquet file, or a set of Numpy files. @@ -110,6 +112,7 @@ def bulk_import( partition_name = kwargs.pop("partition_name", "") params = { "collectionName": collection_name, + "dbName": db_name, "partitionName": partition_name, "files": files, "objectUrl": object_url,