code: def test_metadata_append_row_groups_diff(t1, t2, expected_error):
      table1 = pa.table(t1)
      table2 = pa.table(t2)
  
      buf1 = io.BytesIO()
      buf2 = io.BytesIO()
      pq.write_table(table1, buf1)
      pq.write_table(table2, buf2)
      buf1.seek(0)
      buf2.seek(0)
  
      meta1 = pq.ParquetFile(buf1).metadata
      meta2 = pq.ParquetFile(buf2).metadata
  
      if expected_error:
          # Error clearly defines it's happening at append row groups call
          prefix = "AppendRowGroups requires equal schemas.\n"
          with pytest.raises(
              RuntimeError, match=prefix + expected_error
          ):
              meta1.append_row_groups(meta2)
      else:
          meta1.append_row_groups(meta2)
  
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 22 for calling a global function with example usage: test_metadata_append_row_groups_diff(t1, t2, expected_error) without return types