Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
kszucs committed Sep 24, 2019
1 parent c0b9162 commit 45a2a17
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 13 deletions.
31 changes: 19 additions & 12 deletions python/pyarrow/_fs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ cdef class Selector:
Parameters
----------
base_dir : str or pathlib.Path
base_dir : str
The directory in which to select files. Relative paths also work, use
'.' for the current directory and '..' for the parent.
allow_non_existent : bool, default False
Expand Down Expand Up @@ -224,7 +224,7 @@ cdef class FileSystem:
Parameters
----------
path : str or pathlib.Path
path : str
The path of the new directory.
recursive: bool, default True
Create nested directories as well.
Expand All @@ -238,7 +238,7 @@ cdef class FileSystem:
Parameters
----------
path : str or pathlib.Path
path : str
The path of the directory to be deleted.
"""
cdef c_string directory = _path_as_bytes(path)
Expand All @@ -255,9 +255,9 @@ cdef class FileSystem:
Parameters
----------
src : str or pathlib.Path
src : str
The path of the file or the directory to be moved.
dest : str or pathlib.Path
dest : str
The destination path where the file or directory is moved to.
"""
cdef:
Expand All @@ -274,9 +274,9 @@ cdef class FileSystem:
Parameters
----------
src : str or pathlib.Path
src : str
The path of the file to be copied from.
dest : str or pathlib.Path
dest : str
The destination path where the file is copied to.
"""
cdef:
Expand All @@ -290,7 +290,7 @@ cdef class FileSystem:
Parameters
----------
path : str or pathlib.Path
path : str
The path of the file to be deleted.
"""
cdef c_string file = _path_as_bytes(path)
Expand Down Expand Up @@ -320,7 +320,7 @@ cdef class FileSystem:
Parameters
----------
path : Union[str, pathlib.Path]
path : str
The source to open for reading.
Returns
Expand All @@ -344,7 +344,7 @@ cdef class FileSystem:
Parameters
----------
source: str or pathlib.Path
source: str
The source to open for reading.
compression: str optional, default 'detect'
The compression algorithm to use for on-the-fly decompression.
Expand Down Expand Up @@ -383,7 +383,7 @@ cdef class FileSystem:
Parameters
----------
path : str or pathlib.Path
path : str
The source to open for writing.
compression: str optional, default 'detect'
The compression algorithm to use for on-the-fly compression.
Expand Down Expand Up @@ -421,7 +421,7 @@ cdef class FileSystem:
Parameters
----------
path : str or pathlib.Path
path : str
The source to open for writing.
compression: str optional, default 'detect'
The compression algorithm to use for on-the-fly compression.
Expand Down Expand Up @@ -479,6 +479,13 @@ cdef class SubTreeFileSystem(FileSystem):
Note, that this makes no security guarantee. For example, symlinks may
allow to "escape" the subtree and access other parts of the underlying
filesystem.
Parameters
----------
base_path: str
The root of the subtree.
base_fs: FileSystem
FileSystem object the operations delegated to.
"""

def __init__(self, base_path, FileSystem base_fs):
Expand Down
23 changes: 23 additions & 0 deletions python/pyarrow/_s3.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,29 @@ def finalize_s3():


cdef class S3FileSystem(FileSystem):
"""S3-backed FileSystem implementation
Note: S3 buckets are special and the operations available on them may be
limited or more expensive than desired.
Parameters
----------
access_key: str, default None
AWS Access Key ID. Pass None to use the standard AWS environment
variables and/or configuration file.
secret_key: str, default None
AWS Secret Access key. Pass None to use the standard AWS environment
variables and/or configuration file.
region: str, default 'us-east-1'
AWS region to connect to.
scheme: str, default 'https'
S3 connection transport scheme.
endpoint_override: str, default None
Override region with a connect string such as "localhost:9000"
background_writes: boolean, default True
Whether OutputStream writes will be issued in the background, without
blocking.
"""

cdef:
CS3FileSystem* s3fs
Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
LocalFileSystem,
SubTreeFileSystem
)
from pyarrow._s3 import S3FileSystem

try:
from pyarrow._s3 import S3FileSystem, initialize_s3, finalize_s3 # noqa
except ImportError:
Expand Down

0 comments on commit 45a2a17

Please sign in to comment.