@@ -538,6 +538,35 @@ def test_batch_upsert_param_partial_update_field_count_validation_skip(self):
538538 request .fields_data ) == 2 , "Should only contain data for provided fields"
539539
540540
541+
542+ def test_row_upsert_param_partial_update_with_float16_vector_cached (self ):
543+ """Test that cached vector types (float16) are flushed correctly with partial_update=True"""
544+ dim = 8
545+ schema = CollectionSchema ([
546+ FieldSchema ("float16_vector" , DataType .FLOAT16_VECTOR , dim = dim ),
547+ FieldSchema ("pk" , DataType .INT64 , is_primary = True )
548+ ])
549+
550+ # simulated float16 data (numpy float16 array)
551+ vector_data = np .zeros ((1 , dim ), dtype = np .float16 )
552+
553+ rows = [
554+ {"pk" : 1 , "float16_vector" : vector_data [0 ]}
555+ ]
556+
557+ req = Prepare .row_upsert_param ("test_collection" , rows , "" ,
558+ fields_info = schema .to_dict ()["fields" ],
559+ partial_update = True )
560+
561+ vector_field_data = next ((fd for fd in req .fields_data if fd .field_name == "float16_vector" ), None )
562+ assert vector_field_data is not None , "Vector field 'float16_vector' not found in request"
563+
564+ # Should have data
565+ # 1 vector * 8 dim * 2 bytes = 16 bytes
566+ expected_bytes = 1 * dim * 2
567+ assert len (vector_field_data .vectors .float16_vector ) == expected_bytes , f"Vector data has incorrect size! Expected { expected_bytes } bytes."
568+
569+
541570class TestCreateIndexRequest :
542571 def test_create_index_request_with_false_boolean_param (self ):
543572 """Test that boolean False values are preserved in index parameters"""
0 commit comments