code: def test_malformed_input_raises_exception():
      error_message = "Values for grading_context_columns are malformed and cannot be "
      "formatted into a prompt for metric 'answer_similarity'.\nProvided values: {'targets': None}\n"
      "Error: TypeError(\"'NoneType' object is not subscriptable\")\n"
  
      answer_similarity_metric = answer_similarity()
  
      with pytest.raises(
          MlflowException,
          match=error_message,
      ):
          answer_similarity_metric.eval_fn(
              pd.Series([mlflow_prediction]),
              {},
              pd.Series([input]),
              None,
          )
  
imports: import inspect
  import re
  from unittest import mock
  import numpy
  import pandas
  import pytest
  from mlflow.exceptions import MlflowException
  from mlflow.metrics.genai import EvaluationExample, model_utils
  from mlflow.metrics.genai.genai_metric import _extract_score_and_justification, _format_args_string, make_genai_metric
  from mlflow.metrics.genai.metric_definitions import answer_correctness, answer_relevance, answer_similarity, faithfulness, relevance
  from mlflow.metrics.genai.prompts.v1 import AnswerCorrectnessMetric, AnswerRelevanceMetric, AnswerSimilarityMetric, FaithfulnessMetric, RelevanceMetric
label_desc: Use image node_id 4 for calling a global function with example usage: test_malformed_input_raises_exception() without return types