code: def test_parquet_metadata_lifetime(tempdir):
      # ARROW-6642 - ensure that chained access keeps parent objects alive
      table = pa.table({"a": [1, 2, 3]})
      pq.write_table(table, tempdir / "test_metadata_segfault.parquet")
      parquet_file = pq.ParquetFile(
          tempdir / "test_metadata_segfault.parquet"
      )
      parquet_file.metadata.row_group(0).column(0).statistics
  
imports: import datetime
  import decimal
  from collections import OrderedDict
  import io
  import numpy
  import pytest
  import pyarrow
  from pyarrow.tests.parquet.common import _check_roundtrip, make_sample_file
  from pyarrow.fs import LocalFileSystem
  from pyarrow.tests import util
label_desc: Use image node_id 2 for calling a global function with example usage: test_parquet_metadata_lifetime(tempdir) without return types