We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b2039c commit 35da646Copy full SHA for 35da646
fsspec/implementations/arrow.py
@@ -157,7 +157,7 @@ def rm(self, path, recursive=False, maxdepth=None):
157
self.fs.delete_file(path)
158
159
@wrap_exceptions
160
- def _open(self, path, mode="rb", block_size=None, seekable=False, **kwargs):
+ def _open(self, path, mode="rb", block_size=None, seekable=True, **kwargs):
161
if mode == "rb":
162
if seekable:
163
method = self.fs.open_input_file
@@ -202,6 +202,14 @@ def modified(self, path):
202
path = self._strip_protocol(path)
203
return self.fs.get_file_info(path).mtime
204
205
+ def cat_file(self, path, start=None, end=None, **kwargs):
206
+ kwargs["seekable"] = start not in [None, 0]
207
+ return super().cat_file(path, start=None, end=None, **kwargs)
208
+
209
+ def get_file(self, rpath, lpath, **kwargs):
210
+ kwargs["seekable"] = False
211
+ super().get_file(rpath, lpath, **kwargs)
212
213
214
@mirror_from(
215
"stream",
fsspec/implementations/tests/test_arrow.py
@@ -236,3 +236,8 @@ def test_seekable(fs, remote_dir):
236
for seekable in [True, False]:
237
with fs.open(remote_dir + "/a.txt", "rb", seekable=seekable) as file:
238
assert file.seekable() == seekable
239
+ assert file.read() == data
240
241
+ with fs.open(remote_dir + "/a.txt", "rb", seekable=False) as file:
242
+ with pytest.raises(IOError):
243
+ file.seek(5)
0 commit comments