Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pymilvus/orm/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,8 @@ def check_upsert_schema(schema: CollectionSchema, data: Union[List[List], pd.Dat
columns = list(data.columns)
data = data[columns]

_check_data_schema_cnt(copy.deepcopy(schema.fields), data)
tmp_fields = [field for field in schema.fields if not field.is_function_output]
_check_data_schema_cnt(tmp_fields, data)
_check_insert_data(data)


Expand Down
6 changes: 6 additions & 0 deletions tests/unit/orm/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,12 @@ def test_check_upsert_schema_valid_dataframe(self):
df = pd.DataFrame({"pk": [1, 2], "vec": [[1.0, 2.0], [3.0, 4.0]]})
check_upsert_schema(schema, df)

def test_check_upsert_schema_skips_function_output(self):
"""Function output fields should be excluded from upsert column checks."""
schema = self._schema_with_function_output()
df = pd.DataFrame({"pk": [1], "text": ["hello"]})
check_upsert_schema(schema, df)

def test_check_upsert_schema_list_data(self):
"""check_upsert_schema with list-based column data."""
schema = CollectionSchema(
Expand Down