Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I need to read contents of a jsonfile stored in a dataiku managed folder. Need the code for doing the same with dataikuapi package.
import dataikuapi
client = dataikuapi.DSSClient(host, apiKey)
client._session.verify = False
project = client.get_project("xxxxxxxxxxxxx")
managedfolder = project.get_managed_folder("xxxxxxxxxxxxxxxxx")
import json
with managedfolder.get_file('xxxxxx.json') as fd:
f = json.loads(fd.raw)
TypeError: the JSON object must be str, bytes or bytearray, not 'HTTPResponse'
Hi @ssuhas76,
Because get_file() returns a requests Response, you can use Response.json() to read it:
with managedfolder.get_file('xxxxxx.json') as fd:
f = fd.json()