code: def test_statsmodels_autolog_failed_metrics_warning():
      mlflow.statsmodels.autolog()
  
      @property
      def metric_raise_error(_):
          raise RuntimeError()
  
      class MockSummary:
          def as_text(self):
              return "mock summary."
  
      with mock.patch(
          "statsmodels.regression.linear_model.OLSResults.f_pvalue",
          metric_raise_error,
      ), mock.patch(
          "statsmodels.regression.linear_model.OLSResults.fvalue",
          metric_raise_error,
      ), mock.patch(
          # Prevent `OLSResults.summary` from calling `fvalue` and `f_pvalue` that raise an exception
          "statsmodels.regression.linear_model.OLSResults.summary",
          return_value=MockSummary(),
      ), mock.patch(
          "mlflow.statsmodels._logger.warning"
      ) as mock_warning:
          ols_model()
          mock_warning.assert_called_once_with(
              "Failed to autolog metrics: f_pvalue, fvalue."
          )
  
imports: from unittest import mock
  import numpy
  import pytest
  from statsmodels.tsa.base.tsa_model import TimeSeriesModel
  import mlflow
  import mlflow.statsmodels
  from mlflow import MlflowClient
  from tests.statsmodels.model_fixtures import arma_model, failing_logit_model, gee_model, glm_model, gls_model, glsar_model, ols_model, recursivels_model, rolling_ols_model, rolling_wls_model, wls_model
  from tests.statsmodels.test_statsmodels_model_export import _get_dates_from_df
label_desc: Use image node_id 10 for calling a global function with example usage: test_statsmodels_autolog_failed_metrics_warning() and returns: str