code: def test_plot_cache_missing(
      tmp_dir, scm, dvc, caplog, run_copy_metrics
  ):
      metric1 = [{"y": 2}, {"y": 3}]
      (tmp_dir / "metric_t.json").dump_json(metric1, sort_keys=True)
      run_copy_metrics(
          "metric_t.json",
          "metric.json",
          plots=["metric.json"],
          name="copy-metric",
          commit="there is metric",
      )
      scm.tag("v1")
  
      # Make a different plot and then remove its datafile
      metric2 = [{"y": 3}, {"y": 4}]
      (tmp_dir / "metric_t.json").dump_json(metric2, sort_keys=True)
      stage = run_copy_metrics(
          "metric_t.json",
          "metric.json",
          plots=["metric.json"],
          name="copy-metric",
          commit="there is an another metric",
      )
      scm.tag("v2")
      remove(stage.outs[0].fspath)
      remove(stage.outs[0].cache_path)
  
      plots_data = dvc.plots.show(
          revs=["v1", "v2"], targets=["metric.json"]
      )
  
      assert get_plot(plots_data, "v1", file="metric.json") == metric1
      assert isinstance(
          get_plot(
              plots_data, "v2", file="metric.json", endkey="error"
          ),
          FileNotFoundError,
      )
  
imports: import json
  import os
  import pytest
  from dvc.cli import main
  from dvc.dvcfile import PROJECT_FILE
  from dvc.exceptions import OverlappingOutputPathsError
  from dvc.repo import Repo
  from dvc.repo.plots import PlotMetricTypeError, onerror_collect
  from dvc.utils.fs import remove
  from dvc.utils.serialize import EncodingError, YAMLFileCorruptedError, modify_yaml
  from tests.utils.plots import get_plot
label_desc: Use image node_id 2 for calling a global function with example usage: test_plot_cache_missing(tmp_dir, scm, dvc, caplog, run_copy_metrics) without return types