Skip to content

Commit

Permalink
fix: add missing params to ElementMetadata (#3092)
Browse files Browse the repository at this point in the history
A couple of parameters needed for DOCX image extraction were not added
as parameters to the `ElementMetadata` constructor when they were added
as known fields.

Also repair a couple gaps in alphabetical ordering cause by recent
additions.
  • Loading branch information
scanny committed May 23, 2024
1 parent 35ec21e commit 26d403d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions unstructured/documents/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,15 @@ def __init__(
filename: Optional[str | pathlib.Path] = None,
filetype: Optional[str] = None,
header_footer_type: Optional[str] = None,
image_base64: Optional[str] = None,
image_mime_type: Optional[str] = None,
image_path: Optional[str] = None,
is_continuation: Optional[bool] = None,
languages: Optional[list[str]] = None,
last_modified: Optional[str] = None,
link_start_indexes: Optional[list[int]] = None,
link_texts: Optional[list[str]] = None,
link_urls: Optional[list[str]] = None,
link_start_indexes: Optional[list[int]] = None,
links: Optional[list[Link]] = None,
orig_elements: Optional[list[Element]] = None,
page_name: Optional[str] = None,
Expand All @@ -251,8 +253,8 @@ def __init__(
sent_to: Optional[list[str]] = None,
signature: Optional[str] = None,
subject: Optional[str] = None,
text_as_html: Optional[str] = None,
table_as_cells: Optional[dict[str, str | int]] = None,
text_as_html: Optional[str] = None,
url: Optional[str] = None,
) -> None:
self.attached_to_filename = attached_to_filename
Expand All @@ -274,6 +276,8 @@ def __init__(

self.filetype = filetype
self.header_footer_type = header_footer_type
self.image_base64 = image_base64
self.image_mime_type = image_mime_type
self.image_path = image_path
self.is_continuation = is_continuation
self.languages = languages
Expand Down

0 comments on commit 26d403d

Please sign in to comment.