From 205dc90746d4c2f64c1dfaf7b5c8cf016eb149b2 Mon Sep 17 00:00:00 2001 From: bholagabbar <11693595+bholagabbar@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:47:42 -0400 Subject: [PATCH] Fix notion title bug (#474) * Update notion_to_jsonl.py * Fix try-catch block --- src/khoj/processor/notion/notion_to_jsonl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/khoj/processor/notion/notion_to_jsonl.py b/src/khoj/processor/notion/notion_to_jsonl.py index 37acb990..ab53c974 100644 --- a/src/khoj/processor/notion/notion_to_jsonl.py +++ b/src/khoj/processor/notion/notion_to_jsonl.py @@ -234,7 +234,11 @@ class NotionToJsonl(TextToJsonl): elif title_field not in properties: logger.error(f"Page {page_id} does not have a title field") return None, None - title = page["properties"][title_field]["title"][0]["text"]["content"] + try: + title = page["properties"][title_field]["title"][0]["text"]["content"] + except Exception as e: + logger.warning(f"Error getting title for page {page_id}: {e}. Setting title as None...") + title = None return title, content def update_entries_with_ids(self, current_entries, previous_entries):