code: def test_write_to_delta_fails_with_invalid_mode(
      spark_session_with_delta,
  ):
      with mlflow.start_run():
          model_info = mlflow.pyfunc.log_model(
              artifact_path="model",
              python_model=language_model,
              input_example=["a", "b"],
          )
          data = pd.DataFrame(
              {"text": ["Hello world", "My name is MLflow"]}
          )
          with pytest.raises(
              MlflowException,
              match="eval_results_mode can only be 'overwrite' or 'append'",
          ):
              mlflow.evaluate(
                  model_info.model_uri,
                  data,
                  extra_metrics=[mlflow.metrics.latency()],
                  evaluators="default",
                  evaluator_config={
                      "eval_results_path": "my_path",
                      "eval_results_mode": "invalid_mode",
                  },
              )
  
file_path: mlflow/tests/evaluate/test_default_evaluator_delta.py
imports: import tempfile
  from typing import List
  import pandas
  import pytest
  from pyspark.sql import SparkSession
  import mlflow
  from mlflow.exceptions import MlflowException
label_desc: Use image node_id 4 for calling a global function with example usage: test_write_to_delta_fails_with_invalid_mode(spark_session_with_delta) without return types