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
Merged

Conversation

Coniferish
Copy link
Collaborator

@Coniferish Coniferish commented Oct 23, 2023

Summary

Closes unstructured-api issue 188
The test and gist were using different versions of the same file (jpg/pdf), creating what looked like a bug when there wasn't one. The api is correctly using the strategy kwarg.

Testing

Checkout to main

  • Comment out the @pytest.mark.skip decorators for the test_partition_via_api_with_no_strategy test

  • Add an API key to your env:

    • Add from dotenv import load_dotenv; load_dotenv() to the top of the file and have UNS_API_KEY defined in .env
  • Run pytest test_unstructured/partition/test_api.py -k "test_partition_via_api_with_no_strategy"
    ^the test will fail

Checkout to this branch

  • (make the same changes as above)
  • Run pytest test_unstructured/partition/test_api.py -k "test_partition_via_api_with_no_strategy"

Other

make tidy and make check made linting changes to additional files

@Coniferish Coniferish force-pushed the jj/188-unstructured-api-test branch from 991eff2 to 549d0d6 Compare October 23, 2023 17:18
@Coniferish Coniferish requested a review from qued October 23, 2023 17:23
CHANGELOG.md Outdated Show resolved Hide resolved
@Coniferish Coniferish removed the request for review from qued October 23, 2023 17:32
@Coniferish
Copy link
Collaborator Author

@cragwolfe would it be worth investigating why the same file in different formats is partitioned into different elements? .jpeg file partitioned via auto returned 17 elements while .pdf returned 25

@Coniferish Coniferish requested review from cragwolfe and qued October 23, 2023 18:47
Copy link
Contributor

@cragwolfe cragwolfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

test_unstructured/partition/test_api.py Show resolved Hide resolved
@awalker4 awalker4 added this pull request to the merge queue Oct 24, 2023
Merged via the queue into main with commit 8080f94 Oct 24, 2023
44 checks passed
@awalker4 awalker4 deleted the jj/188-unstructured-api-test branch October 24, 2023 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants