From b87cc8b31e53c0cc063b18dca21ef69ec337f596 Mon Sep 17 00:00:00 2001 From: xiaoyu <719153161@qq.com> Date: Thu, 28 Sep 2023 08:38:05 +0800 Subject: [PATCH] add 3 property types in metadata for notiondb loader (#8509) ### Description: NotionDB supports a number of common property types. I have found three common types that are not included in notiondb loader. When programs loaded them with notiondb, which will cause some metadata information not to be passed to langchain. Therefore, I added three common types: - date - created_time - last_edit_time. ### Issue: no ### Dependencies: No dependencies added :) ### Tag maintainer: @rlancemartin, @eyurtsev ### Twitter handle: @BJTUTC --- libs/langchain/langchain/document_loaders/notiondb.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/langchain/langchain/document_loaders/notiondb.py b/libs/langchain/langchain/document_loaders/notiondb.py index 1f7a67a2a5..bd7a81c896 100644 --- a/libs/langchain/langchain/document_loaders/notiondb.py +++ b/libs/langchain/langchain/document_loaders/notiondb.py @@ -120,6 +120,12 @@ class NotionDBLoader(BaseLoader): if prop_data["people"] else [] ) + elif prop_type == "date": + value = prop_data["date"] + elif prop_type == "created_time": + value = prop_data["created_time"] + elif prop_type == "last_edited_time": + value = prop_data["last_edited_time"] else: value = None