code: def test_project(table_source):
      # default name from expression
      decl = Declaration.from_sequence(
          [
              table_source,
              Declaration(
                  "project",
                  ProjectNodeOptions([pc.multiply(field("a"), 2)]),
              ),
          ]
      )
      result = decl.to_table()
      assert result.schema.names == ["multiply(a, 2)"]
      assert result[0].to_pylist() == [2, 4, 6]
  
      # provide name
      decl = Declaration.from_sequence(
          [
              table_source,
              Declaration(
                  "project",
                  ProjectNodeOptions(
                      [pc.multiply(field("a"), 2)], ["a2"]
                  ),
              ),
          ]
      )
      result = decl.to_table()
      assert result.schema.names == ["a2"]
      assert result["a2"].to_pylist() == [2, 4, 6]
  
      # input validation
      with pytest.raises(ValueError):
          ProjectNodeOptions([pc.multiply(field("a"), 2)], ["a2", "b2"])
  
      # no scalar expression
      decl = Declaration.from_sequence(
          [
              table_source,
              Declaration(
                  "project", ProjectNodeOptions([pc.sum(field("a"))])
              ),
          ]
      )
      with pytest.raises(
          ValueError, match="cannot Execute non-scalar expression"
      ):
          _ = decl.to_table()
  
file_path: arrow/python/pyarrow/tests/test_acero.py
imports: import pytest
  import pyarrow
  import pyarrow.compute
  from pyarrow.compute import field
label_desc: Use image node_id 7 for calling a global function with example usage: test_project(table_source) without return types