mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-18 20:10:58 +02:00
Black fixes for python files
This commit is contained in:
parent
ab3bb13493
commit
7ad98480be
@ -18,6 +18,7 @@ from danswer.connectors.models import Section
|
|||||||
@dataclass
|
@dataclass
|
||||||
class NotionPage:
|
class NotionPage:
|
||||||
"""Represents a Notion Page object"""
|
"""Represents a Notion Page object"""
|
||||||
|
|
||||||
id: str
|
id: str
|
||||||
created_time: str
|
created_time: str
|
||||||
last_edited_time: str
|
last_edited_time: str
|
||||||
@ -35,6 +36,7 @@ class NotionPage:
|
|||||||
@dataclass
|
@dataclass
|
||||||
class NotionSearchResponse:
|
class NotionSearchResponse:
|
||||||
"""Represents the response from the Notion Search API"""
|
"""Represents the response from the Notion Search API"""
|
||||||
|
|
||||||
results: List[Dict[str, Any]]
|
results: List[Dict[str, Any]]
|
||||||
next_cursor: Optional[str]
|
next_cursor: Optional[str]
|
||||||
has_more: bool = False
|
has_more: bool = False
|
||||||
@ -121,7 +123,7 @@ class NotionConnector(LoadConnector, PollConnector):
|
|||||||
"""Extracts the title from a Notion page"""
|
"""Extracts the title from a Notion page"""
|
||||||
page_title = None
|
page_title = None
|
||||||
for _, prop in page.properties.items():
|
for _, prop in page.properties.items():
|
||||||
if prop['type'] == "title" and len(prop['title']) > 0:
|
if prop["type"] == "title" and len(prop["title"]) > 0:
|
||||||
page_title = " ".join([t["plain_text"] for t in prop["title"]]).strip()
|
page_title = " ".join([t["plain_text"] for t in prop["title"]]).strip()
|
||||||
break
|
break
|
||||||
if page_title is None:
|
if page_title is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user