Skip to content

Commit fd7aca9

Browse files
committed
chore: version bump
1 parent 6e6cde4 commit fd7aca9

4 files changed

Lines changed: 35 additions & 17 deletions

File tree

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"
3-
version = "2.6.26"
3+
version = "2.6.31"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath/platform/context_grounding/_context_grounding_service.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -782,14 +782,18 @@ def download_batch_transform_result(
782782

783783
Path(destination_path).parent.mkdir(parents=True, exist_ok=True)
784784

785+
# SAS uris can be downloaded without authentication
786+
# encrypted artifacts require authenticated DownloadBlob endpoint
785787
with open(destination_path, "wb") as file:
786788
if uri_response.is_encrypted:
787-
# Use authenticated client for encrypted artifacts
788-
file_content = self._client.get(
789-
uri_response.uri, headers=self.auth_headers
790-
).content
789+
download_spec = self._batch_transform_download_blob_spec(id=id)
790+
download_response = self.request(
791+
download_spec.method,
792+
download_spec.endpoint,
793+
headers=download_spec.headers,
794+
)
795+
file_content = download_response.content
791796
else:
792-
# Use unauthenticated client for non-encrypted artifacts
793797
with httpx.Client(**get_httpx_client_kwargs()) as client:
794798
file_content = client.get(uri_response.uri).content
795799
file.write(file_content)
@@ -835,14 +839,17 @@ async def download_batch_transform_result_async(
835839
)
836840
uri_response = BatchTransformReadUriResponse.model_validate(response.json())
837841

842+
# SAS uris can be downloaded without authentication
843+
# encrypted artifacts require authenticated DownloadBlob endpoint
838844
if uri_response.is_encrypted:
839-
# Use authenticated client for encrypted artifacts
840-
download_response = await self._client_async.get(
841-
uri_response.uri, headers=self.auth_headers
845+
download_spec = self._batch_transform_download_blob_spec(id=id)
846+
download_response = await self.request_async(
847+
download_spec.method,
848+
download_spec.endpoint,
849+
headers=download_spec.headers,
842850
)
843851
file_content = download_response.content
844852
else:
845-
# Use unauthenticated client for non-encrypted artifacts
846853
async with httpx.AsyncClient(**get_httpx_client_kwargs()) as client:
847854
download_response = await client.get(uri_response.uri)
848855
file_content = download_response.content
@@ -1530,6 +1537,15 @@ def _batch_transform_get_read_uri_spec(
15301537
endpoint=Endpoint(f"/ecs_/v2/batchRag/{id}/GetReadUri"),
15311538
)
15321539

1540+
def _batch_transform_download_blob_spec(
1541+
self,
1542+
id: str,
1543+
) -> RequestSpec:
1544+
return RequestSpec(
1545+
method="GET",
1546+
endpoint=Endpoint(f"/ecs_/v2/batchRag/{id}/DownloadBlob"),
1547+
)
1548+
15331549
def _resolve_folder_key(self, folder_key, folder_path):
15341550
if folder_key is None and folder_path is not None:
15351551
folder_key = self._folders_service.retrieve_key(folder_path=folder_path)

tests/sdk/services/test_context_grounding_service.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,13 +1794,13 @@ def test_download_batch_transform_result_encrypted(
17941794
url=f"{base_url}{org}{tenant}/ecs_/v2/batchRag/test-batch-id/GetReadUri",
17951795
status_code=200,
17961796
json={
1797-
"uri": f"{base_url}{org}{tenant}/storage/encrypted/result.csv",
1797+
"uri": f"{base_url}{org}{tenant}/ecs_/v2/batchRag/test-batch-id/DownloadBlob",
17981798
"isEncrypted": True,
17991799
},
18001800
)
18011801

18021802
httpx_mock.add_response(
1803-
url=f"{base_url}{org}{tenant}/storage/encrypted/result.csv",
1803+
url=f"{base_url}{org}{tenant}/ecs_/v2/batchRag/test-batch-id/DownloadBlob",
18041804
status_code=200,
18051805
content=b"encrypted,data\nval1,val2",
18061806
)
@@ -1818,9 +1818,10 @@ def test_download_batch_transform_result_encrypted(
18181818
if sent_requests is None:
18191819
raise Exception("No request was sent")
18201820

1821-
# Verify the download request includes Authorization header
1821+
# Verify the DownloadBlob endpoint was called with Authorization header
18221822
download_request = sent_requests[2]
18231823
assert download_request.method == "GET"
1824+
assert "/DownloadBlob" in str(download_request.url)
18241825
assert "Authorization" in download_request.headers
18251826
assert download_request.headers["Authorization"].startswith("Bearer ")
18261827

@@ -2019,13 +2020,13 @@ async def test_download_batch_transform_result_async_encrypted(
20192020
url=f"{base_url}{org}{tenant}/ecs_/v2/batchRag/test-batch-id/GetReadUri",
20202021
status_code=200,
20212022
json={
2022-
"uri": f"{base_url}{org}{tenant}/storage/encrypted/result.csv",
2023+
"uri": f"{base_url}{org}{tenant}/ecs_/v2/batchRag/test-batch-id/DownloadBlob",
20232024
"isEncrypted": True,
20242025
},
20252026
)
20262027

20272028
httpx_mock.add_response(
2028-
url=f"{base_url}{org}{tenant}/storage/encrypted/result.csv",
2029+
url=f"{base_url}{org}{tenant}/ecs_/v2/batchRag/test-batch-id/DownloadBlob",
20292030
status_code=200,
20302031
content=b"encrypted,data\nval1,val2",
20312032
)
@@ -2043,8 +2044,9 @@ async def test_download_batch_transform_result_async_encrypted(
20432044
if sent_requests is None:
20442045
raise Exception("No request was sent")
20452046

2046-
# Verify the download request includes Authorization header
2047+
# Verify the DownloadBlob endpoint was called with Authorization header
20472048
download_request = sent_requests[2]
20482049
assert download_request.method == "GET"
2050+
assert "/DownloadBlob" in str(download_request.url)
20492051
assert "Authorization" in download_request.headers
20502052
assert download_request.headers["Authorization"].startswith("Bearer ")

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.

0 commit comments

Comments
 (0)