Problem
S3FileSystem has two static helpers that write to a file opened for writing and close it without committing on failure:
Neither uses the filesystem. Both operate only on the S3File they receive, and call its private _close_without_commit() from outside the class. AioS3FileSystem does not inherit S3FileSystem, so it reaches them through its internal filesystem (self._sync_fs._write_and_close(...), self._sync_fs._write_file_and_close(...)), although AioS3File inherits S3File.
Proposed change
Move both helpers to S3File as instance methods, next to _close_without_commit(), and call them on the opened file:
self.open(path, "wb", **kwargs)._write_and_close(value)
self.open(rpath, "wb", ...)._write_file_and_close(local, callback)
Private methods only; no behavior change.
Problem
S3FileSystemhas two static helpers that write to a file opened for writing and close it without committing on failure:S3FileSystem._write_and_close(f, value), added forpipe_file()in Write pipe_file() data without committing a failed write #1003.S3FileSystem._write_file_and_close(f, local, callback), added forput_file()in Leave the existing object unchanged when put_file() fails #1017.Neither uses the filesystem. Both operate only on the
S3Filethey receive, and call its private_close_without_commit()from outside the class.AioS3FileSystemdoes not inheritS3FileSystem, so it reaches them through its internal filesystem (self._sync_fs._write_and_close(...),self._sync_fs._write_file_and_close(...)), althoughAioS3FileinheritsS3File.Proposed change
Move both helpers to
S3Fileas instance methods, next to_close_without_commit(), and call them on the opened file:Private methods only; no behavior change.