Skip to content
Merged
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.1.40"
version = "0.1.41"
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 @@ -454,7 +454,9 @@ def _create_item_spec(
elif isinstance(item, QueueItem):
queue_item = item

item_data = queue_item.model_dump(exclude_unset=True, by_alias=True)
item_data = queue_item.model_dump(
mode="json", exclude_unset=True, by_alias=True
)
resolved_name = queue_name or item_data.get("Name")
if resolved_name is None:
raise ValueError(
Expand Down Expand Up @@ -493,9 +495,11 @@ def _create_items_spec(
"queueName": queue_name,
"commitType": commit_type.value,
"queueItems": [
item.model_dump(exclude_unset=True, by_alias=True)
item.model_dump(mode="json", exclude_unset=True, by_alias=True)
if isinstance(item, QueueItem)
else QueueItem(**item).model_dump(exclude_unset=True, by_alias=True)
else QueueItem(**item).model_dump(
mode="json", exclude_unset=True, by_alias=True
)
for item in items
],
},
Expand All @@ -519,7 +523,7 @@ def _create_transaction_item_spec(
transaction_item = item

transaction_data = transaction_item.model_dump(
exclude_unset=True, by_alias=True
mode="json", exclude_unset=True, by_alias=True
)
resolved_name = queue_name or transaction_data.get("Name")
if resolved_name is None:
Expand Down Expand Up @@ -580,7 +584,7 @@ def _complete_transaction_item_spec(
),
json={
"transactionResult": transaction_result.model_dump(
exclude_unset=True, by_alias=True
mode="json", exclude_unset=True, by_alias=True
)
},
headers={
Expand Down
34 changes: 34 additions & 0 deletions packages/uipath-platform/tests/services/test_queues_service.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from datetime import datetime, timezone

import pytest
from pytest_httpx import HTTPXMock
Expand Down Expand Up @@ -518,6 +519,39 @@ async def test_create_item_with_reference_async(
== f"UiPath.Python.Sdk/UiPath.Python.Sdk.Activities.QueuesService.create_item_async/{version}"
)

def test_create_item_with_datetime_fields(
self,
httpx_mock: HTTPXMock,
service: QueuesService,
base_url: str,
org: str,
tenant: str,
) -> None:
defer = datetime(2026, 5, 1, 9, 0, 0, tzinfo=timezone.utc)
due = datetime(2026, 5, 2, 17, 30, 0, tzinfo=timezone.utc)
risk = datetime(2026, 5, 2, 12, 0, 0, tzinfo=timezone.utc)
queue_item = QueueItem(
priority=QueueItemPriority.NORMAL,
specific_content={"key": "value"},
defer_date=defer,
due_date=due,
risk_sla_date=risk,
)
httpx_mock.add_response(
url=f"{base_url}{org}{tenant}/orchestrator_/odata/Queues/UiPathODataSvc.AddQueueItem",
status_code=200,
json={"Id": 1},
)

service.create_item(queue_item, queue_name="test-queue")

sent_request = httpx_mock.get_request()
assert sent_request is not None
body = json.loads(sent_request.content.decode())
assert body["itemData"]["DeferDate"] == defer.isoformat()
assert body["itemData"]["DueDate"] == due.isoformat()
assert body["itemData"]["RiskSlaDate"] == risk.isoformat()

def test_create_transaction_item(
self,
httpx_mock: HTTPXMock,
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/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires-python = ">=3.11"
dependencies = [
"uipath-core>=0.5.8, <0.6.0",
"uipath-runtime>=0.10.1, <0.11.0",
"uipath-platform>=0.1.39, <0.2.0",
"uipath-platform>=0.1.41, <0.2.0",
"click>=8.3.1",
"httpx>=0.28.1",
"pyjwt>=2.10.1",
Expand Down
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