From 96f8fb1d9533227628fa3236914ce16025e290a5 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 11 Oct 2021 17:00:38 +0200 Subject: [PATCH] ARROW-13525: [Python] Mention alternative deprecation message for ParquetDataset.partitions --- python/pyarrow/parquet.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/python/pyarrow/parquet.py b/python/pyarrow/parquet.py index ad4d876b00e..267ecbf0dbf 100644 --- a/python/pyarrow/parquet.py +++ b/python/pyarrow/parquet.py @@ -1529,7 +1529,11 @@ def pieces(self): @property def partitions(self): warnings.warn( - _DEPR_MSG.format("ParquetDataset.partitions", ""), + _DEPR_MSG.format( + "ParquetDataset.partitions", + " Specify 'use_legacy_dataset=False' while constructing the " + "ParquetDataset, and then use the '.partitioning' attribute " + "instead."), DeprecationWarning, stacklevel=2) return self._partitions @@ -1811,6 +1815,13 @@ def files(self): def filesystem(self): return self._dataset.filesystem + @property + def partitioning(self): + """ + The partitioning of the Dataset source, if discovered. + """ + return self._dataset.partitioning + _read_table_docstring = """ {0}