code: def test_validate_schema_write_table(tempdir):
      # ARROW-2926
      simple_fields = [
          pa.field("POS", pa.uint32()),
          pa.field("desc", pa.string()),
      ]
  
      simple_schema = pa.schema(simple_fields)
  
      # simple_table schema does not match simple_schema
      simple_from_array = [pa.array([1]), pa.array(["bla"])]
      simple_table = pa.Table.from_arrays(
          simple_from_array, ["POS", "desc"]
      )
  
      path = tempdir / "simple_validate_schema.parquet"
  
      with pq.ParquetWriter(
          path,
          simple_schema,
          version="2.6",
          compression="snappy",
          flavor="spark",
      ) as w:
          with pytest.raises(ValueError):
              w.write_table(simple_table)
  
file_path: arrow/python/pyarrow/tests/parquet/test_parquet_writer.py
imports: import pytest
  import pyarrow
  from pyarrow import fs
  from pyarrow.filesystem import FileSystem, LocalFileSystem
label_desc: Use image node_id 2 for calling a global function with example usage: test_validate_schema_write_table(tempdir) without return types