def test_partial_update_should_handle_mixed_valid_invalid_docs(self):
        """Test batch with mix of valid and invalid documents"""
        updates = [
            {
                '_id': '2',
                'int_field': 100
            },
            {
                '_id': '3',
                'bool_field': True
            },
            {
                'missing_id': True
            }
        ]
        res = self.config.document.partial_update_documents(updates, self.index)
        self.assertTrue(res.errors)

        # Verify valid updates succeeded
        doc2 = tensor_search.get_document_by_id(self.config, self.index.name, '2')
        self.assertEqual(100, doc2['int_field'])
        self._assert_fields_unchanged(doc2, ['int_field'])

        doc3 = tensor_search.get_document_by_id(self.config, self.index.name, '3')
        self.assertTrue(doc3['bool_field'])
        self._assert_fields_unchanged(doc2, ['bool_field', 'int_field'])

        self.assertEqual(3, len(res.items))
        self.assertFalse(res.items[0].error)  # Valid doc
        self.assertFalse(res.items[1].error)  # Valid doc

        # Verify error responses for invalid docs
        self.assertIn("'_id' is a required field", res.items[2].error)  # Missing ID
Test batch with mix of valid and invalid documents
tests/integ_tests/core/document/test_partial_update_semi_structured.py