This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e3f26af65 ARROW-16093: [Python] Address docstrings in Filesystems 
(Python Implementations) (#13595)
6e3f26af65 is described below

commit 6e3f26af658bfca602e711ea326f1985b62bca1d
Author: Alenka Frim <[email protected]>
AuthorDate: Tue Jul 19 20:14:20 2022 +0200

    ARROW-16093: [Python] Address docstrings in Filesystems (Python 
Implementations) (#13595)
    
    Lead-authored-by: Alenka Frim <[email protected]>
    Co-authored-by: Alenka Frim <[email protected]>
    Signed-off-by: Antoine Pitrou <[email protected]>
---
 python/pyarrow/_fs.pyx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/python/pyarrow/_fs.pyx b/python/pyarrow/_fs.pyx
index bfcff81a5c..e5a7d7cb14 100644
--- a/python/pyarrow/_fs.pyx
+++ b/python/pyarrow/_fs.pyx
@@ -1035,6 +1035,23 @@ cdef class PyFileSystem(FileSystem):
     ----------
     handler : FileSystemHandler
         The handler object implementing custom filesystem behavior.
+
+    Examples
+    --------
+    Create an fsspec-based filesystem object for GitHub:
+
+    >>> from fsspec.implementations import github
+    >>> gfs = github.GithubFileSystem('apache', 'arrow', 
sha='ec51aec4d15035f4d9d6a1c4346d0a2b9a37fb75')
+
+    Get a PyArrow FileSystem object:
+
+    >>> from pyarrow.fs import PyFileSystem, FSSpecHandler
+    >>> pa_fs = PyFileSystem(FSSpecHandler(gfs))
+
+    Use :func:`~pyarrow.fs.FileSystem` functionality ``get_file_info()``:
+
+    >>> pa_fs.get_file_info('README.md')
+    <FileInfo for 'README.md': type=FileType.File, size=5302>
     """
 
     def __init__(self, handler):

Reply via email to