langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Support GCS Objects with `/` in GCS Loaders

Open vieiralucas opened this issue 1 year ago • 1 comments

So, this is basically fixing the same things as #1517 but for GCS.

Problem

When loading GCS Objects with / in the object key (eg. folder/some-document.txt) using GCSFileLoader, the objects are downloaded into a temporary directory and saved as a file.

This errors out when the parent directory does not exist within the temporary directory.

What this pr does

Creates parent directories based on object key.

This also works with deeply nested keys: folder/subfolder/some-document.txt

vieiralucas avatar Apr 22 '23 18:04 vieiralucas

@vowelparrot just added the suggested comment, also fixed the linting error.

vieiralucas avatar Apr 24 '23 16:04 vieiralucas