diff --git a/fsspec/implementations/arrow.py b/fsspec/implementations/arrow.py index 9e638b20a..bdc80ae97 100644 --- a/fsspec/implementations/arrow.py +++ b/fsspec/implementations/arrow.py @@ -200,7 +200,18 @@ def modified(self, path): @mirror_from( - "stream", ["read", "seek", "tell", "write", "readable", "writable", "close", "size"] + "stream", + [ + "read", + "seek", + "tell", + "write", + "readable", + "writable", + "close", + "size", + "seekable", + ], ) class ArrowFile(io.IOBase): def __init__(self, fs, stream, path, mode, block_size=None, **kwargs): diff --git a/fsspec/implementations/tests/test_arrow.py b/fsspec/implementations/tests/test_arrow.py index 68ac1802b..d788316e7 100644 --- a/fsspec/implementations/tests/test_arrow.py +++ b/fsspec/implementations/tests/test_arrow.py @@ -219,3 +219,14 @@ def test_open_seekable(fs, remote_dir): with fs.open(remote_dir + "/a.txt", "rb", seekable=True) as file: file.seek(2) assert file.read() == data[2:] + + +def test_seekable(fs, remote_dir): + data = b"dvc.org" + + with fs.open(remote_dir + "/a.txt", "wb") as stream: + stream.write(data) + + for seekable in [True, False]: + with fs.open(remote_dir + "/a.txt", "rb", seekable=seekable) as file: + assert file.seekable() == seekable