[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Buffer writers and seek method, NativeFile.is_seekable proposal


Hi,

In Arrow C++, various buffer writers define Seek method while in
pyarrow the seek is defined only for buffer readers (for instance,
NativeFile.seek references only rd_file).

So, pyarrow relates 'seekable' strictly to 'readable' file property while
'seekable' would make sense also when a file is 'writeable'. Non-seekable
files would be sockets or pipes but memory buffers like CudaBuffer can be
seekable.

Is there any reason for relating 'seekable' to 'readable-only' within
pyarrow?

I propose introducing is_seekable attribute to NativeFile in order to untie
'seekable' property from 'readable' and 'writable' properties. What do you
think?

Best regards,
Pearu