The GridOut object returned from e.g. the gridfs `get` method says it returns a "file-like" object. However, it does not fully conform to any interface of the python standard library io streams class hierarchy (see https://docs.python.org/3/library/io.html#class-hierarchy ).
This makes GridOut objects (unnecessarily) fail with e.g. pyarrow, as it expects other methods to be present. See here: https://gist.github.com/henrifroese/715b14b9891405cf47a013f69ecd7147 for a minimal example and quick explanation why it specifically fails.
The GridOut object already has all functionality in place to make it inherit from IOBase (or at least implement the full interface) without any breaking changes (only adds new functionality), and the IOBase spec (https://docs.python.org/3/library/io.html#i-o-base-classes ) specifies expected behaviour of the "missing" methods, so it should be relatively straightforward to implement.
- is related to
-
PYTHON-2874 Make GridIn implement io.IOBase
- Backlog
- related to
-
PYTHON-1695 GridOut does not implement seekable() from io.IOBase
- Closed
-
PYTHON-209 make GridOut objects in GridFS (more) file-like
- Closed
- links to