Skip to content

Commit f7a3d86

Browse files
committed
bugfix/notion handle None values in column content rendering
1 parent 1670d65 commit f7a3d86

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

unstructured_ingest/connector/notion/helpers.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -469,13 +469,19 @@ def build_columned_list(client: Client, column_parent: Block) -> HtmlTag:
469469
for column_content_chunk in client.blocks.children.iterate_list( # type: ignore
470470
block_id=column.id,
471471
):
472+
# Filter out None values and replace them with empty strings
473+
content_html = [
474+
content.block.get_html() if content.block.get_html() is not None else ''
475+
for content in column_content_chunk
476+
]
472477
columns_content.append(
473478
Div(
474479
[Style(f"width:{100/num_columns}%; float: left")],
475-
[content.block.get_html() for content in column_content_chunk],
480+
content_html,
476481
),
477482
)
478483

484+
479485
return Div([], columns_content)
480486

481487

0 commit comments

Comments
 (0)