amol- commented on code in PR #13409:
URL: https://github.com/apache/arrow/pull/13409#discussion_r1038141857
##########
python/pyarrow/_dataset.pyx:
##########
@@ -385,6 +416,32 @@ cdef class Dataset(_Weakrefable):
"""The common schema of the full Dataset"""
return pyarrow_wrap_schema(self.dataset.schema())
+ def filter(self, expression):
+ """
+ Apply a row filter to the dataset.
+
+ Parameters
+ ----------
+ expression : Expression
+ The filter that should be applied to the dataset.
+
+ Returns
+ -------
+ Dataset
+ """
+ cdef:
+ Dataset filtered_dataset
+
+ new_filter = expression
+ current_filter = self._scan_options.get("filter")
+ if current_filter is not None and new_filter is not None:
+ new_filter = current_filter & new_filter
Review Comment:
But I don't see what `.filter(None)` could mean if not to unset the current
filter. Would you prefer a dedicated `Dataset.reset_filter()` method?
--
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]