[
https://issues.apache.org/jira/browse/ARROW-1555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16215401#comment-16215401
]
ASF GitHub Bot commented on ARROW-1555:
---------------------------------------
johnjiang commented on a change in pull request #1240: ARROW-1555 [Python]
Implement Dask exists function
URL: https://github.com/apache/arrow/pull/1240#discussion_r146322137
##########
File path: python/pyarrow/filesystem.py
##########
@@ -251,6 +251,10 @@ def isfile(self, path):
def delete(self, path, recursive=False):
return self.fs.rm(path, recursive=recursive)
+ @implements(FileSystem.exists)
+ def exists(self, path):
+ return os.path.exists(path)
Review comment:
I wrote my own wrapper to get around this issue and I realised that pyarrow
would try and create a directory if 'exists' returns False. This is an issue on
s3 since there's no concept of directories. So what ends up happening is that
there's a duplicate file with the same name as the directory.
You almost need to remove the `exists()` check for s3 filesystem.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [Python] write_to_dataset on s3
> -------------------------------
>
> Key: ARROW-1555
> URL: https://issues.apache.org/jira/browse/ARROW-1555
> Project: Apache Arrow
> Issue Type: Bug
> Affects Versions: 0.7.0
> Reporter: Young-Jun Ko
> Assignee: Florian Jetter
> Priority: Trivial
> Labels: pull-request-available
> Fix For: 0.8.0
>
>
> When writing a arrow table to s3, I get an NotImplemented Exception.
> The root cause is in _ensure_filesystem and can be reproduced as follows:
> import pyarrow
> import pyarrow.parquet as pqa
> import s3fs
> s3 = s3fs.S3FileSystem()
> pqa._ensure_filesystem(s3).exists("anything")
> It appears that the S3FSWrapper that is instantiated in _ensure_filesystem
> does not expose the exist method of s3.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)