Skip to content

fix: properly handle the case when an element's text is None#3995

Merged
badGarnet merged 3 commits intomainfrom
fix/fix-chunking-with-elements-with-no-text-attribute
May 5, 2025
Merged

fix: properly handle the case when an element's text is None#3995
badGarnet merged 3 commits intomainfrom
fix/fix-chunking-with-elements-with-no-text-attribute

Conversation

@badGarnet
Copy link
Copy Markdown
Collaborator

@badGarnet badGarnet commented May 5, 2025

Some elements, like Image, can have None as its text attribute's value. In that case current chunking logic fails because it expects the field to always have a length or can be split. The fix is to update the logic as element.text or "" for checking length and add flow control to early exit to avoid calling split on None.

@badGarnet badGarnet marked this pull request as ready for review May 5, 2025 17:33
Copy link
Copy Markdown
Contributor

@ryannikolaidis ryannikolaidis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes please!

@badGarnet badGarnet enabled auto-merge May 5, 2025 17:41
@badGarnet badGarnet added this pull request to the merge queue May 5, 2025
Merged via the queue into main with commit b814ece May 5, 2025
43 checks passed
@badGarnet badGarnet deleted the fix/fix-chunking-with-elements-with-no-text-attribute branch May 5, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants