pitrou commented on code in PR #13564:
URL: https://github.com/apache/arrow/pull/13564#discussion_r924323793


##########
python/pyarrow/_fs.pyx:
##########
@@ -260,6 +349,48 @@ cdef class FileSelector(_Weakrefable):
         If true, an empty selection is returned.
     recursive : bool, default False
         Whether to recurse into subdirectories.
+
+    Examples
+    --------
+    Generate a file:
+
+    >>> from pyarrow import fs
+    >>> local = fs.LocalFileSystem()
+    >>> path_s = local_path + '/pyarrow-s-example.dat'
+    >>> with local.open_output_stream(path_s) as stream:
+    ...     stream.write(b'data')
+    4
+
+    Create new directory and subdirectory with copied data:
+
+    >>> # directory
+    >>> local.create_dir(local_path + '/alphabet')
+    >>> local.copy_file(path,
+    ...                 local_path + '/alphabet/pyarrow-s-example.dat')
+    >>> # subdirectory
+    >>> local.create_dir(local_path + '/alphabet/subdir')
+    >>> local.copy_file(path,
+    ...                 local_path + '/alphabet/subdir/pyarrow-s-example.dat')

Review Comment:
   Is all this setup code inside the example useful?
   How about making the example non-executable and just show some cooked up 
`get_file_info` results?



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