def test_update_document_and_change_field_type(self):
        """Test that changing field types during document updates fails with appropriate errors.
        
        This test verifies that attempting to change a field's type (e.g., float to int, int to string)
        during an update operation results in the expected error responses.
        """
        # First add a document with various field types
        text_docs = [{
            '_id': '1',
            'tensor_field': 'title',
            'tensor_subfield': 'description',
            "short_string_field": "shortstring",
            "long_string_field": "Thisisaverylongstring" * 10,
            "int_field": 123,
            "float_field": 123.0,
            "string_array": ["aaa", "bbb"],
            "string_array2": ["123", "456"],
            "int_map": {"a": 1, "b": 2},
            "float_map": {"c": 1.0, "d": 2.0},
            "bool_field": True,
            "bool_field2": False,
            "custom_vector_field": {
                "content": "abcd",
                "vector": [1.0] * 32
            }
        }]

        mappings = {
            "custom_vector_field": {"type": "custom_vector"},
            "multimodal_combo_field": {
                "type": "multimodal_combination",
                "weights": {"tensor_field": 1.0, "tensor_subfield": 2.0}
            }
        }

        tensor_fields = ['tensor_field', 'custom_vector_field', 'multimodal_combo_field']

        add_docs_response = self.client.index(self.text_index_name).add_documents(documents=text_docs, mappings=mappings, tensor_fields=tensor_fields)
        self.assertFalse(add_docs_response["errors"])

        # Define field type change scenarios to test
        type_change_scenarios = [
            {"field": "float_field", "new_value": 500, "original_type": "float", "new_type": "int"},
            {"field": "int_field", "new_value": 123.5, "original_type": "int", "new_type": "float"},
            {"field": "bool_field", "new_value": "true", "original_type": "bool", "new_type": "string"},
            {"field": "short_string_field", "new_value": 42, "original_type": "string", "new_type": "int"},
            {"field": "int_map", "new_value": {"a": 2.5}, "original_type": "int_map", "new_type": "float_map"},
            {"field": "float_map", "new_value": {"c": 3}, "original_type": "float_map", "new_type": "int_map"},
            {"field": "string_array", "new_value": 123, "original_type": "string_array", "new_type": "int"},
            # Map to scalar type changes
            {"field": "int_map", "new_value": 42, "original_type": "int_map", "new_type": "int"},
            {"field": "int_map", "new_value": 42.5, "original_type": "int_map", "new_type": "float"},
            {"field": "float_map", "new_value": 42, "original_type": "float_map", "new_type": "int"},
            {"field": "float_map", "new_value": 42.5, "original_type": "float_map", "new_type": "float"}
        ]

        # Test each type change scenario in a subtest
        for scenario in type_change_scenarios:
            with self.subTest(f"Changing {scenario['field']} from {scenario['original_type']} to {scenario['new_type']}"):
                update_payload = {
                    '_id': '1',
                    scenario['field']: scenario['new_value']
                }
                
                update_docs_response = self.client.index(self.text_index_name).update_documents([update_payload])

                # Verify the update failed with appropriate error
                self.assertTrue(update_docs_response["errors"])
                self.assertEqual(update_docs_response['items'][0]['status'], 400)
                if scenario['original_type'] == "bool":
                    self.assertIn("bool_field of type str does not exist in the original document. Marqo does not support adding new lexical fields in partial updates",
                                  update_docs_response['items'][0]['error'])
                else:
                    self.assertIn("Marqo vector store couldn't update the document. Please see",
                                  update_docs_response['items'][0]['message'])
                    self.assertIn("reference/api/documents/update-documents/#response",
                                  update_docs_response['items'][0]['message'])
Test that changing field types during document updates fails with appropriate errors.
        
        This test verifies that attempting to change a field's type (e.g., float to int, int to string)
        during an update operation results in the expected error responses.
        
tests/api_tests/v1/tests/api_tests/unstructured_index/test_update_documents_unstructured_index.py