code: def test_coerce_int96_timestamp_overflow(pq_reader_method, tempdir):
      def get_table(pq_reader_method, filename, **kwargs):
          if pq_reader_method == "ParquetFile":
              return pq.ParquetFile(filename, **kwargs).read()
          elif pq_reader_method == "read_table":
              return pq.read_table(filename, **kwargs)
  
      # Recreating the initial JIRA issue referenced in ARROW-12096
      oob_dts = [
          datetime.datetime(1000, 1, 1),
          datetime.datetime(2000, 1, 1),
          datetime.datetime(3000, 1, 1),
      ]
      df = pd.DataFrame({"a": oob_dts})
      table = pa.table(df)
  
      filename = tempdir / "test_round_trip_overflow.parquet"
      pq.write_table(
          table,
          filename,
          use_deprecated_int96_timestamps=True,
          version="1.0",
      )
  
      # with the default resolution of ns, we get wrong values for INT96
      # that are out of bounds for nanosecond range
      tab_error = get_table(pq_reader_method, filename)
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              "Discarding nonzero nanoseconds in conversion",
              UserWarning,
          )
          assert tab_error["a"].to_pylist() != oob_dts
  
      # avoid this overflow by specifying the resolution to use for INT96 values
      tab_correct = get_table(
          pq_reader_method, filename, coerce_int96_timestamp_unit="s"
      )
      df_correct = tab_correct.to_pandas(timestamp_as_object=True)
      tm.assert_frame_equal(df, df_correct)
  
file_path: arrow/python/pyarrow/tests/parquet/test_datetime.py
imports: import datetime
  import io
  import warnings
  import numpy
  import pytest
  import pyarrow
  from pyarrow.tests.parquet.common import _check_roundtrip
label_desc: Use image node_id 7 for calling a global function with example usage: test_coerce_int96_timestamp_overflow(pq_reader_method, tempdir) and returns: pq, pq