Skip to content

Commit

Permalink
Fixes after CR
Browse files Browse the repository at this point in the history
  • Loading branch information
plutasnyy committed Nov 20, 2024
1 parent 85dc0fc commit 3ec8714
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test_unstructured/chunking/test_html_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_combining_html_metadata_when_multiple_elements_in_composite_element(chu
'<input class="FormFieldValue" id="5" value="Example value" />'
"</form>"
)
combined_metadata = metadata_1 + metadata_2 + metadata_3
combined_metadata = " ".join([metadata_1, metadata_2, metadata_3])

elements = [
Title(text="Header", metadata=ElementMetadata(text_as_html=metadata_1)),
Expand Down Expand Up @@ -71,7 +71,7 @@ def test_combining_html_metadata_with_nested_relationship_between_elements(chunk
assert chunks[0].text == "First"
assert chunks[1].text == "Second"

assert chunks[0].metadata.text_as_html == metadata_1 + metadata_2
assert chunks[0].metadata.text_as_html == metadata_1 + " " + metadata_2
assert chunks[1].metadata.text_as_html == metadata_3


Expand Down
2 changes: 1 addition & 1 deletion unstructured/chunking/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def iter_kwarg_pairs() -> Iterator[tuple[str, Any]]:
ordered_unique_keys = {key: None for val_list in values for key in val_list}
yield field_name, list(ordered_unique_keys.keys())
elif strategy is CS.STRING_CONCATENATE:
yield field_name, "".join(values)
yield field_name, " ".join(val.strip() for val in values)
elif strategy is CS.DROP:
continue
else: # pragma: no cover
Expand Down

0 comments on commit 3ec8714

Please sign in to comment.