-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flush
doesn't create or upload the file until the file is closed
#484
Comments
There are two ways to write a file ("key") to GCS: a single upload, or a multi-part upload. For the first, it's a one-shot deal, to close and flush are necessarily the same (we do this for small files). |
Thanks a lot! After reading a bit more into the limitations, I think I understood them. I suppose, the only "easy" workaround is to re-upload the entire file every time there's a The workaround I am likely going to use, given the immutability of the final objects, is, to upload parts of the stream into separate intermediate files if the "flush" is called, and if that happened, once the file is closed, perform the analogue of I wonder if this approach could be translated to a more general one. |
You can use the |
fsspec
version2022.5.0
gcsfs
version2022.5.0
Code to reproduce:
Upon debugging
flush
call, it seems that the checkself.buffer.tell() < self.blocksize
is alwaysTrue
, because the way things are implemented,self.buffer.tell()
returns 0.Furthermore, if I call manually what is in
fsspec
flush
implementation after the check, meaning this code:the file is still not created, although the underlying code in
_upload_chunk
does something.The text was updated successfully, but these errors were encountered: