code: def test_parquet_invalid_metadata(
      tmpdir, geo_meta, error, naturalearth_lowres
  ):
      """Has geo metadata with missing required fields will raise a ValueError.
  
      This requires writing the parquet file directly below, so that we can
      control the metadata that is written for this test.
      """
  
      from pyarrow import parquet, Table
  
      df = read_file(naturalearth_lowres)
  
      # convert to DataFrame and encode geometry to WKB
      df = DataFrame(df)
      df["geometry"] = to_wkb(df["geometry"].values)
  
      table = Table.from_pandas(df)
      metadata = table.schema.metadata
      metadata.update(geo_meta)
      table = table.replace_schema_metadata(metadata)
  
      filename = os.path.join(str(tmpdir), "test.pq")
      parquet.write_table(table, filename)
  
      with pytest.raises(ValueError, match=error):
          read_parquet(filename)
  
imports: from __future__ import absolute_import
  from itertools import product
  import json
  from packaging.version import Version
  import os
  import pathlib
  import pytest
  from pandas import DataFrame, read_parquet
  from pandas.testing import assert_frame_equal
  import numpy
  import pyproj
  from shapely.geometry import box, Point, MultiPolygon
  import geopandas
  from geopandas import GeoDataFrame, read_file, read_parquet, read_feather
  from geopandas.array import to_wkb
  from geopandas.io.arrow import SUPPORTED_VERSIONS, _create_metadata, _decode_metadata, _encode_metadata, _geopandas_to_arrow, _get_filesystem_path, _remove_id_from_member_of_ensembles, _validate_dataframe, _validate_metadata, METADATA_VERSION
  from geopandas.testing import assert_geodataframe_equal, assert_geoseries_equal
  from geopandas.tests.util import mock
label_desc: Use image node_id 22 for calling a global function with example usage: test_parquet_invalid_metadata(tmpdir, geo_meta, error, naturalearth_lowres) without return types