Make GridOut implement full io.IOBase spec

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Unknown
    • 4.0
    • Affects Version/s: None
    • Component/s: GridFS
    • None
    • None
    • Minor Change
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Shane Harvey
            Reporter:
            Henri Froese
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: