Skip to content

Commit

Permalink
bugfix: db insert error when notion page_name too long (#14316)
Browse files Browse the repository at this point in the history
  • Loading branch information
xlight authored Feb 26, 2025
1 parent d571158 commit 93a5ffb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/services/dataset_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,8 @@ def save_document_with_dataset_id(
"notion_page_icon": page.page_icon.model_dump() if page.page_icon else None,
"type": page.type,
}
# Truncate page name to 255 characters to prevent DB field length errors
truncated_page_name = page.page_name[:255] if page.page_name else "nopagename"
document = DocumentService.build_document(
dataset,
dataset_process_rule.id, # type: ignore
Expand All @@ -985,7 +987,7 @@ def save_document_with_dataset_id(
created_from,
position,
account,
page.page_name,
truncated_page_name,
batch,
knowledge_config.metadata,
)
Expand Down

0 comments on commit 93a5ffb

Please sign in to comment.