code: def test_invalid_task_options(shared_ray_instance):
      """
      Test to ensure options used in DAG binding are applied, and will throw
      as expected even given invalid values.
      """
  
      @ray.remote
      def a():
          return 2
  
      @ray.remote
      def b(x):
          return x * 2
  
      a_ref = a.bind()
      dag = b.bind(a_ref)
  
      # Ensure current DAG is executable
      assert ray.get(dag.execute()) == 4
      with pytest.raises(
          ValueError,
          match=r".*quantity of resource num_cpus cannot be negative.*",
      ):
          invalid_dag = b.options(num_cpus=-1).bind(a_ref)
          ray.get(invalid_dag.execute())
  
file_path: ray/python/ray/dag/tests/test_function_dag.py
imports: import pytest
  import ray
label_desc: Use image node_id 3 for calling a global function with example usage: test_invalid_task_options(shared_ray_instance) and returns: int, unknown