Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions unstructured/documents/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@

from typing_extensions import ParamSpec, TypeAlias, TypedDict

from unstructured.documents.coordinates import (
TYPE_TO_COORDINATE_SYSTEM_MAP,
CoordinateSystem,
RelativeCoordinateSystem,
)
from unstructured.partition.utils.constants import UNSTRUCTURED_INCLUDE_DEBUG_METADATA
from unstructured.documents.coordinates import (TYPE_TO_COORDINATE_SYSTEM_MAP,
CoordinateSystem,
RelativeCoordinateSystem)
from unstructured.partition.utils.constants import \
UNSTRUCTURED_INCLUDE_DEBUG_METADATA
from unstructured.utils import get_call_args_applying_defaults, lazyproperty

Point: TypeAlias = "tuple[float, float]"
Expand Down Expand Up @@ -391,7 +390,7 @@ def to_dict(self) -> dict[str, Any]:
"""
from unstructured.staging.base import elements_to_base64_gzipped_json

meta_dict = copy.deepcopy(dict(self.fields))
meta_dict = dict(self.fields)

# -- remove fields that should not be serialized --
for field_name in self.DEBUG_FIELD_NAMES:
Expand Down Expand Up @@ -1036,6 +1035,8 @@ def _kvform_rehydrate_internal_elements(kv_pairs: list[dict[str, Any]]) -> list[
"""
from unstructured.staging.base import elements_from_dicts

Points: TypeAlias = "tuple[Point, ...]"

# safe to overwrite - deepcopy already happened
for kv_pair in kv_pairs:
if kv_pair["key"]["custom_element"] is not None:
Expand Down