Replies: 1 comment 2 replies
-
The zip files are closing their respective remote files at the end of each Something you could try, is using like the following. I'm not sure if this is simpler or keeps connections better. with fsspec.open_files("sftp://...", ...) as ofs:
for fo in ofs:
with fsspec.open_files("zip://*.csv", fo=fo) as inner_ofs:
for f in inner_ofs:
df = polars.read_csv(f) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Apologies if any of the terminology I use is incorrect. My goal is to connect to an SFTP server, pointed to a directory and then iterate through a series of zip files within that directory and process the inner csv. It's something like this:
Currently, I'm doing something like this:
But that, of course, keeps terminating and reconnecting to the sftp server.
Is there a way for me to specific a directory and open that, maintaining the connection whilst I process the files?
Beta Was this translation helpful? Give feedback.
All reactions