sanjibansg commented on a change in pull request #12560:
URL: https://github.com/apache/arrow/pull/12560#discussion_r838404821



##########
File path: python/pyarrow/_dataset.pyx
##########
@@ -240,14 +240,22 @@ cdef class Dataset(_Weakrefable):
         columns : list of str, default None
             The columns to project. This can be a list of column names to
             include (order and duplicates will be preserved), or a dictionary
-            with {new_column_name: expression} values for more advanced
+            with {{new_column_name: expression}} values for more advanced
             projections.
+
+            The list of columns or expressions may use the special fields
+            like  `__batch_index` (the index of the batch within the 
fragment), 
+            `__fragment_index` (the index of the fragment within the dataset), 
+            `__last_in_fragment` (whether the batch is last in fragment) and
+            `__filename` (the name of the source file or a description of the 
+            source fragment).
+
             The columns will be passed down to Datasets and corresponding data
             fragments to avoid loading, copying, and deserializing columns
             that will not be required further down the compute chain.
-            By default all of the available columns are projected. Raises
-            an exception if any of the referenced column names does not exist
-            in the dataset's Schema.
+            By default all of the available columns are projected. 
+            An error will be returned if any of the referenced column name 
+            does not exist in the dataset's schema.

Review comment:
       Yes I think so, I checked that again.
   If we see here
   https://github.com/apache/arrow/blob/master/python/pyarrow/_dataset.pyx#L2014
   
   then this goes to here,
   https://github.com/apache/arrow/blob/master/python/pyarrow/error.pxi#L99
   which raises an `ArrowInvalid` exception. So, it might be better to mention 
that it raises an exception here.
   
   cc: @westonpace 




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