Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix strategy test for api and linting #1840

Merged
merged 9 commits into from
Oct 24, 2023
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.10.26-dev1
## 0.10.26-dev2

### Enhancements

Expand All @@ -8,6 +8,7 @@

### Fixes


## 0.10.25

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion test_unstructured/chunking/test_title.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_it_splits_a_large_section_into_multiple_chunks():
Title("Introduction"),
Text(
"Lorem ipsum dolor sit amet consectetur adipiscing elit. In rhoncus ipsum sed lectus"
" porta volutpat."
" porta volutpat.",
),
]

Expand Down
15 changes: 6 additions & 9 deletions test_unstructured/partition/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,10 @@ def test_partition_via_api_raises_with_bad_response(monkeypatch):
partition_via_api(filename=filename)


@pytest.mark.skip(
reason="API is returning fast for auto, see "
"https://github.com/Unstructured-IO/unstructured-api/issues/188",
)
# @pytest.mark.skipif(skip_outside_ci, reason="Skipping test run outside of CI")
# @pytest.mark.skipif(skip_not_on_main, reason="Skipping test run outside of main branch")
@pytest.mark.skipif(skip_outside_ci, reason="Skipping test run outside of CI")
@pytest.mark.skipif(skip_not_on_main, reason="Skipping test run outside of main branch")
def test_partition_via_api_with_no_strategy():
filename = os.path.join(DIRECTORY, "..", "..", "example-docs", "layout-parser-paper-fast.jpg")
filename = os.path.join(DIRECTORY, "..", "..", "example-docs", "layout-parser-paper-fast.pdf")

elements_no_strategy = partition_via_api(
filename=filename,
Expand All @@ -140,8 +136,9 @@ def test_partition_via_api_with_no_strategy():
elements_hi_res = partition_via_api(filename=filename, strategy="hi_res", api_key=get_api_key())

# confirm that hi_res strategy was not passed as default to partition by comparing outputs
# FIXME(crag): elements_hi_res[4].text is 'sacon oot barvard o', the fast output.
# should be 'Harvard University {melissadell,jacob carlson}@fas.harvard.edu' (as of writing)
# elements_hi_res[3].text =
# 'LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis'
# while elements_no_strategy[3].text = ']' (as of this writing)
Coniferish marked this conversation as resolved.
Show resolved Hide resolved
assert elements_no_strategy[4].text != elements_hi_res[4].text


Expand Down
2 changes: 1 addition & 1 deletion unstructured/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.10.26-dev1" # pragma: no cover
__version__ = "0.10.26-dev2" # pragma: no cover
2 changes: 0 additions & 2 deletions unstructured/ingest/cli/cmds/azure_cognitive_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from unstructured.ingest.interfaces import BaseConfig
from unstructured.ingest.logger import ingest_log_streaming_init, logger

pass


@dataclass
class AzureCognitiveSearchCliWriteConfig(BaseConfig, CliMixin):
Expand Down
Loading