def test_score_modifiers_validation_with_non_rrf(self):
        """Test that score_modifiers raises error with non-RRF ranking methods."""
        score_modifier = ScoreModifier(
            field="test_field",
            weight=1.5,
            type=ScoreModifierType.Multiply
        )
        
        non_rrf_methods = [RankingMethod.Tensor, RankingMethod.Lexical]
        
        for ranking_method in non_rrf_methods:
            with self.subTest(ranking_method=ranking_method):
                hybrid_parameters = HybridParameters(
                    retrievalMethod=RetrievalMethod.Tensor,
                    rankingMethod=ranking_method
                )
                
                with self.assertRaises(ValidationError) as context:
                    MarqoHybridQuery(
                        index_name="test_index",
                        limit=10,
                        or_phrases=["phrase1"],
                        and_phrases=["phrase2"],
                        hybrid_parameters=hybrid_parameters,
                        score_modifiers=[score_modifier]
                    )
                
                error_msg = ("'scoreModifiers' is only supported for hybrid "
                             "search if 'rankingMethod' is 'RRF'")
                self.assertIn(error_msg, str(context.exception))
Test that score_modifiers raises error with non-RRF ranking methods.
tests/unit_tests/marqo/core/models/test_marqo_query.py