[Community][minor]: Updating metadata with full_path in SharePoint loader (#25593)

- **Description:** Updating metadata for sharepoint loader with full
path i.e., webUrl
- **Issue:** NA
- **Dependencies:** NA
- **Tests:** NA
- **Docs** NA

Co-authored-by: dristy.cd <dristy@clouddefense.io>
Co-authored-by: ccurme <chester.curme@gmail.com>
This commit is contained in:
Dristy Srivastava 2024-08-21 18:40:14 +05:30 committed by GitHub
parent 34d0417eb5
commit b002702af6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,6 +78,7 @@ class SharePointLoader(O365BaseLoader, BaseLoader):
auth_identities = self.authorized_identities(file_id)
if self.load_extended_metadata is True:
extended_metadata = self.get_extended_metadata(file_id)
extended_metadata.update({"source_full_url": target_folder.web_url})
for parsed_blob in blob_parser.lazy_parse(blob):
if self.load_auth is True:
parsed_blob.metadata["authorized_identities"] = auth_identities
@ -94,6 +95,7 @@ class SharePointLoader(O365BaseLoader, BaseLoader):
auth_identities = self.authorized_identities(file_id)
if self.load_extended_metadata is True:
extended_metadata = self.get_extended_metadata(file_id)
extended_metadata.update({"source_full_url": target_folder.web_url})
for parsed_blob in blob_parser.lazy_parse(blob):
if self.load_auth is True:
parsed_blob.metadata["authorized_identities"] = auth_identities
@ -130,6 +132,9 @@ class SharePointLoader(O365BaseLoader, BaseLoader):
blob_part.metadata["authorized_identities"] = auth_identities
if self.load_extended_metadata is True:
blob_part.metadata.update(extended_metadata)
blob_part.metadata.update(
{"source_full_url": target_folder.web_url}
)
yield blob_part
def authorized_identities(self, file_id: str) -> List: