AlenkaF commented on code in PR #12704:
URL: https://github.com/apache/arrow/pull/12704#discussion_r844914420


##########
python/pyarrow/parquet.py:
##########
@@ -1678,10 +2024,104 @@ def fs(self):
             DeprecationWarning, stacklevel=2)
         return self._metadata.fs
 
-    common_metadata = property(
+    _common_metadata = property(
         operator.attrgetter('_metadata.common_metadata')
     )
 
+    @property
+    def common_metadata(self):
+        """
+        DEPRECATED
+        """
+        warnings.warn(
+            _DEPR_MSG.format("ParquetDataset.common_metadata", ""),
+            DeprecationWarning, stacklevel=2)
+        return self._metadata.common_metadata
+
+    @property
+    def fragments(self):
+        """
+        A list of the Dataset source fragments or pieces with absolute
+        file paths. To use this property set 'use_legacy_dataset=False'
+        while constructing ParquetDataset object.
+
+        Examples
+        --------
+        Generate an example dataset:
+
+        >>> import pyarrow as pa
+        >>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],
+        ...                   'n_legs': [2, 2, 4, 4, 5, 100],
+        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
+        ...                              "Brittle stars", "Centipede"]})
+        >>> import pyarrow.parquet as pq
+        >>> pq.write_to_dataset(table, root_path='dataset_name_fragments',
+        ...                     partition_cols=['year'],
+        ...                     use_legacy_dataset=False)
+        >>> dataset = pq._ParquetDatasetV2('dataset_name_fragments/')
+
+        List the fragments:
+
+        >>> dataset.fragments
+        [<pyarrow.dataset.ParquetFileFragment path=dataset_name_fragments/...
+        """
+        raise NotImplementedError(
+            "To use this property set 'use_legacy_dataset=False' while "
+            "constructing the ParquetDataset")
+
+    @property
+    def files(self):
+        """
+        A list of absolute Parquet file paths in the Dataset source.
+        To use this property set 'use_legacy_dataset=False'
+        while constructing ParquetDataset object.
+
+        Examples
+        --------
+        Generate an example dataset:
+
+        >>> import pyarrow as pa
+        >>> table = pa.table({'year': [2020, 2022, 2021, 2022, 2019, 2021],
+        ...                   'n_legs': [2, 2, 4, 4, 5, 100],
+        ...                   'animal': ["Flamingo", "Parrot", "Dog", "Horse",
+        ...                              "Brittle stars", "Centipede"]})
+        >>> import pyarrow.parquet as pq
+        >>> pq.write_to_dataset(table, root_path='dataset_name_files',
+        ...                     partition_cols=['year'],
+        ...                     use_legacy_dataset=False)
+        >>> dataset = pq._ParquetDatasetV2('dataset_name_files/')

Review Comment:
   Oh, of course! Will correct.



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to