write pdf file to dataiku folder using python
jalkhonaifer
Partner, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1 Partner
I am trying to write a pdf filer to dataiku folder.
usually I can write pdf file in my device with:
with open(outputFile, "wb") as outputStream:
output.write(outputStream)
but it doesnt work withing Dataiku
Also I tried to use this:
with open(os.path.join('Folder Location', "file.pdf")) as outputStream:
output.write(outputStream)
and it gives this error as there is no file that exists there
FileNotFoundError: [Errno 2] No such file or directory:
Operating system used: windows
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,184 Neuron
First issue, Dataiku's dirty little secret: it doesn't actually create the folder in the file system until you put a file in it. Go to your flow and add a dummy file to the folder manually.
Second issue you can't write directly to a Dataiku folder, use either upload_steam or upload_file: