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

Re: saving image object on GCS from DoFn

You need to close the file object, I think that should fix the issue.

On Fri, Apr 27, 2018, 7:47 AM OrielResearch Eila Arich-Landkof <eila@xxxxxxxxxxxxxxxxx> wrote:
I tried with the following code: 
No error was fired but the file was not created as well

import as filesystems
fileHandle = filesystems.FileSystems.create(path="gs://bucket/try.png"), "PNG")

Could I save it locally on the working machine and copy to gs://
is there any unseen data risk involved with that?
the code will be the following:"try.png", "PNG")
!gsutil cp try.png gs://bucket/try.png

Please let me know what your thoughts are


On Thu, Apr 26, 2018 at 2:00 PM, Eugene Kirpichov <kirpichov@xxxxxxxxxx> wrote:
You can use FileSystems.create() to create a file on gs:// and you can pass the result of that method to

On Thu, Apr 26, 2018, 9:02 AM OrielResearch Eila Arich-Landkof <eila@xxxxxxxxxxxxxxxxx> wrote:
Hello all,

I am running the following simplified code from DoFn (ParDo)
from PIL import Image

img = Image.fromarray(array)'testrgb.png') with gs:// drive does not work.
What would be the recommended way to save the img object on google drive as .png file
any advice is appreciated

Many thanks,


( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-beam-users/msg02177.html on line 75
Call Stack
10.0009372760{main}( ).../msg02177.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-beam-users/msg02177.html on line 75
Call Stack
10.0009372760{main}( ).../msg02177.html:0