Closed pdutta777 closed 1 year ago
You will need to pass the entire statement into the exec at the same time, like this:
pyjep.exec("with pa.OSFile('/tmp/dummy.arrow', 'wb') as sink:\n" +
" with pa.ipc.new_file(sink, df.tbl.schema) as writer:\n" +
" for batch in df.tbl.to_batches():\n" +
" writer.write(batch)\n")
Thank you. This is working
I am trying to write an indented "with" statement, and getting this error:
Exception in thread "main" jep.JepException: <class 'IndentationError'>: ('expected an indented block', ('<string>', 1, 54, "with pa.OSFile('/tmp/sparkless.arrow', 'wb') as sink:\n"))
The code block is:
Is there another way to do this? This is with jep 4.1.0