Skip to content

Commit

Permalink
fix filename extension issue for test
Browse files Browse the repository at this point in the history
  • Loading branch information
micmarty-deepsense committed Apr 22, 2024
1 parent 779db46 commit 43300f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion unstructured/documents/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import re
import uuid
from itertools import groupby
from pathlib import Path
from types import MappingProxyType
from typing import Any, Callable, FrozenSet, Optional, Sequence, cast

Expand Down Expand Up @@ -763,7 +764,7 @@ def id_to_hash(self, sequence_number: int) -> str:
Returns: new ID value
"""
data = f"{self.metadata.filename}{self.text}{self.metadata.page_number}{sequence_number}"
data = f"{Path(self.metadata.filename).stem}{self.text}{self.metadata.page_number}{sequence_number}"
self._element_id = hashlib.sha256(data.encode()).hexdigest()[:32]
return self.id

Expand Down

0 comments on commit 43300f0

Please sign in to comment.