Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/uipath-platform/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-platform"
version = "0.2.15"
version = "0.2.16"
description = "HTTP client library for programmatic access to UiPath Platform"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
from uipath.platform.errors import (
BatchTransformFailedException,
BatchTransformNotCompleteException,
ContextGroundingIndexNotFoundError,
OperationNotCompleteException,
)
from uipath.platform.orchestrator.job import JobState
Expand Down Expand Up @@ -544,6 +545,12 @@ async def create_trigger(self, suspend_value: Any) -> UiPathResumeTrigger:
f"Unexpected model received"
f"{type(suspend_value)} is not a valid Human-In-The-Loop model",
)
except ContextGroundingIndexNotFoundError as e:
raise UiPathFaultedTriggerError(
ErrorCategory.DEPLOYMENT,
"Context grounding index not found",
str(e),
Comment on lines +548 to +552
) from e
except Exception as e:
raise UiPathFaultedTriggerError(
ErrorCategory.SYSTEM,
Expand Down
34 changes: 34 additions & 0 deletions packages/uipath-platform/tests/services/test_hitl.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
StartExtractionValidationResponse,
ValidateExtractionAction,
)
from uipath.platform.errors import ContextGroundingIndexNotFoundError
from uipath.platform.orchestrator import Job, JobErrorInfo
from uipath.platform.orchestrator.job import JobState
from uipath.platform.resume_triggers import (
Expand Down Expand Up @@ -1832,6 +1833,39 @@
folder_key=create_batch_transform.index_folder_key,
)

@pytest.mark.anyio
async def test_missing_batch_transform_index_is_deployment_error(
self,
setup_test_env: None,
) -> None:
create_batch_transform = CreateBatchTransform(
name="test-batch-transform",
index_name="Files",
prompt="test prompt",
output_columns=[
BatchTransformOutputColumn(name="column1", description="desc1")
],
destination_path="/output/path.xlsx",
index_folder_path="/test/path",
)
missing_index = ContextGroundingIndexNotFoundError("Files")
mock_start_batch_transform = AsyncMock(side_effect=missing_index)

with patch(
"uipath.platform.context_grounding._context_grounding_service.ContextGroundingService.start_batch_transform_async",
new=mock_start_batch_transform,
):
with pytest.raises(UiPathFaultedTriggerError) as exc_info:

Check warning on line 1858 in packages/uipath-platform/tests/services/test_hitl.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this exception test to have only one invocation possibly throwing an exception.

See more on https://sonarcloud.io/project/issues?id=UiPath_uipath-python&issues=AZ_E76SjKVFiZXqfp0h8&open=AZ_E76SjKVFiZXqfp0h8&pullRequest=1839
await UiPathResumeTriggerCreator().create_trigger(
create_batch_transform
)

error = exc_info.value
assert error.category == ErrorCategory.DEPLOYMENT
assert error.message == "Context grounding index not found"
assert error.detail == "ContextGroundingIndex 'Files' not found"
assert error.__cause__ is missing_index

@pytest.mark.anyio
async def test_create_resume_trigger_wait_batch_transform(
self,
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath-platform/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/uipath/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading