AlenkaF commented on code in PR #49355:
URL: https://github.com/apache/arrow/pull/49355#discussion_r2918092064
##########
docs/source/python/dataset.rst:
##########
@@ -569,6 +569,28 @@ calculate the average of a column without loading the
entire column into memory:
... count += batch.num_rows
>>> mean_a = col2_sum/count
+The ``filter`` argument of :meth:`Dataset.to_batches` (and
:func:`~Dataset.to_table`)
+expects a boolean :class:`~pyarrow.dataset.Expression`, which can be
constructed using
+:func:`pyarrow.dataset.field` and its operator overloads. However, if you
already have
+filters in the DNF (Disjunctive Normal Form) list-of-tuples format accepted by
+:class:`pyarrow.parquet.ParquetDataset`, you can convert them to an
``Expression``
+using :func:`pyarrow.parquet.filters_to_expression`:
+
+.. code-block:: python
+
+ >>> dataset.to_table(columns=['a'])
Review Comment:
Oh, my bad:
https://github.com/apache/arrow/actions/runs/22770522332/job/66049956442?pr=49355#step:6:6911
The dataset in memory at this point in the doc is different. Better just to
move it back 😊
```suggestion
>>> dataset = ds.dataset(base / "parquet_dataset", format="parquet")
>>> dataset.to_table()
```
The output will then need to be added here.
--
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]