(root_path)
| 3908 | |
| 3909 | |
| 3910 | def _create_metadata_file(root_path): |
| 3911 | # create _metadata file from existing parquet dataset |
| 3912 | parquet_paths = list(sorted(root_path.rglob("*.parquet"))) |
| 3913 | schema = pq.ParquetFile(parquet_paths[0]).schema.to_arrow_schema() |
| 3914 | |
| 3915 | metadata_collector = [] |
| 3916 | for path in parquet_paths: |
| 3917 | metadata = pq.ParquetFile(path).metadata |
| 3918 | metadata.set_file_path(str(path.relative_to(root_path))) |
| 3919 | metadata_collector.append(metadata) |
| 3920 | |
| 3921 | metadata_path = root_path / "_metadata" |
| 3922 | pq.write_metadata( |
| 3923 | schema, metadata_path, metadata_collector=metadata_collector |
| 3924 | ) |
| 3925 | return metadata_path |
| 3926 | |
| 3927 | |
| 3928 | def _create_parquet_dataset_partitioned(root_path): |
no test coverage detected