Skip to content

Commit

Permalink
fix stage pipeline step to maintain extension
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiseck3 committed Dec 16, 2024
1 parent 438f9b9 commit bc53e7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion unstructured_ingest/v2/pipeline/steps/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ async def _run_async(
self, fn: Callable, path: str, file_data_path: str
) -> UploadStageStepResponse:
path = Path(path)
# Maintain extension
output_filename = f"{self.get_hash(extras=[path.name])}{path.suffix}"
fn_kwargs = {
"elements_filepath": path,
"file_data": FileData.from_file(path=file_data_path),
"output_dir": self.cache_dir,
"output_filename": self.get_hash(extras=[path.name]),
"output_filename": output_filename,
}
if not asyncio.iscoroutinefunction(fn):
staged_output_path = fn(**fn_kwargs)
Expand Down

0 comments on commit bc53e7e

Please sign in to comment.