code: def test_checkpoint_dag_validation(workflow_start_regular):
      @ray.remote
      def identity(x):
          return x
  
      @ray.remote
      def average(x):
          return np.mean(x)
  
      @workflow.task
      def valid_checkpoint_dag_1():
          y = identity.options(checkpoint=False).task(42)
          return average.options(checkpoint=True).task(y)
  
      @workflow.task
      def invalid_checkpoint_dag_1():
          y = identity.options(checkpoint=True).task(42)
          return average.options(checkpoint=True).task(y)
  
      @workflow.task
      def invalid_checkpoint_dag_2():
          y = valid_checkpoint_dag_1.options(checkpoint=False).bind()
          return average.options(checkpoint=True).task(y)
  
      valid_checkpoint_dag_1.options(checkpoint=False).bind().run()
      # check invalid configuration
      with pytest.raises(workflow.WorkflowExecutionError):
          invalid_checkpoint_dag_1.options(
              checkpoint=False
          ).bind().run()
      # check invalid configuration
      with pytest.raises(workflow.WorkflowExecutionError):
          invalid_checkpoint_dag_2.options(
              checkpoint=False
          ).bind().run()
  
file_path: ray/python/ray/workflow/tests/test_checkpoint_2.py
imports: import ray
  import time
  import pytest
  from ray.tests.conftest import *
  import numpy
  from ray import workflow
  from ray.workflow.tests import utils
label_desc: Use image node_id 5 for calling a global function with example usage: test_checkpoint_dag_validation(workflow_start_regular) and returns: x, np, average, average, average