-
Notifications
You must be signed in to change notification settings - Fork 23
fix: batch transform failure handling #1573
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| ORCHESTRATOR_STORAGE_BUCKET_DATA_SOURCE, | ||
| ) | ||
| from ..errors import ( | ||
| BatchTransformFailedException, | ||
| BatchTransformNotCompleteException, | ||
| IngestionInProgressException, | ||
| UnsupportedDataSourceException, | ||
|
|
@@ -1032,6 +1033,11 @@ def download_batch_transform_result( | |
| batch_transform = self.retrieve_batch_transform( | ||
| id=id, index_name=index_name | ||
| ) | ||
| if batch_transform.last_batch_rag_status == BatchTransformStatus.FAILED: | ||
| raise BatchTransformFailedException( | ||
| batch_transform_id=id, | ||
| status=batch_transform.last_batch_rag_status, | ||
| ) | ||
| if batch_transform.last_batch_rag_status != BatchTransformStatus.SUCCESSFUL: | ||
| raise BatchTransformNotCompleteException( | ||
| batch_transform_id=id, | ||
|
|
@@ -1091,6 +1097,11 @@ async def download_batch_transform_result_async( | |
| batch_transform = await self.retrieve_batch_transform_async( | ||
| id=id, index_name=index_name | ||
| ) | ||
| if batch_transform.last_batch_rag_status == BatchTransformStatus.FAILED: | ||
| raise BatchTransformFailedException( | ||
| batch_transform_id=id, | ||
| status=batch_transform.last_batch_rag_status, | ||
|
Contributor
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. isn't the status redundant? |
||
| ) | ||
| if batch_transform.last_batch_rag_status != BatchTransformStatus.SUCCESSFUL: | ||
| raise BatchTransformNotCompleteException( | ||
| batch_transform_id=id, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| class BatchTransformFailedException(Exception): | ||
| """Raised when a batch transform has failed. | ||
|
|
||
| This exception is raised when a batch transform task has completed | ||
| with a failed status, as opposed to still being in progress. | ||
| """ | ||
|
|
||
| def __init__(self, batch_transform_id: str, status: str): | ||
| self.message = ( | ||
| f"Batch transform '{batch_transform_id}' failed. Status: {status}" | ||
| ) | ||
| super().__init__(self.message) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ | |
| ContextGroundingIndex, | ||
| ) | ||
| from uipath.platform.errors import ( | ||
| BatchTransformFailedException, | ||
| BatchTransformNotCompleteException, | ||
| OperationNotCompleteException, | ||
| ) | ||
|
|
@@ -323,6 +324,11 @@ async def read_trigger(self, trigger: UiPathResumeTrigger) -> Any | None: | |
| "index_name", trigger.payload | ||
| ), | ||
| ) | ||
| except BatchTransformFailedException as e: | ||
| raise UiPathFaultedTriggerError( | ||
| ErrorCategory.USER, | ||
|
Contributor
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. why is this a user error? can't it be marked as failed due to other conditions in ecs? in ecs we have: |
||
| f"{e.message}", | ||
| ) from e | ||
| except BatchTransformNotCompleteException as e: | ||
| raise UiPathPendingTriggerError( | ||
| ErrorCategory.SYSTEM, | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
does the same logic apply to DeepRAG?