mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Fix notion title bug (#474)
* Update notion_to_jsonl.py * Fix try-catch block
This commit is contained in:
parent
922222a813
commit
205dc90746
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
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):
|
||||
|
|
Loading…
Reference in a new issue