code: def test_regenerate_using_row_group_summary_metadata(
      synthetic_dataset, tmpdir
  ):
      a_moved_path = tmpdir.join("moved").strpath
      copytree(synthetic_dataset.path, a_moved_path)
  
      # Make sure we can read dataset before
      _check_reader(a_moved_path)
  
      # Regenerate the metadata (taking the schema information from the common_metadata which exists)
      petastorm_generate_metadata._main(
          [
              "--dataset_url",
              "file://{}".format(a_moved_path),
              "--use-summary-metadata",
          ]
      )
  
      dataset = pq.ParquetDataset(a_moved_path)
      # Metadata path should not exist still (should be only _common_metadata)
      assert dataset.metadata
  
      # Reader should now work again with rowgroup selector since it was in original metadata
      _check_reader(
          a_moved_path, SingleIndexSelector(TestSchema.id.name, [2, 18])
      )
  
file_path: petastorm/petastorm/tests/test_generate_metadata.py
imports: import os
  from collections import namedtuple
  from shutil import copytree
  import pyarrow.parquet
  import pytest
  from petastorm import make_reader
  from petastorm.etl import petastorm_generate_metadata
  from petastorm.selectors import SingleIndexSelector
  from petastorm.tests.test_common import create_test_dataset, TestSchema
label_desc: Use image node_id 4 for calling a global function with example usage: test_regenerate_using_row_group_summary_metadata(synthetic_dataset, tmpdir) without return types