AlenkaF commented on code in PR #51631:
URL: https://github.com/apache/arrow/pull/51631#discussion_r4441582714


##########
python/pyarrow/io.pxi:
##########
@@ -193,6 +193,20 @@ cdef class NativeFile(_Weakrefable):
                 else:
                     check_status(self.output_stream.get().Close())
 
+    def abort(self):
+        """
+        Close the stream, discarding written data if the stream supports it.

Review Comment:
   Data is discarded for S3 output stream aborts. For other streams 
`abort()`behaves like `close()`. Could we make this more explicit in the 
docstring?
   
   Data is only discarded for S3 output streams at the moment; for other 
streams abort() behaves like close() and the written data is kept. Could the 
docstring say this explicitly instead of "if the stream supports it"?



##########
python/pyarrow/io.pxi:
##########
@@ -193,6 +193,20 @@ cdef class NativeFile(_Weakrefable):
                 else:
                     check_status(self.output_stream.get().Close())
 
+    def abort(self):

Review Comment:
   `PythonFile::Abort()` looks different from `Close()`:
   
   
https://github.com/apache/arrow/blob/656065b2c9d4b060edef56773d9d20f1d5a6e1ad/python/pyarrow/src/arrow/python/io.cc#L68-L70
   
   It would be good to check what happens to a `PythonFile` object (e.g. with 
the `FSSpecHandler` fixtures). I haven't checked other `NativeFile` subclasses.



-- 
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]

Reply via email to