You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "milesgranger (via GitHub)" <gi...@apache.org> on 2023/11/21 07:57:23 UTC
[PR] MINOR: [Python] Add append mode for pyarrow.OsFile [arrow]
milesgranger opened a new pull request, #38820:
URL: https://github.com/apache/arrow/pull/38820
### Rationale for this change
Seems reasonable. :)
### What changes are included in this PR?
Exposes the C++ append parameter to PyArrow.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Can add `a` or `ab` to `mode` parameter in `pyarrow.OsFile`
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "jorisvandenbossche (via GitHub)" <gi...@apache.org>.
jorisvandenbossche commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1836026347
Thanks Miles! ;)
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1829700949
Ah, thank you for looking into it.
I am not sure how to handle `'ab'` mode in connection to the `NativeFile` class. I do not see an issue if `OSFile` subclass handles extra append mode and `NativeFile` does not. @jorisvandenbossche what do you think?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on code in PR #38820:
URL: https://github.com/apache/arrow/pull/38820#discussion_r1407638387
##########
python/pyarrow/io.pxi:
##########
@@ -1113,6 +1113,17 @@ cdef class OSFile(NativeFile):
'rb'
b'OSFile'
+ Open the file to append:
+
+ >>> with pa.OSFile('example_osfile.arrow', mode='ab') as f:
+ ... f.write(b' is super!')
+ ...
+ 10
+ >>> with pa.OSFile('example_osfile.arrow') as f:
+ ... f.read()
+ ...
+ b'OSFile is super!'
Review Comment:
😃
##########
python/pyarrow/io.pxi:
##########
@@ -1113,6 +1113,17 @@ cdef class OSFile(NativeFile):
'rb'
b'OSFile'
+ Open the file to append:
+
+ >>> with pa.OSFile('example_osfile.arrow', mode='ab') as f:
+ ... f.write(b' is super!')
+ ...
+ 10
+ >>> with pa.OSFile('example_osfile.arrow') as f:
+ ... f.read()
+ ...
+ b'OSFile is super!'
Review Comment:
😃
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1833516898
I also think is unrelated. I've opened https://github.com/apache/arrow/issues/39003 to track it.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1823840700
:warning: GitHub issue #38857 **has been automatically assigned in GitHub** to PR creator.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1831940667
> Should I go about adding a `is_appendable` to facilitate returning an 'ab'?
You could add a private `_is_appending` attribute that would default to False.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1834289368
Thanks! 👋
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "milesgranger (via GitHub)" <gi...@apache.org>.
milesgranger commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1833438668
Failure [seems unrelated.](https://github.com/apache/arrow/actions/runs/7043964332/job/19170722190?pr=38820)
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "milesgranger (via GitHub)" <gi...@apache.org>.
milesgranger commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1829641866
Thanks for the review @AlenkaF.
In adding the doc example and looking at `test_native_file_modes`, I see that [`NativeFile.mode`](https://github.com/apache/arrow/blob/c614014db805caf3bbc4d5270bd990c095bf8725/python/pyarrow/io.pxi#L135) plays only with 'is_readable' and 'is_writable'.
Should I go about adding a `is_appendable` to facilitate returning a 'ab'?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF merged PR #38820:
URL: https://github.com/apache/arrow/pull/38820
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "milesgranger (via GitHub)" <gi...@apache.org>.
milesgranger commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1823840966
Ah, how embarrassing. Issue created and and title updated as requested!
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1836630028
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 92fe831c900bdffcd5517cf6af61aabb962bef3f.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/19231444402) has more details. It also includes information about 5 possible false positives for unstable benchmarks that are known to sometimes produce them.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-38857: [Python] Add append mode for pyarrow.OsFile [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #38820:
URL: https://github.com/apache/arrow/pull/38820#issuecomment-1833478439
I have rerun it just in case.
LGTM otherwise, thank you!
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org