Skip to content

Commit 635dbe6

Browse files
committed
Add default values to Pop to prevent exceptions
Signed-off-by: zhenshan.cao <[email protected]>
1 parent 89cf1a9 commit 635dbe6

File tree

4 files changed

+54
-54
lines changed

4 files changed

+54
-54
lines changed

pymilvus/__init__.py

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -72,65 +72,65 @@
7272
from .settings import Config as DefaultConfig
7373

7474
__all__ = [
75+
"AnnSearchRequest",
76+
"BulkInsertState",
7577
"Collection",
78+
"CollectionSchema",
79+
"Connections",
80+
"DataType",
81+
"DefaultConfig",
82+
"ExceptionsMessage",
83+
"FieldSchema",
84+
"Function",
85+
"FunctionType",
86+
"Group",
87+
"Hit",
88+
"Hits",
7689
"Index",
90+
"IndexType",
91+
"Milvus",
92+
"MilvusClient",
93+
"MilvusException",
94+
"MilvusUnavailableException",
95+
"MutationFuture",
7796
"Partition",
97+
"Prepare",
98+
"RRFRanker",
99+
"Replica",
100+
"ResourceGroupInfo",
101+
"Role",
102+
"SearchFuture",
103+
"SearchResult",
104+
"Shard",
105+
"Status",
106+
"WeightedRanker",
107+
"__version__",
78108
"connections",
79-
"loading_progress",
80-
"index_building_progress",
81-
"wait_for_index_building_complete",
109+
"create_resource_group",
110+
"create_user",
111+
"db",
112+
"delete_user",
113+
"describe_resource_group",
82114
"drop_collection",
115+
"drop_resource_group",
83116
"has_collection",
84-
"list_collections",
85-
"wait_for_loading_complete",
86117
"has_partition",
118+
"hybridts_to_datetime",
119+
"hybridts_to_unixtime",
120+
"index_building_progress",
121+
"list_collections",
122+
"list_resource_groups",
123+
"list_usernames",
124+
"loading_progress",
125+
"mkts_from_datetime",
87126
"mkts_from_hybridts",
88127
"mkts_from_unixtime",
89-
"mkts_from_datetime",
90-
"hybridts_to_unixtime",
91-
"hybridts_to_datetime",
92128
"reset_password",
93-
"create_user",
129+
"transfer_node",
130+
"transfer_replica",
94131
"update_password",
95132
"update_resource_groups",
96-
"delete_user",
97-
"list_usernames",
98-
"SearchResult",
99-
"Hits",
100-
"Hit",
101-
"Replica",
102-
"Group",
103-
"Shard",
104-
"FieldSchema",
105-
"Function",
106-
"CollectionSchema",
107-
"SearchFuture",
108-
"MutationFuture",
109133
"utility",
110-
"db",
111-
"DefaultConfig",
112-
"Role",
113-
"ExceptionsMessage",
114-
"MilvusUnavailableException",
115-
"BulkInsertState",
116-
"create_resource_group",
117-
"drop_resource_group",
118-
"describe_resource_group",
119-
"list_resource_groups",
120-
"transfer_node",
121-
"transfer_replica",
122-
"Milvus",
123-
"Prepare",
124-
"Status",
125-
"DataType",
126-
"FunctionType",
127-
"MilvusException",
128-
"__version__",
129-
"MilvusClient",
130-
"ResourceGroupInfo",
131-
"Connections",
132-
"IndexType",
133-
"AnnSearchRequest",
134-
"RRFRanker",
135-
"WeightedRanker",
134+
"wait_for_index_building_complete",
135+
"wait_for_loading_complete",
136136
]

pymilvus/bulk_writer/buffer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ def append_row(self, row: dict):
9393
if DYNAMIC_FIELD_NAME in row and not isinstance(row[DYNAMIC_FIELD_NAME], dict):
9494
self._throw(f"Dynamic field '{DYNAMIC_FIELD_NAME}' value should be JSON format")
9595

96-
for k in row:
96+
for k, v in row.items():
9797
if k == DYNAMIC_FIELD_NAME:
98-
dynamic_values.update(row[k])
98+
dynamic_values.update(v)
9999
continue
100100

101101
if k not in self._buffer:
102-
dynamic_values[k] = self._raw_obj(row[k])
102+
dynamic_values[k] = self._raw_obj(v)
103103
else:
104-
self._buffer[k].append(row[k])
104+
self._buffer[k].append(v)
105105

106106
if DYNAMIC_FIELD_NAME in self._buffer:
107107
self._buffer[DYNAMIC_FIELD_NAME].append(dynamic_values)

pymilvus/client/check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def is_legal_round_decimal(round_decimal: Any) -> bool:
244244

245245

246246
def is_legal_guarantee_timestamp(ts: Any) -> bool:
247-
return ts is None or isinstance(ts, int) and ts >= 0
247+
return (ts is None) or (isinstance(ts, int) and ts >= 0)
248248

249249

250250
def is_legal_user(user: Any) -> bool:

pymilvus/client/grpc_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def delete(
604604
)
605605
future = self._stub.Delete.future(req, timeout=timeout)
606606
if kwargs.get("_async", False):
607-
cb = kwargs.pop("_callback")
607+
cb = kwargs.pop("_callback", None)
608608
f = MutationFuture(future, cb, timeout=timeout, **kwargs)
609609
f.add_callback(ts_utils.update_ts_on_mutation(collection_name))
610610
return f

0 commit comments

Comments
 (0)