jorisvandenbossche commented on a change in pull request #9351:
URL: https://github.com/apache/arrow/pull/9351#discussion_r566220109
##########
File path: python/pyarrow/_dataset.pyx
##########
@@ -84,7 +84,25 @@ cdef CFileSource _make_file_source(object file, FileSystem
filesystem=None):
cdef class Expression(_Weakrefable):
-
+ """
+ A logical expression to be evaluated against some input.
+
+ To create an expression:
+ - Use the factory function ``pyarrow.dataset.scalar()`` to create a
+ scalar (not necessary when combined, see example below).
+ - Use the factory function ``pyarrow.dataset.field()`` to reference
+ a field (column in table).
+ - Compare fields and scalars with ``<``, ``<=``, ``==``, ``>=``, ``>``.
+ - Combine expressions using python operators ``&`` (logical and),
+ ``|`` (logical or) and ``~`` (logical not).
+ Note: python keywords ``and``, ``or`` and ``not`` do not work to
combine expressions.
+
+ Examples:
+ --------
+ >>> from pyarrow.dataset import scalar, field
Review comment:
In the other part of the docs, we use `import pyarrow.dataset as ds`, we
should probably be consistent
(https://arrow.apache.org/docs/python/dataset.html)
##########
File path: python/pyarrow/_dataset.pyx
##########
@@ -84,7 +84,25 @@ cdef CFileSource _make_file_source(object file, FileSystem
filesystem=None):
cdef class Expression(_Weakrefable):
-
+ """
+ A logical expression to be evaluated against some input.
+
+ To create an expression:
+ - Use the factory function ``pyarrow.dataset.scalar()`` to create a
Review comment:
Can you leave a blank line above this one (to separate the text from the
list)?
And the `-` has one extra space before it as indentation, which needs to be
removed in order to render it correctly with sphinx.
(restructured text is quite picky ... ;))
----------------------------------------------------------------
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]