Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ disable = ["R0801"]
extend-exclude = ["tests/profiles/syntax_error.py"]

[tool.ruff.lint]
extend-select = ["TID251", "UP006", "UP007", "UP035", "RUF100"]
extend-select = ["TID251", "UP006", "UP007", "UP017", "UP035", "RUF100"]

[tool.ruff.lint.flake8-tidy-imports.banned-api]
unittest = { msg = "use pytest instead of unittest" }
Expand Down
16 changes: 8 additions & 8 deletions src/app/endpoints/a2a.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import uuid
from collections.abc import Mapping, AsyncIterator, MutableMapping
from datetime import datetime, timezone
from datetime import datetime, UTC
from typing import Annotated, Any, Optional

from a2a.server.agent_execution import AgentExecutor, RequestContext
Expand Down Expand Up @@ -381,7 +381,7 @@ async def _process_task_streaming( # pylint: disable=too-many-locals
task_id=task_id,
status=TaskStatus(
state=TaskState.working,
timestamp=datetime.now(timezone.utc).isoformat(),
timestamp=datetime.now(UTC).isoformat(),
),
context_id=context_id,
final=False,
Expand All @@ -403,14 +403,14 @@ async def _process_task_streaming( # pylint: disable=too-many-locals
if aggregator.task_state == TaskState.working:
await task_updater.update_status(
TaskState.completed,
timestamp=datetime.now(timezone.utc).isoformat(),
timestamp=datetime.now(UTC).isoformat(),
final=True,
)
else:
await task_updater.update_status(
aggregator.task_state,
message=aggregator.task_status_message,
timestamp=datetime.now(timezone.utc).isoformat(),
timestamp=datetime.now(UTC).isoformat(),
final=True,
)

Expand Down Expand Up @@ -459,7 +459,7 @@ async def _convert_stream_to_events( # pylint: disable=too-many-branches,too-ma
context_id=context_id,
task_id=task_id,
),
timestamp=datetime.now(timezone.utc).isoformat(),
timestamp=datetime.now(UTC).isoformat(),
),
context_id=context_id,
final=False,
Expand All @@ -477,7 +477,7 @@ async def _convert_stream_to_events( # pylint: disable=too-many-branches,too-ma
context_id=context_id,
task_id=task_id,
),
timestamp=datetime.now(timezone.utc).isoformat(),
timestamp=datetime.now(UTC).isoformat(),
),
context_id=context_id,
final=False,
Expand All @@ -495,7 +495,7 @@ async def _convert_stream_to_events( # pylint: disable=too-many-branches,too-ma
context_id=context_id,
task_id=task_id,
),
timestamp=datetime.now(timezone.utc).isoformat(),
timestamp=datetime.now(UTC).isoformat(),
),
context_id=context_id,
final=False,
Expand Down Expand Up @@ -891,5 +891,5 @@ async def a2a_health_check() -> dict[str, str]:
"service": "lightspeed-a2a",
"version": __version__,
"a2a_sdk_version": "0.3.4",
"timestamp": datetime.now(timezone.utc).isoformat(),
"timestamp": datetime.now(UTC).isoformat(),
}
2 changes: 1 addition & 1 deletion src/app/endpoints/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ async def query_endpoint_handler(
quota_limiters=configuration.quota_limiters, user_id=user_id
)

completed_at = datetime.datetime.now(datetime.timezone.utc).strftime(
completed_at = datetime.datetime.now(datetime.UTC).strftime(
"%Y-%m-%dT%H:%M:%SZ"
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
conversation_id = normalize_conversation_id(responses_params.conversation)
Expand Down
Loading