Skip to content

Commit dc68323

Browse files
committed
fix: update README.md
1 parent f46cc0a commit dc68323

File tree

12 files changed

+341
-119
lines changed

12 files changed

+341
-119
lines changed

README.md

Lines changed: 314 additions & 89 deletions
Large diffs are not rendered by default.

src/uipath/runtime/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
Any,
77
AsyncGenerator,
88
Generic,
9-
List,
109
Literal,
1110
Optional,
1211
TypeVar,
@@ -43,7 +42,7 @@ class UiPathExecuteOptions(BaseModel):
4342
default=False,
4443
description="Indicates whether to resume a suspended execution.",
4544
)
46-
breakpoints: Optional[List[str] | Literal["*"]] = Field(
45+
breakpoints: Optional[list[str] | Literal["*"]] = Field(
4746
default=None,
4847
description="List of nodes or '*' to break on all steps.",
4948
)

src/uipath/runtime/debug/bridge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Abstract debug bridge interface."""
22

33
from abc import ABC, abstractmethod
4-
from typing import Any, List, Literal
4+
from typing import Any, Literal
55

66
from uipath.runtime import (
77
UiPathBreakpointResult,
@@ -65,7 +65,7 @@ async def wait_for_resume(self) -> Any:
6565
pass
6666

6767
@abstractmethod
68-
def get_breakpoints(self) -> List[str] | Literal["*"]:
68+
def get_breakpoints(self) -> list[str] | Literal["*"]:
6969
"""Get nodes to suspend execution at.
7070
7171
Returns:

src/uipath/runtime/errors/exception.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import sys
44
import traceback
5-
from typing import Any, Dict, Optional
5+
from typing import Any, Optional
66

77
from uipath.runtime.errors.codes import UiPathErrorCode
88
from uipath.runtime.errors.contract import UiPathErrorCategory, UiPathErrorContract
@@ -71,7 +71,7 @@ def _extract_http_status(self) -> Optional[int]:
7171
return None
7272

7373
@property
74-
def as_dict(self) -> Dict[str, Any]:
74+
def as_dict(self) -> dict[str, Any]:
7575
"""Get the error information as a dictionary."""
7676
return self.error_info.model_dump()
7777

src/uipath/runtime/events/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Base classes for UiPath runtime events."""
22

33
from enum import Enum
4-
from typing import Any, Dict, Optional
4+
from typing import Any, Optional
55

66
from pydantic import BaseModel, ConfigDict, Field
77

@@ -24,7 +24,7 @@ class UiPathRuntimeEvent(BaseModel):
2424
execution_id: Optional[str] = Field(
2525
default=None, description="The runtime execution id associated with the event"
2626
)
27-
metadata: Optional[Dict[str, Any]] = Field(
27+
metadata: Optional[dict[str, Any]] = Field(
2828
default=None, description="Additional event context"
2929
)
3030

src/uipath/runtime/events/state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Events related to agent messages and state updates."""
22

3-
from typing import Any, Dict, Optional
3+
from typing import Any, Optional
44

55
from pydantic import Field
66

@@ -61,7 +61,7 @@ class UiPathRuntimeStateEvent(UiPathRuntimeEvent):
6161
messages = state.get("messages", [])
6262
"""
6363

64-
payload: Dict[str, Any] = Field(description="Framework-specific state update")
64+
payload: dict[str, Any] = Field(description="Framework-specific state update")
6565
node_name: Optional[str] = Field(
6666
default=None, description="Name of the node/agent that caused this update"
6767
)

src/uipath/runtime/factory.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from abc import ABC, abstractmethod
44
from typing import (
55
Generic,
6-
List,
76
TypeVar,
87
)
98

@@ -16,7 +15,7 @@ class UiPathRuntimeFactory(Generic[T], ABC):
1615
"""Generic factory for UiPath runtime classes."""
1716

1817
@abstractmethod
19-
def discover_runtimes(self) -> List[T]:
18+
def discover_runtimes(self) -> list[T]:
2019
"""Discover all runtime classes."""
2120
raise NotImplementedError()
2221

src/uipath/runtime/result.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Result of an execution with status and optional error information."""
22

33
from enum import Enum
4-
from typing import Any, Dict, List, Literal, Optional, Union
4+
from typing import Any, Literal, Optional, Union
55

66
from pydantic import BaseModel, Field
77

@@ -56,7 +56,7 @@ class UiPathResumeTrigger(BaseModel):
5656
class UiPathRuntimeResult(UiPathRuntimeEvent):
5757
"""Result of an execution with status and optional error information."""
5858

59-
output: Optional[Union[Dict[str, Any], BaseModel]] = None
59+
output: Optional[Union[dict[str, Any], BaseModel]] = None
6060
status: UiPathRuntimeStatus = UiPathRuntimeStatus.SUCCESSFUL
6161
resume: Optional[UiPathResumeTrigger] = None
6262
error: Optional[UiPathErrorContract] = None
@@ -65,7 +65,7 @@ class UiPathRuntimeResult(UiPathRuntimeEvent):
6565
default=UiPathRuntimeEventType.RUNTIME_RESULT, frozen=True
6666
)
6767

68-
def to_dict(self) -> Dict[str, Any]:
68+
def to_dict(self) -> dict[str, Any]:
6969
"""Convert to dictionary format for output."""
7070
if self.output is None:
7171
output_data = {}
@@ -98,4 +98,4 @@ class UiPathBreakpointResult(UiPathRuntimeResult):
9898
breakpoint_node: str # Which node the breakpoint is at
9999
breakpoint_type: Literal["before", "after"] # Before or after the node
100100
current_state: dict[str, Any] | Any # Current workflow state at breakpoint
101-
next_nodes: List[str] # Which node(s) will execute next
101+
next_nodes: list[str] # Which node(s) will execute next

src/uipath/runtime/schema.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""UiPath Runtime Schema Definitions."""
22

3-
from typing import Any, Dict
3+
from typing import Any
44

55
from pydantic import BaseModel, ConfigDict, Field
66

@@ -19,8 +19,8 @@ class UiPathRuntimeSchema(BaseModel):
1919
file_path: str = Field(..., alias="filePath")
2020
unique_id: str = Field(..., alias="uniqueId")
2121
type: str = Field(..., alias="type")
22-
input: Dict[str, Any] = Field(..., alias="input")
23-
output: Dict[str, Any] = Field(..., alias="output")
22+
input: dict[str, Any] = Field(..., alias="input")
23+
output: dict[str, Any] = Field(..., alias="output")
2424

2525
model_config = COMMON_MODEL_SCHEMA
2626

tests/test_context.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ def test_result_file_written_on_fault_contains_error_contract(tmp_path: Path) ->
137137

138138
# We always have an output key, even if it's an empty dict
139139
assert "output" in content
140-
140+
# Status should be FAULTED
141+
assert "status" in content
142+
assert content["status"] == UiPathRuntimeStatus.FAULTED.value
141143
# Error contract should be present and structured
142144
assert "error" in content
143145
error = content["error"]

0 commit comments

Comments
 (0)