Skip to content

Commit 0643895

Browse files
committed
fix: Update test to explicitly cast numpy array to uint8 for Pillow 12.0.0 compatibility
1 parent 1241f1b commit 0643895

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* chore(deps): Bump several depedencies to resolve open high CVEs
44
* fix: Exclude pip and setuptools pinning based on cursor comment
55
* fix: With the newer version of transformers 4.57.1, the type checking became stricter, and mypy correctly flagged that DetrImageProcessor.from_pretrained() expects str | PathLike[Any], not a model object.
6+
* fix: Update test to explicitly cast numpy array to uint8 for Pillow 12.0.0 compatibility
67

78
## 1.1.1
89

test_unstructured_inference/inference/test_layout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def deduplicate_detected_elements(self, elements, *args, **kwargs):
109109

110110

111111
def test_get_page_elements(monkeypatch, mock_final_layout):
112-
image = Image.fromarray(np.random.randint(12, 14, size=(40, 10, 3)), mode="RGB")
112+
image = Image.fromarray(np.random.randint(12, 14, size=(40, 10, 3)).astype(np.uint8), mode="RGB")
113113
page = layout.PageLayout(
114114
number=0,
115115
image=image,

0 commit comments

Comments
 (0)