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!
Hello,
I am using the dataiku.Folder class to read files from a container. I am specifically using the file=folder.get_download_stream method to read the file. However, I need to use the seek() method to sets the file's current position at a specific offset. The file object returned however is not seekable and running the file.seekable() method return false. Can I read the file using a method that returns a seekable file object similar to the open(path,file_name) command?
Thanks!
Hi,
to get a seekable object, you'll need to dump the stream from get_downlaod_stream() into a temporary file. The object returned by the API is a HTTP stream, and as such, isn't seekable.