Skip to content

Commit 307e901

Browse files
committed
Merge, make tidy and fix CHANGELOG.md
1 parent ee6e638 commit 307e901

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 0.8.6
22

3+
* fix: add `password` for PDF
34
* feat: add back `source` to `TextRegions` and `LayoutElements` for backward compatibility
45

56
## 0.8.5
@@ -13,7 +14,6 @@
1314

1415
## 0.8.3
1516

16-
* fix: add `password` for PDF
1717
* fix: removed `layoutelement.from_lp_textblock()` and related tests as it's not used
1818
* fix: update requirements to drop `layoutparser` lib
1919
* fix: update `README.md` to remove layoutparser model zoo support note

test_unstructured_inference/inference/test_layout.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,22 +305,18 @@ def mock_get_elements(self, *args, **kwargs):
305305
@pytest.mark.slow()
306306
def test_from_file_with_password(monkeypatch, mock_final_layout):
307307

308-
doc = layout.DocumentLayout.from_file(
309-
"sample-docs/password.pdf",
310-
password="password")
308+
doc = layout.DocumentLayout.from_file("sample-docs/password.pdf", password="password")
311309
assert doc
312310

313-
monkeypatch.setattr(layout, "get_model",
314-
lambda x: MockLayoutModel(mock_final_layout))
311+
monkeypatch.setattr(layout, "get_model", lambda x: MockLayoutModel(mock_final_layout))
315312
with patch(
316313
"unstructured_inference.inference.layout.UnstructuredObjectDetectionModel",
317314
MockLayoutModel,
318-
), open("sample-docs/password.pdf",mode="rb") as fp:
315+
), open("sample-docs/password.pdf", mode="rb") as fp:
319316
doc = layout.process_data_with_model(fp, model_name="fake", password="password")
320317
assert doc
321318

322319

323-
324320
def test_from_image_file_raises_with_empty_fn():
325321
with pytest.raises(FileNotFoundError):
326322
layout.DocumentLayout.from_image_file("")

test_unstructured_inference/models/test_tables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
from copy import deepcopy
32

43
import numpy as np
54
import pytest
@@ -8,6 +7,7 @@
87
from transformers.models.table_transformer.modeling_table_transformer import (
98
TableTransformerDecoder,
109
)
10+
from copy import deepcopy
1111

1212
import unstructured_inference.models.table_postprocess as postprocess
1313
from unstructured_inference.models import tables

0 commit comments

Comments
 (0)