-
Notifications
You must be signed in to change notification settings - Fork 17
fix: DATA_DIR_KEY #214
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
Merged
Merged
fix: DATA_DIR_KEY #214
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8c6b64e
fix DATA_DIR_KEY in split_pdf_hook, alphabetize imports, fix types
Coniferish 83dc8de
small fixes
Coniferish df0003e
remove unused imports and add test
Coniferish 297056a
formatting and linting
Coniferish 45e4b28
fix typo and types
Coniferish 6b5d2f9
fix sample_docs path
Coniferish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,11 @@ | |
PARTITION_FORM_CONCURRENCY_LEVEL_KEY, | ||
PARTITION_FORM_FILES_KEY, | ||
PARTITION_FORM_PAGE_RANGE_KEY, | ||
PARTITION_FORM_SPLIT_PDF_PAGE_KEY, | ||
PARTITION_FORM_SPLIT_CACHE_TMP_DATA_DIR_KEY, | ||
PARTITION_FORM_SPLIT_CACHE_TMP_DATA_KEY, | ||
PARTITION_FORM_SPLIT_PDF_ALLOW_FAILED_KEY, | ||
PARTITION_FORM_STARTING_PAGE_NUMBER_KEY, PARTITION_FORM_SPLIT_CACHE_TMP_DATA_KEY, | ||
PARTITION_FORM_SPLIT_PDF_PAGE_KEY, | ||
PARTITION_FORM_STARTING_PAGE_NUMBER_KEY, | ||
) | ||
from unstructured_client._hooks.types import ( | ||
AfterErrorContext, | ||
|
@@ -315,7 +317,7 @@ def before_request( | |
|
||
self.cache_tmp_data_dir = form_utils.get_split_pdf_cache_tmp_data_dir( | ||
form_data, | ||
key=PARTITION_FORM_SPLIT_CACHE_TMP_DATA_KEY, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Main fix |
||
key=PARTITION_FORM_SPLIT_CACHE_TMP_DATA_DIR_KEY, | ||
fallback_value=DEFAULT_CACHE_TMP_DATA_DIR, | ||
) | ||
|
||
|
@@ -546,7 +548,7 @@ def _get_pdf_chunk_paths( | |
return pdf_chunk_paths | ||
|
||
def _get_pdf_chunk_files( | ||
self, pdf_chunks: list[Tuple[Path, int]] | ||
self, pdf_chunks: list[Tuple[Path, int]] | ||
) -> Generator[Tuple[BinaryIO, int], None, None]: | ||
"""Yields the file objects for the given pdf chunk paths. | ||
|
||
|
@@ -573,8 +575,7 @@ def _get_pdf_chunk_files( | |
raise | ||
yield pdf_chunk_file, offset | ||
|
||
def _await_elements( | ||
self, operation_id: str) -> Optional[list]: | ||
def _await_elements(self, operation_id: str) -> Optional[list]: | ||
""" | ||
Waits for the partition requests to complete and returns the flattened | ||
elements. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This param doesn't exist, but the test succeeded despite that. Fixed the param anyway.