jorisvandenbossche commented on a change in pull request #11245:
URL: https://github.com/apache/arrow/pull/11245#discussion_r719163970



##########
File path: python/pyarrow/_compute.pyx
##########
@@ -670,13 +699,29 @@ class CastOptions(_CastOptions):
 
     @staticmethod
     def safe(target_type=None):
+        """"
+        Cast operation options.

Review comment:
       I would mention on this line that this creates a "safe" cast (although 
that might of course be obvious from the name of the method)

##########
File path: python/pyarrow/_dataset.pyx
##########
@@ -2945,6 +2999,32 @@ cdef class Scanner(_Weakrefable):
                      object columns=None, Expression filter=None,
                      int batch_size=_DEFAULT_BATCH_SIZE,
                      FragmentScanOptions fragment_scan_options=None):
+        """
+        Create Scanner from Dataset
+
+        Parameters
+        ----------
+        dataset : Dataset
+            Dataset to scan.
+        columns : list of str or dict, default None
+                The columns to project.

Review comment:
       ```suggestion
               The columns to project.
   ```

##########
File path: python/pyarrow/_dataset.pyx
##########
@@ -508,12 +508,13 @@ cdef class Dataset(_Weakrefable):
 
 
 cdef class InMemoryDataset(Dataset):
-    """A Dataset wrapping in-memory data.
+    """
+    A Dataset wrapping in-memory data.
 
     Parameters
     ----------
-    source
-        The data for this dataset. Can be a RecordBatch, Table, list of
+    source : The data for this dataset.
+        Can be a RecordBatch, Table, list of

Review comment:
       ```suggestion
       source : 
           The data for this dataset. Can be a RecordBatch, Table, list of
   ```
   
   If some content for the type description is needed, I would add something 
like "table-like"

##########
File path: python/pyarrow/_dataset.pyx
##########
@@ -2945,6 +2999,32 @@ cdef class Scanner(_Weakrefable):
                      object columns=None, Expression filter=None,
                      int batch_size=_DEFAULT_BATCH_SIZE,
                      FragmentScanOptions fragment_scan_options=None):
+        """
+        Create Scanner from Dataset

Review comment:
       The Scanner class docstring itself has mostly the same parameters, but a 
more detailed explanation. Either we can refer to that docstring for more 
details, or we could share the content in some way to avoid duplication.

##########
File path: python/pyarrow/ipc.pxi
##########
@@ -54,6 +54,14 @@ _WriteStats = namedtuple(
 
 class WriteStats(_WriteStats):
     """IPC write statistics
+
+    Parameters
+    ----------
+    num_messages : number of messages.
+    num_record_batches : number of record batches.
+    num_dictionary_batches : number of dictionary batches.
+    num_dictionary_deltas : delta of dictionaries.
+    num_replaced_dictionaries : number of replaced dictionaries.

Review comment:
       Although those can of course still be accessed by the user (so strictly 
speaking it might actually be more logical to list those as "Attributes" 
instead of "Parameters", but OK :))

##########
File path: python/pyarrow/io.pxi
##########
@@ -1430,6 +1441,16 @@ cdef void _cb_transform(transform_func, const 
shared_ptr[CBuffer]& src,
 
 
 cdef class TransformInputStream(NativeFile):
+    """
+    Transform and input stream.

Review comment:
       ```suggestion
       Transform an input stream.
   ```

##########
File path: python/pyarrow/ipc.pxi
##########
@@ -54,6 +54,14 @@ _WriteStats = namedtuple(
 
 class WriteStats(_WriteStats):
     """IPC write statistics
+
+    Parameters
+    ----------
+    num_messages : number of messages.
+    num_record_batches : number of record batches.
+    num_dictionary_batches : number of dictionary batches.
+    num_dictionary_deltas : delta of dictionaries.
+    num_replaced_dictionaries : number of replaced dictionaries.

Review comment:
       In practice those are never created by the user, so not sure how useful 
such a docstring is (except for passing the check ..)

##########
File path: python/pyarrow/fs.py
##########
@@ -256,6 +256,12 @@ class FSSpecHandler(FileSystemHandler):
 
     https://filesystem-spec.readthedocs.io/en/latest/index.html
 
+    Parameters
+    ----------
+    fs : The file system implementation according to FSSpec.
+
+    Example
+    -------

Review comment:
       ```suggestion
       Examples
       --------
   ```




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