mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-13 05:25:07 +00:00
add supported properties for notiondb document loader's metadata (#7570)
fix #7569 add following properties for Notion DB document loader's metadata - `unique_id` - `status` - `people` @rlancemartin, @eyurtsev (Since this is a change related to `DataLoaders`) --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
committed by
GitHub
parent
5f17c57174
commit
3f7213586e
@@ -107,6 +107,20 @@ class NotionDBLoader(BaseLoader):
|
|||||||
)
|
)
|
||||||
elif prop_type == "url":
|
elif prop_type == "url":
|
||||||
value = prop_data["url"]
|
value = prop_data["url"]
|
||||||
|
elif prop_type == "unique_id":
|
||||||
|
value = (
|
||||||
|
f'{prop_data["unique_id"]["prefix"]}-{prop_data["unique_id"]["number"]}'
|
||||||
|
if prop_data["unique_id"]
|
||||||
|
else None
|
||||||
|
)
|
||||||
|
elif prop_type == "status":
|
||||||
|
value = prop_data["status"]["name"] if prop_data["status"] else None
|
||||||
|
elif prop_type == "people":
|
||||||
|
value = (
|
||||||
|
[item["name"] for item in prop_data["people"]]
|
||||||
|
if prop_data["people"]
|
||||||
|
else []
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
value = None
|
value = None
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user