Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
some update to prevent errors when transforming data
Browse files Browse the repository at this point in the history
  • Loading branch information
msftwarelab committed Aug 28, 2023
1 parent 7172088 commit f983b86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llama_hub/wordlift/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def transform_data(self, data: dict) -> List[Document]:
metadata_fields = self.configure_options.get('metadata_fields', [])

for item in data:
if not all(key in item for key in text_fields):
logging.warning(
f"Skipping document due to missing text fields: {item}")
continue
row = {}
for key, value in item.items():
if key in text_fields or key in metadata_fields:
Expand Down

0 comments on commit f983b86

Please sign in to comment.