jorisvandenbossche commented on pull request #8317:
URL: https://github.com/apache/arrow/pull/8317#issuecomment-705025495


   Could you add  test for the case I commented about? I think this should do 
it (didn't run the code though):
   
   ```python
   @pytest.mark.parquet
   def test_parquet_fragment_num_row_groups(tempdir):
       import pyarrow.parquet as pq
   
       table = pa.table({'a': range(8)})
       pq.write_table(table, tempdir / "test.parquet", row_group_size=2)
       dataset = ds.dataset(tempdir / "test.parquet", format="parquet")
       original_fragment = list(dataset.get_fragments())[0]
   
       # create fragment with subset of row groups
       fragment = original_fragment.format.make_fragment(
           original_fragment.path, original_fragment.filesystem,
             row_groups=[1, 3])
       assert fragment.num_row_groups == 2
       # ensure that parsing metadata preserves correct number of row groups
       fragment.ensure_complete_metadata()
       assert fragment.num_row_groups == 2
       assert len(fragment.row_groups) == 2
   ```
   
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to