Skip to content

Commit

Permalink
fix: pass lint
Browse files Browse the repository at this point in the history
Signed-off-by: OxalisCu <2127298698@qq.com>
  • Loading branch information
OxalisCu committed Sep 30, 2024
1 parent 90177cb commit 0248b0f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pymilvus/bulk_writer/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def _persist_parquet(self, local_path: str, **kwargs):
def _persist_csv(self, local_path: str, **kwargs):
sep = self._config.get("sep", ",")
nullkey = self._config.get("nullkey", "")

header = list(self._buffer.keys())
df = pd.DataFrame(columns=header)
for k, v in self._buffer.items():
Expand All @@ -305,7 +305,13 @@ def _persist_csv(self, local_path: str, **kwargs):
# so 1. whether make sure that arr of type (BINARY_VECTOR, FLOAT_VECTOR, FLOAT16_VECTOR, BFLOAT16_VECTOR) is a LIST,
# 2. or convert arr into a string using json.dumps(arr) first and then add it to df
# I choose method 2 here
if field_schema.dtype in {DataType.JSON, DataType.ARRAY, DataType.SPARSE_FLOAT_VECTOR, DataType.BINARY_VECTOR, DataType.FLOAT_VECTOR}:
if field_schema.dtype in {
DataType.JSON,
DataType.ARRAY,
DataType.SPARSE_FLOAT_VECTOR,
DataType.BINARY_VECTOR,
DataType.FLOAT_VECTOR,
}:
dt = np.dtype("str")
arr = []
for val in v:
Expand Down

0 comments on commit 0248b0f

Please sign in to comment.