code: def test_statsforecast_df_transformations():
      df = create_mock_df()
      model_name = "ARIMA"
      settings_dict = {
          "order_by": "time_col",
          "group_by": ["group_col"],
          "target": "target_col",
          "model_name": model_name,
      }
  
      # Test transform for single groupby
      nixtla_df = transform_to_nixtla_df(df, settings_dict)
      assert [
          nixtla_df["unique_id"].iloc[i] == df["group_col"].iloc[i]
          for i in range(len(nixtla_df))
      ]
      assert [
          nixtla_df["y"].iloc[i] == df["target_col"].iloc[i]
          for i in range(len(nixtla_df))
      ]
      assert [
          nixtla_df["ds"].iloc[i] == df["time_col"].iloc[i]
          for i in range(len(nixtla_df))
      ]
      # Test reversing the transformation
      nixtla_results_df = nixtla_df.rename(
          {"y": model_name}, axis=1
      ).set_index("unique_id")
      mindsdb_results_df = get_results_from_nixtla_df(
          nixtla_results_df, settings_dict
      )
      pd.testing.assert_frame_equal(
          mindsdb_results_df,
          df[["time_col", "target_col", "group_col"]],
      )
  
      # Test for multiple groups
      settings_dict["group_by"] = [
          "group_col",
          "group_col_2",
          "group_col_3",
      ]
      nixtla_df = transform_to_nixtla_df(df, settings_dict)
      assert nixtla_df["unique_id"][0] == "a/a2/a3"
      # Test reversing the transformation
      nixtla_results_df = nixtla_df.rename(
          {"y": model_name}, axis=1
      ).set_index("unique_id")
      mindsdb_results_df = get_results_from_nixtla_df(
          nixtla_results_df, settings_dict
      )
      pd.testing.assert_frame_equal(mindsdb_results_df, df)
  
      # Test with exogenous vars
      settings_dict["group_by"] = ["group_col"]
      settings_dict["exogenous_vars"] = ["group_col_2", "group_col_3"]
      nixtla_df = transform_to_nixtla_df(
          df, settings_dict, exog_vars=["group_col_2", "group_col_3"]
      )
      assert nixtla_df.columns.tolist() == [
          "unique_id",
          "ds",
          "y",
          "group_col_2",
          "group_col_3",
      ]
  
file_path: mindsdb/tests/unit/ml_handlers/test_time_series_utils.py
imports: import pandas
  from statsforecast.utils import AirPassengersDF
  from mindsdb.integrations.utilities.time_series_utils import transform_to_nixtla_df, get_results_from_nixtla_df, infer_frequency, get_best_model_from_results_df, spec_hierarchy_from_list, get_hierarchy_from_df, reconcile_forecasts
label_desc: Use image node_id 3 for calling a global function with example usage: test_statsforecast_df_transformations() without return types