AlenkaF commented on code in PR #13582:
URL: https://github.com/apache/arrow/pull/13582#discussion_r921807196
##########
python/pyarrow/fs.py:
##########
@@ -227,16 +227,28 @@ def copy_files(source, destination,
Examples
--------
- Copy an S3 bucket's files to a local directory:
+ Inspect an S3 bucket's files:
- >>> copy_files("s3://your-bucket-name",
- ... "local-directory") # doctest: +SKIP
+ >>> s3, path = fs.FileSystem.from_uri(
+ ... "s3://registry.opendata.aws/roda/ndjson/")
+ >>> selector = fs.FileSelector(path)
+ >>> s3.get_file_info(selector)
+ [<FileInfo for 'registry.opendata.aws/roda/ndjson/index.ndjson':...]
- Using a FileSystem object:
+ Copy one file from S3 bucket to a local directory:
- >>> copy_files("your-bucket-name", "local-directory",
- ... source_filesystem=S3FileSystem(...)) # doctest: +SKIP
+ >>> fs.copy_files("s3://registry.opendata.aws/roda/ndjson/index.ndjson",
+ ... "file:///{}/index_copy.ndjson".format(local_path))
+ >>> selector2 = fs.FileSelector(str(local_path))
+ >>> local.get_file_info(selector2)
Review Comment:
Corrected the proposed change.
Didn't explicitly created a local filesystem as now only `local_path` is
included and I hope that from the name it can be understood what the path links
to. Tried to focus more on `copy_files` method as I agree it makes more sense.
--
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]