Story #4316
closedReview 3603-pysdk-file-api-wip
Added by Brett Smith about 10 years ago. Updated about 10 years ago.
100%
Updated by Brett Smith about 10 years ago
- Tracker changed from Task to Story
- Target version changed from Arvados Future Sprints to 2014-11-19 sprint
Updated by Brett Smith about 10 years ago
- Assigned To changed from Peter Amstutz to Tim Pierce
Updated by Brett Smith about 10 years ago
- Assigned To changed from Tim Pierce to Brett Smith
Taking this back because I'm going to have to resolve some merge conflicts with a branch Tom is working on.
Updated by Peter Amstutz about 10 years ago
- As discussed briefly in IRC, consider having slightly different behavior for StreamFileReader() based on how it is accessed. If accessed using existing Arvados methods, preserve existing behavior; if accessed using the new open() method, tweak the behavior to be maximally compatible as a Python file-like object.
- For example, the behavior of seek()
- Going down the documented API for file-like objects, there's a few small things that could be added:
- A no-op flush() method
- readline() takes an optional size parameter (maximum line length)
- readlines() takes an optional size hint (approximate amount of total data to be read)
- Regarding isatty():
"If a file-like object is not associated with a real file, this method should not be implemented."
Updated by Peter Amstutz about 10 years ago
- Assigned To changed from Peter Amstutz to Brett Smith
Updated by Brett Smith about 10 years ago
Peter Amstutz wrote:
- As discussed briefly in IRC, consider having slightly different behavior for StreamFileReader() based on how it is accessed.
We reviewed existing Crunch scripts, and found none that are using seek, or obviously relying on the decompression behavior in readlines. We'll take this opportunity to make a clean break and have our API be compatible with Python's as much as possible. All kinds of stuff is using the name() method, so we need to preserve backwards compatibility there.
- Going down the documented API for file-like objects, there's a few small things that could be added:
Implemented all of these. Even made flush() meaningful.
- Regarding isatty():
"If a file-like object is not associated with a real file, this method should not be implemented."
Thanks for catching that. Removed. Ready for another look at 409a1a9.
Updated by Brett Smith about 10 years ago
- Assigned To changed from Brett Smith to Peter Amstutz
Updated by Peter Amstutz about 10 years ago
- Assigned To changed from Peter Amstutz to Brett Smith
LGTM
Updated by Brett Smith about 10 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset arvados|commit:26aa2f1a1c8c9883beac1538c318279190f91c8a.