Creates a simple (flat files, no nested partitioning) Parquet dataset
(root_path)
| 3785 | |
| 3786 | |
| 3787 | def _create_parquet_dataset_simple(root_path): |
| 3788 | """ |
| 3789 | Creates a simple (flat files, no nested partitioning) Parquet dataset |
| 3790 | """ |
| 3791 | |
| 3792 | metadata_collector = [] |
| 3793 | |
| 3794 | for i in range(4): |
| 3795 | table = pa.table({'f1': [i] * 10, 'f2': [random.random() for _ in range(10)]}) |
| 3796 | pq.write_to_dataset( |
| 3797 | table, str(root_path), metadata_collector=metadata_collector |
| 3798 | ) |
| 3799 | |
| 3800 | metadata_path = str(root_path / '_metadata') |
| 3801 | # write _metadata file |
| 3802 | pq.write_metadata( |
| 3803 | table.schema, metadata_path, |
| 3804 | metadata_collector=metadata_collector |
| 3805 | ) |
| 3806 | return metadata_path, table |
| 3807 | |
| 3808 | |
| 3809 | @pytest.mark.parquet |
no outgoing calls
no test coverage detected