uipath 2.0.79__py3-none-any.whl → 2.0.81__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uipath/_cli/_runtime/_runtime.py +16 -5
- uipath/_services/_base_service.py +13 -2
- uipath/_services/processes_service.py +0 -1
- uipath/models/exceptions.py +23 -0
- {uipath-2.0.79.dist-info → uipath-2.0.81.dist-info}/METADATA +1 -1
- {uipath-2.0.79.dist-info → uipath-2.0.81.dist-info}/RECORD +9 -9
- {uipath-2.0.79.dist-info → uipath-2.0.81.dist-info}/WHEEL +0 -0
- {uipath-2.0.79.dist-info → uipath-2.0.81.dist-info}/entry_points.txt +0 -0
- {uipath-2.0.79.dist-info → uipath-2.0.81.dist-info}/licenses/LICENSE +0 -0
uipath/_cli/_runtime/_runtime.py
CHANGED
@@ -50,7 +50,7 @@ class UiPathRuntime(UiPathBaseRuntime):
|
|
50
50
|
if self.context.entrypoint is None:
|
51
51
|
return None
|
52
52
|
|
53
|
-
script_result = self._execute_python_script(
|
53
|
+
script_result = await self._execute_python_script(
|
54
54
|
self.context.entrypoint, self.context.input_json
|
55
55
|
)
|
56
56
|
|
@@ -111,7 +111,7 @@ class UiPathRuntime(UiPathBaseRuntime):
|
|
111
111
|
"""Cleanup runtime resources."""
|
112
112
|
pass
|
113
113
|
|
114
|
-
def _execute_python_script(self, script_path: str, input_data: Any) -> Any:
|
114
|
+
async def _execute_python_script(self, script_path: str, input_data: Any) -> Any:
|
115
115
|
"""Execute the Python script with the given input."""
|
116
116
|
spec = importlib.util.spec_from_file_location("dynamic_module", script_path)
|
117
117
|
if not spec or not spec.loader:
|
@@ -139,10 +139,13 @@ class UiPathRuntime(UiPathBaseRuntime):
|
|
139
139
|
sig = inspect.signature(main_func)
|
140
140
|
params = list(sig.parameters.values())
|
141
141
|
|
142
|
+
# Check if the function is asynchronous
|
143
|
+
is_async = inspect.iscoroutinefunction(main_func)
|
144
|
+
|
142
145
|
# Case 1: No parameters
|
143
146
|
if not params:
|
144
147
|
try:
|
145
|
-
result = main_func()
|
148
|
+
result = await main_func() if is_async else main_func()
|
146
149
|
return (
|
147
150
|
self._convert_from_class(result)
|
148
151
|
if result is not None
|
@@ -166,7 +169,11 @@ class UiPathRuntime(UiPathBaseRuntime):
|
|
166
169
|
try:
|
167
170
|
valid_type = cast(Type[Any], input_type)
|
168
171
|
typed_input = self._convert_to_class(input_data, valid_type)
|
169
|
-
result =
|
172
|
+
result = (
|
173
|
+
await main_func(typed_input)
|
174
|
+
if is_async
|
175
|
+
else main_func(typed_input)
|
176
|
+
)
|
170
177
|
return (
|
171
178
|
self._convert_from_class(result)
|
172
179
|
if result is not None
|
@@ -183,7 +190,11 @@ class UiPathRuntime(UiPathBaseRuntime):
|
|
183
190
|
# Case 3: Dict parameter
|
184
191
|
else:
|
185
192
|
try:
|
186
|
-
result =
|
193
|
+
result = (
|
194
|
+
await main_func(input_data)
|
195
|
+
if is_async
|
196
|
+
else main_func(input_data)
|
197
|
+
)
|
187
198
|
return (
|
188
199
|
self._convert_from_class(result)
|
189
200
|
if result is not None
|
@@ -8,6 +8,7 @@ from httpx import (
|
|
8
8
|
Client,
|
9
9
|
ConnectTimeout,
|
10
10
|
Headers,
|
11
|
+
HTTPStatusError,
|
11
12
|
Response,
|
12
13
|
TimeoutException,
|
13
14
|
)
|
@@ -25,6 +26,7 @@ from .._execution_context import ExecutionContext
|
|
25
26
|
from .._utils import UiPathUrl, user_agent_value
|
26
27
|
from .._utils._ssl_context import get_httpx_client_kwargs
|
27
28
|
from .._utils.constants import HEADER_USER_AGENT
|
29
|
+
from ..models.exceptions import EnrichedException
|
28
30
|
|
29
31
|
|
30
32
|
def is_retryable_exception(exception: BaseException) -> bool:
|
@@ -104,7 +106,12 @@ class BaseService:
|
|
104
106
|
scoped_url = self._url.scope_url(str(url), scoped)
|
105
107
|
|
106
108
|
response = self._client.request(method, scoped_url, **kwargs)
|
107
|
-
|
109
|
+
|
110
|
+
try:
|
111
|
+
response.raise_for_status()
|
112
|
+
except HTTPStatusError as e:
|
113
|
+
# include the http response in the error message
|
114
|
+
raise EnrichedException(e) from e
|
108
115
|
|
109
116
|
return response
|
110
117
|
|
@@ -136,8 +143,12 @@ class BaseService:
|
|
136
143
|
scoped_url = self._url.scope_url(str(url), scoped)
|
137
144
|
|
138
145
|
response = await self._client_async.request(method, scoped_url, **kwargs)
|
139
|
-
response.raise_for_status()
|
140
146
|
|
147
|
+
try:
|
148
|
+
response.raise_for_status()
|
149
|
+
except HTTPStatusError as e:
|
150
|
+
# include the http response in the error message
|
151
|
+
raise EnrichedException(e) from e
|
141
152
|
return response
|
142
153
|
|
143
154
|
@property
|
uipath/models/exceptions.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
from typing import Optional
|
2
2
|
|
3
|
+
from httpx import HTTPStatusError
|
4
|
+
|
3
5
|
|
4
6
|
class IngestionInProgressException(Exception):
|
5
7
|
"""An exception that is triggered when a search is attempted on an index that is currently undergoing ingestion."""
|
@@ -11,3 +13,24 @@ class IngestionInProgressException(Exception):
|
|
11
13
|
else:
|
12
14
|
self.message = f"index '{index_name}' is currently queued for ingestion"
|
13
15
|
super().__init__(self.message)
|
16
|
+
|
17
|
+
|
18
|
+
class EnrichedException(Exception):
|
19
|
+
def __init__(self, error: HTTPStatusError) -> None:
|
20
|
+
# Extract the relevant details from the HTTPStatusError
|
21
|
+
status_code = error.response.status_code if error.response else "Unknown"
|
22
|
+
url = str(error.request.url) if error.request else "Unknown"
|
23
|
+
response_content = (
|
24
|
+
error.response.content.decode("utf-8")
|
25
|
+
if error.response and error.response.content
|
26
|
+
else "No content"
|
27
|
+
)
|
28
|
+
|
29
|
+
enriched_message = (
|
30
|
+
f"\nRequest URL: {url}"
|
31
|
+
f"\nStatus Code: {status_code}"
|
32
|
+
f"\nResponse Content: {response_content}"
|
33
|
+
)
|
34
|
+
|
35
|
+
# Initialize the parent Exception class with the formatted message
|
36
|
+
super().__init__(enriched_message)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: uipath
|
3
|
-
Version: 2.0.
|
3
|
+
Version: 2.0.81
|
4
4
|
Summary: Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.
|
5
5
|
Project-URL: Homepage, https://uipath.com
|
6
6
|
Project-URL: Repository, https://github.com/UiPath/uipath-python
|
@@ -30,7 +30,7 @@ uipath/_cli/_runtime/_contracts.py,sha256=Rxs-uEOA490fLPNimB8LqZW7KI-72O0BLY4Jm7
|
|
30
30
|
uipath/_cli/_runtime/_escalation.py,sha256=x3vI98qsfRA-fL_tNkRVTFXioM5Gv2w0GFcXJJ5eQtg,7981
|
31
31
|
uipath/_cli/_runtime/_hitl.py,sha256=aexwe0dIXvh6SlVS1jVnO_aGZc6e3gLsmGkCyha5AHo,11300
|
32
32
|
uipath/_cli/_runtime/_logging.py,sha256=lA2LsakOrcSLnJWgo80-BYzIQBUWfqzzJGI1M61Gu0s,7874
|
33
|
-
uipath/_cli/_runtime/_runtime.py,sha256
|
33
|
+
uipath/_cli/_runtime/_runtime.py,sha256=dHfL6McYC9BwBB9Dk4Y_syvAft-1b-jTG1nbG_d07m8,10647
|
34
34
|
uipath/_cli/_templates/.psmdcp.template,sha256=C7pBJPt98ovEljcBvGtEUGoWjjQhu9jls1bpYjeLOKA,611
|
35
35
|
uipath/_cli/_templates/.rels.template,sha256=-fTcw7OA1AcymHr0LzBqbMAAtzZTRXLTNa_ljq087Jk,406
|
36
36
|
uipath/_cli/_templates/[Content_Types].xml.template,sha256=bYsKDz31PkIF9QksjgAY_bqm57YC8U_owsZeNZAiBxQ,584
|
@@ -46,7 +46,7 @@ uipath/_cli/_utils/_parse_ast.py,sha256=A-QToBIf-oP7yP2DQTHO6blkk6ik5z_IeaIwtEWO
|
|
46
46
|
uipath/_cli/_utils/_processes.py,sha256=q7DfEKHISDWf3pngci5za_z0Pbnf_shWiYEcTOTCiyk,1855
|
47
47
|
uipath/_cli/_utils/_tracing.py,sha256=2igb03j3EHjF_A406UhtCKkPfudVfFPjUq5tXUEG4oo,1541
|
48
48
|
uipath/_services/__init__.py,sha256=10xtw3ENC30yR9CCq_b94RMZ3YrUeyfHV33yWYUd8tU,896
|
49
|
-
uipath/_services/_base_service.py,sha256=
|
49
|
+
uipath/_services/_base_service.py,sha256=twcUCLS_V4D1kxcJt6lckd7rqsVRcy4mfHOflJpu1k0,5830
|
50
50
|
uipath/_services/actions_service.py,sha256=LYKvG4VxNGQgZ46AzGK9kI1Txb-YmVvZj5ScPOue8Ls,15989
|
51
51
|
uipath/_services/api_client.py,sha256=hcof0EMa4-phEHD1WlO7Tdfzq6aL18Sbi2aBE7lJm1w,1821
|
52
52
|
uipath/_services/assets_service.py,sha256=acqWogfhZiSO1eeVYqFxmqWGSTmrW46QxI1J0bJe3jo,11918
|
@@ -57,7 +57,7 @@ uipath/_services/context_grounding_service.py,sha256=EBf7lIIYz_s1ubf_07OAZXQHjS8
|
|
57
57
|
uipath/_services/folder_service.py,sha256=9JqgjKhWD-G_KUnfUTP2BADxL6OK9QNZsBsWZHAULdE,2749
|
58
58
|
uipath/_services/jobs_service.py,sha256=CnDd7BM4AMqcMIR1qqu5ohhxf9m0AF4dnGoF4EX38kw,30872
|
59
59
|
uipath/_services/llm_gateway_service.py,sha256=ZdKRLdEVL8Zkcl9NDT5AKADxnjqeMIuOe5H2Oy7hYKw,9421
|
60
|
-
uipath/_services/processes_service.py,sha256=
|
60
|
+
uipath/_services/processes_service.py,sha256=Pk6paw7e_a-WvVcfKDLuyj1p--pvNRTXwZNYIwDdYzo,5726
|
61
61
|
uipath/_services/queues_service.py,sha256=VaG3dWL2QK6AJBOLoW2NQTpkPfZjsqsYPl9-kfXPFzA,13534
|
62
62
|
uipath/_utils/__init__.py,sha256=VdcpnENJIa0R6Y26NoxY64-wUVyvb4pKfTh1wXDQeMk,526
|
63
63
|
uipath/_utils/_endpoint.py,sha256=yYHwqbQuJIevpaTkdfYJS9CrtlFeEyfb5JQK5osTCog,2489
|
@@ -80,7 +80,7 @@ uipath/models/connections.py,sha256=perIqW99YEg_0yWZPdpZlmNpZcwY_toR1wkqDUBdAN0,
|
|
80
80
|
uipath/models/context_grounding.py,sha256=S9PeOlFlw7VxzzJVR_Fs28OObW3MLHUPCFqNgkEz24k,1315
|
81
81
|
uipath/models/context_grounding_index.py,sha256=0ADlH8fC10qIbakgwU89pRVawzJ36TiSDKIqOhUdhuA,2580
|
82
82
|
uipath/models/errors.py,sha256=gPyU4sKYn57v03aOVqm97mnU9Do2e7bwMQwiSQVp9qc,461
|
83
|
-
uipath/models/exceptions.py,sha256=
|
83
|
+
uipath/models/exceptions.py,sha256=zfcwoK1W_68R6e_8wKd4YG-9_OZsNzBQLngENTG56wU,1404
|
84
84
|
uipath/models/interrupt_models.py,sha256=UzuVTMVesI204YQ4qFQFaN-gN3kksddkrujofcaC7zQ,881
|
85
85
|
uipath/models/job.py,sha256=f9L6_kg_VP0dAYvdcz1DWEWzy4NZPdlpHREod0uNK1E,3099
|
86
86
|
uipath/models/llm_gateway.py,sha256=rUIus7BrUuuRriXqSJUE9FnjOyQ7pYpaX6hWEYvA6AA,1923
|
@@ -95,8 +95,8 @@ uipath/tracing/_traced.py,sha256=qeVDrds2OUnpdUIA0RhtF0kg2dlAZhyC1RRkI-qivTM,185
|
|
95
95
|
uipath/tracing/_utils.py,sha256=ZeensQexnw69jVcsVrGyED7mPlAU-L1agDGm6_1A3oc,10388
|
96
96
|
uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
|
97
97
|
uipath/utils/_endpoints_manager.py,sha256=hiGEu6vyfQJoeiiql6w21TNiG6tADUfXlVBimxPU1-Q,4160
|
98
|
-
uipath-2.0.
|
99
|
-
uipath-2.0.
|
100
|
-
uipath-2.0.
|
101
|
-
uipath-2.0.
|
102
|
-
uipath-2.0.
|
98
|
+
uipath-2.0.81.dist-info/METADATA,sha256=eaGtKIpbDbMq7-5xMj88FpQewyEFDFv7h8f58NHPAuk,6462
|
99
|
+
uipath-2.0.81.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
100
|
+
uipath-2.0.81.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
|
101
|
+
uipath-2.0.81.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
102
|
+
uipath-2.0.81.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|