code: def test_vars_shows_on_params_diff(tmp_dir, scm, dvc):
      params_file = tmp_dir / "test_params.yaml"
      param_data = {
          "vars": {"model1": {"epoch": 15}, "model2": {"epoch": 35}}
      }
      (tmp_dir / params_file).dump(param_data)
      d = {
          "vars": ["test_params.yaml"],
          "stages": {
              "build": {
                  "foreach": "${vars}",
                  "do": {"cmd": "script --epoch ${item.epoch}"},
              }
          },
      }
      (tmp_dir / "dvc.yaml").dump(d)
      assert dvc.params.diff() == {
          "diff": {
              "test_params.yaml": {
                  "vars.model1.epoch": {"new": 15, "old": None},
                  "vars.model2.epoch": {"new": 35, "old": None},
              }
          }
      }
      scm.add(["dvc.yaml", "test_params.yaml"])
      scm.commit("added stages")
  
      param_data["vars"]["model1"]["epoch"] = 20
      (tmp_dir / params_file).dump(param_data)
      assert dvc.params.diff() == {
          "diff": {
              "test_params.yaml": {
                  "vars.model1.epoch": {"new": 20, "old": 15, "diff": 5}
              }
          }
      }
  
      data_dir = tmp_dir / "data"
      data_dir.mkdir()
      with data_dir.chdir():
          assert dvc.params.diff() == {
              "diff": {
                  str(params_file.relative_to(tmp_dir)): {
                      "vars.model1.epoch": {
                          "new": 20,
                          "old": 15,
                          "diff": 5,
                      }
                  }
              }
          }
  
file_path: dvc/tests/func/params/test_diff.py
imports: from os.path import join
  import pytest
  from dvc.utils import relpath
label_desc: Use image node_id 12 for calling a global function with example usage: test_vars_shows_on_params_diff(tmp_dir, scm, dvc) without return types