Skip to content

Commit bf152bb

Browse files
authored
fix: remove timeout kind metadata (#1797)
1 parent 8753504 commit bf152bb

10 files changed

Lines changed: 21 additions & 23 deletions

File tree

‎packages/uipath-core/pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-core"
3-
version = "0.5.29"
3+
version = "0.5.30"
44
description = "UiPath Core abstractions"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

‎packages/uipath-core/src/uipath/core/triggers/trigger.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class UiPathResumeTriggerName(str, Enum):
5151
class UiPathResumeMetadata(BaseModel):
5252
"""UiPath metadata attached to resume values from multi-trigger interrupts."""
5353

54-
kind: str | None = None
5554
trigger_type: UiPathResumeTriggerType | None = Field(
5655
default=None, alias="triggerType"
5756
)

‎packages/uipath-core/tests/triggers/test_resume_metadata.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
def test_resume_metadata_accepts_trigger_aliases() -> None:
99
metadata = UiPathResumeMetadata.model_validate(
1010
{
11-
"kind": "timeout",
1211
"triggerType": "Timer",
1312
"triggerName": "Timer",
1413
}
1514
)
1615

17-
assert metadata.kind == "timeout"
1816
assert metadata.trigger_type == UiPathResumeTriggerType.TIMER
1917
assert metadata.trigger_name == UiPathResumeTriggerName.TIMER
2018

‎packages/uipath-core/uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/uipath-platform/pyproject.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[project]
22
name = "uipath-platform"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
description = "HTTP client library for programmatic access to UiPath Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
88
"httpx>=0.28.1",
99
"tenacity>=9.0.0",
1010
"truststore>=0.10.1",
11-
"uipath-core>=0.5.29, <0.6.0",
11+
"uipath-core>=0.5.30, <0.6.0",
1212
"pydantic-function-models>=0.1.11",
1313
"sqlparse>=0.5.5",
1414
]

‎packages/uipath-platform/src/uipath/platform/common/timeout.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
from uipath.core.triggers import (
88
UIPATH_METADATA_KEY,
99
UiPathResumeMetadata,
10+
UiPathResumeTriggerType,
1011
)
1112

1213
T = TypeVar("T")
1314

14-
_TIMEOUT_KIND = "timeout"
15-
1615

1716
class UiPathTimeoutError(TimeoutError):
1817
"""Raised when a resume value came from a UiPath timeout trigger."""
@@ -26,7 +25,9 @@ def __init__(self, value: Any):
2625
def is_timeout(value: Any) -> bool:
2726
"""Return True when a resume value came from a UiPath timeout trigger."""
2827
metadata = get_resume_metadata(value)
29-
return metadata is not None and metadata.kind == _TIMEOUT_KIND
28+
return (
29+
metadata is not None and metadata.trigger_type == UiPathResumeTriggerType.TIMER
30+
)
3031

3132

3233
def assert_no_timeout(value: T) -> T:

‎packages/uipath-platform/tests/common/test_timeout_helpers.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
def test_is_timeout_detects_timeout_metadata() -> None:
1818
value = {
1919
UIPATH_METADATA_KEY: {
20-
"kind": "timeout",
2120
"triggerType": "Timer",
2221
"triggerName": "Timer",
2322
},
@@ -30,7 +29,6 @@ def test_is_timeout_detects_timeout_metadata() -> None:
3029
def test_get_resume_metadata_returns_typed_metadata() -> None:
3130
value = {
3231
UIPATH_METADATA_KEY: {
33-
"kind": "timeout",
3432
"triggerType": "Timer",
3533
"triggerName": "Timer",
3634
},
@@ -40,7 +38,6 @@ def test_get_resume_metadata_returns_typed_metadata() -> None:
4038
metadata = get_resume_metadata(value)
4139

4240
assert isinstance(metadata, UiPathResumeMetadata)
43-
assert metadata.kind == "timeout"
4441
assert metadata.trigger_type == UiPathResumeTriggerType.TIMER
4542
assert metadata.trigger_name == UiPathResumeTriggerName.TIMER
4643

@@ -61,13 +58,13 @@ def test_get_resume_metadata_returns_none_for_invalid_metadata() -> None:
6158
assert get_resume_metadata(value) is None
6259

6360

64-
def test_is_timeout_ignores_plain_timer_metadata() -> None:
61+
def test_is_timeout_ignores_non_timer_metadata() -> None:
6562
value = {
6663
UIPATH_METADATA_KEY: {
67-
"triggerType": "Timer",
68-
"triggerName": "Timer",
64+
"triggerType": "Job",
65+
"triggerName": "Job",
6966
},
70-
"resumeTime": "2026-07-07T12:00:00Z",
67+
"value": {"jobKey": "job-1"},
7168
}
7269

7370
assert is_timeout(value) is False
@@ -86,7 +83,10 @@ def test_assert_no_timeout_returns_original_value() -> None:
8683

8784
def test_assert_no_timeout_raises_with_resume_value() -> None:
8885
value = {
89-
UIPATH_METADATA_KEY: {"kind": "timeout"},
86+
UIPATH_METADATA_KEY: {
87+
"triggerType": "Timer",
88+
"triggerName": "Timer",
89+
},
9090
"value": {"jobKey": "job-1"},
9191
}
9292

‎packages/uipath-platform/uv.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/uipath/pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Python SDK and CLI for UiPath Platform, enabling programmatic int
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
8-
"uipath-core>=0.5.29, <0.6.0",
8+
"uipath-core>=0.5.30, <0.6.0",
99
"uipath-runtime>=0.11.7, <0.13.0",
1010
"uipath-platform>=0.2.2, <0.3.0",
1111
"click>=8.3.1",

‎packages/uipath/uv.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)