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:
Tommy Hyeonwoo Kim
2023-07-12 16:34:54 +09:00
committed by GitHub
parent 5f17c57174
commit 3f7213586e

View File

@@ -107,6 +107,20 @@ class NotionDBLoader(BaseLoader):
)
elif prop_type == "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:
value = None