From 3ab086392ef892ebebccc612f807341ba1bf12ea Mon Sep 17 00:00:00 2001 From: Congqi Xia Date: Wed, 28 Aug 2024 19:15:30 +0800 Subject: [PATCH 1/2] enhance: Support specify field default skip load creating collection Related to #35415 Signed-off-by: Congqi Xia --- pymilvus/orm/schema.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pymilvus/orm/schema.py b/pymilvus/orm/schema.py index 786ef6479..ef504ade3 100644 --- a/pymilvus/orm/schema.py +++ b/pymilvus/orm/schema.py @@ -330,6 +330,9 @@ def __init__(self, name: str, dtype: DataType, description: str = "", **kwargs) self.element_type = kwargs.get("element_type", None) if "mmap_enabled" in kwargs: self._type_params["mmap_enabled"] = kwargs["mmap_enabled"] + # use `skip_load` to follow other kwargs format + if "skip_load" in kwargs: + self._type_params["field.skipLoad"] = kwargs["skip_load"] # set `field.skipLoad` since it's the actual key self._parse_type_params() def __repr__(self) -> str: From 0cc576c4e794789e6a8aad33c6371a2b6b495ed2 Mon Sep 17 00:00:00 2001 From: Congqi Xia Date: Wed, 28 Aug 2024 19:30:05 +0800 Subject: [PATCH 2/2] Fix lint Signed-off-by: Congqi Xia --- pymilvus/orm/schema.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pymilvus/orm/schema.py b/pymilvus/orm/schema.py index ef504ade3..6cb07d7ee 100644 --- a/pymilvus/orm/schema.py +++ b/pymilvus/orm/schema.py @@ -332,7 +332,9 @@ def __init__(self, name: str, dtype: DataType, description: str = "", **kwargs) self._type_params["mmap_enabled"] = kwargs["mmap_enabled"] # use `skip_load` to follow other kwargs format if "skip_load" in kwargs: - self._type_params["field.skipLoad"] = kwargs["skip_load"] # set `field.skipLoad` since it's the actual key + self._type_params["field.skipLoad"] = kwargs[ + "skip_load" + ] # set `field.skipLoad` since it's the actual key self._parse_type_params() def __repr__(self) -> str: