Skip to content

Commit 4934b48

Browse files
committed
Fix linting errors
1 parent 411d528 commit 4934b48

File tree

7 files changed

+23
-25
lines changed

7 files changed

+23
-25
lines changed

src/a2a/server/apps/jsonrpc/jsonrpc_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
A2ARequest,
2626
AgentCard,
2727
CancelTaskRequest,
28+
DeleteTaskPushNotificationConfigRequest,
2829
GetTaskPushNotificationConfigRequest,
2930
GetTaskRequest,
3031
InternalError,
@@ -33,14 +34,13 @@
3334
JSONRPCError,
3435
JSONRPCErrorResponse,
3536
JSONRPCResponse,
37+
ListTaskPushNotificationConfigRequest,
3638
SendMessageRequest,
3739
SendStreamingMessageRequest,
3840
SendStreamingMessageResponse,
3941
SetTaskPushNotificationConfigRequest,
4042
TaskResubscriptionRequest,
4143
UnsupportedOperationError,
42-
ListTaskPushNotificationConfigRequest,
43-
DeleteTaskPushNotificationConfigRequest
4444
)
4545
from a2a.utils.errors import MethodNotImplementedError
4646

src/a2a/server/request_handlers/default_request_handler.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727
TaskStore,
2828
)
2929
from a2a.types import (
30+
DeleteTaskPushNotificationConfigParams,
3031
GetTaskPushNotificationConfigParams,
3132
InternalError,
3233
InvalidParamsError,
34+
ListTaskPushNotificationConfigParams,
3335
Message,
3436
MessageSendConfiguration,
3537
MessageSendParams,
@@ -41,10 +43,6 @@
4143
TaskQueryParams,
4244
TaskState,
4345
UnsupportedOperationError,
44-
ListTaskPushNotificationConfigParams,
45-
DeleteTaskPushNotificationConfigParams,
46-
DeleteTaskPushNotificationConfigResponse,
47-
DeleteTaskPushNotificationConfigSuccessResponse
4846
)
4947
from a2a.utils.errors import ServerError
5048
from a2a.utils.telemetry import SpanKind, trace_class
@@ -487,7 +485,7 @@ async def on_list_task_push_notification_config(
487485
task_push_notification_config.append(TaskPushNotificationConfig(
488486
taskId=params.id, pushNotificationConfig=config
489487
))
490-
488+
491489
return task_push_notification_config
492490

493491
async def on_delete_task_push_notification_config(

src/a2a/server/request_handlers/jsonrpc_handler.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
CancelTaskRequest,
1111
CancelTaskResponse,
1212
CancelTaskSuccessResponse,
13+
DeleteTaskPushNotificationConfigRequest,
14+
DeleteTaskPushNotificationConfigResponse,
15+
DeleteTaskPushNotificationConfigSuccessResponse,
1316
GetTaskPushNotificationConfigRequest,
1417
GetTaskPushNotificationConfigResponse,
1518
GetTaskPushNotificationConfigSuccessResponse,
@@ -18,6 +21,9 @@
1821
GetTaskSuccessResponse,
1922
InternalError,
2023
JSONRPCErrorResponse,
24+
ListTaskPushNotificationConfigRequest,
25+
ListTaskPushNotificationConfigResponse,
26+
ListTaskPushNotificationConfigSuccessResponse,
2127
Message,
2228
SendMessageRequest,
2329
SendMessageResponse,
@@ -34,12 +40,6 @@
3440
TaskPushNotificationConfig,
3541
TaskResubscriptionRequest,
3642
TaskStatusUpdateEvent,
37-
ListTaskPushNotificationConfigRequest,
38-
ListTaskPushNotificationConfigResponse,
39-
ListTaskPushNotificationConfigSuccessResponse,
40-
DeleteTaskPushNotificationConfigRequest,
41-
DeleteTaskPushNotificationConfigResponse,
42-
DeleteTaskPushNotificationConfigSuccessResponse
4343
)
4444
from a2a.utils.errors import ServerError
4545
from a2a.utils.helpers import validate
@@ -365,7 +365,7 @@ async def list_push_notification_config(
365365
id=request.id, error=e.error if e.error else InternalError()
366366
)
367367
)
368-
368+
369369
async def delete_push_notification_config(
370370
self,
371371
request: DeleteTaskPushNotificationConfigRequest,

src/a2a/server/request_handlers/request_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
from a2a.server.context import ServerCallContext
55
from a2a.server.events.event_queue import Event
66
from a2a.types import (
7+
DeleteTaskPushNotificationConfigParams,
78
GetTaskPushNotificationConfigParams,
9+
ListTaskPushNotificationConfigParams,
810
Message,
911
MessageSendParams,
1012
Task,
1113
TaskIdParams,
1214
TaskPushNotificationConfig,
1315
TaskQueryParams,
1416
UnsupportedOperationError,
15-
ListTaskPushNotificationConfigParams,
16-
DeleteTaskPushNotificationConfigParams
1717
)
1818
from a2a.utils.errors import ServerError
1919

src/a2a/server/request_handlers/response_helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
A2AError,
88
CancelTaskResponse,
99
CancelTaskSuccessResponse,
10+
DeleteTaskPushNotificationConfigResponse,
11+
DeleteTaskPushNotificationConfigSuccessResponse,
1012
GetTaskPushNotificationConfigResponse,
1113
GetTaskPushNotificationConfigSuccessResponse,
1214
GetTaskResponse,
1315
GetTaskSuccessResponse,
1416
InvalidAgentResponseError,
1517
JSONRPCError,
1618
JSONRPCErrorResponse,
19+
ListTaskPushNotificationConfigResponse,
20+
ListTaskPushNotificationConfigSuccessResponse,
1721
Message,
1822
SendMessageResponse,
1923
SendMessageSuccessResponse,
@@ -25,10 +29,6 @@
2529
TaskArtifactUpdateEvent,
2630
TaskPushNotificationConfig,
2731
TaskStatusUpdateEvent,
28-
ListTaskPushNotificationConfigResponse,
29-
DeleteTaskPushNotificationConfigResponse,
30-
ListTaskPushNotificationConfigSuccessResponse,
31-
DeleteTaskPushNotificationConfigSuccessResponse
3232
)
3333

3434

src/a2a/server/tasks/base_push_notification_sender.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
PushNotificationConfigStore,
77
)
88
from a2a.server.tasks.push_notification_sender import PushNotificationSender
9-
from a2a.types import Task, PushNotificationConfig
9+
from a2a.types import PushNotificationConfig, Task
1010

1111

1212
logger = logging.getLogger(__name__)
@@ -30,7 +30,7 @@ async def send_notification(self, task: Task) -> None:
3030
push_configs = await self._config_store.get_info(task.id)
3131
if not push_configs:
3232
return
33-
33+
3434
for push_info in push_configs:
3535
await self._dispatch_notification(task, push_info)
3636

src/a2a/server/tasks/inmemory_push_notification_config_store.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ async def set_info(
2727
async with self.lock:
2828
if task_id not in self._push_notification_infos:
2929
self._push_notification_infos[task_id] = []
30-
30+
3131
if notification_config.id is None:
3232
notification_config.id = task_id
33-
33+
3434
for config in self._push_notification_infos[task_id]:
3535
if config.id == notification_config.id:
3636
self._push_notification_infos[task_id].remove(config)
@@ -54,7 +54,7 @@ async def delete_info(self, task_id: str, config_id: str | None = None) -> None:
5454
configurations = self._push_notification_infos[task_id]
5555
if not configurations:
5656
return
57-
57+
5858
for config in configurations:
5959
if config.id == config_id:
6060
configurations.remove(config)

0 commit comments

Comments
 (0)