Skip to content

Commit 2147f93

Browse files
committed
Formatting
1 parent 5e88be6 commit 2147f93

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

noxfile.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,15 @@ def format(session):
114114
'pyupgrade',
115115
'autoflake',
116116
'ruff',
117+
'no_implicit_optional',
117118
)
118119

119120
if lint_paths_py:
121+
session.run(
122+
'no_implicit_optional',
123+
'--use-union-or',
124+
*lint_paths_py,
125+
)
120126
if not format_all:
121127
session.run(
122128
'pyupgrade',

src/a2a/utils/task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def completed_task(
1818
task_id: str,
1919
context_id: str,
2020
artifacts: list[Artifact],
21-
history: list[Message] = None,
21+
history: list[Message] | None = None,
2222
) -> Task:
2323
if history is None:
2424
history = []

tests/utils/test_helpers.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
from typing import Any
2+
23
import pytest
3-
from a2a.utils.helpers import (
4-
create_task_obj,
5-
append_artifact_to_task,
6-
build_text_artifact,
7-
validate,
8-
)
4+
95
from a2a.types import (
106
Artifact,
11-
MessageSendParams,
127
Message,
8+
MessageSendParams,
9+
Part,
1310
Task,
1411
TaskArtifactUpdateEvent,
1512
TaskState,
1613
TextPart,
17-
Part,
1814
)
1915
from a2a.utils.errors import ServerError
16+
from a2a.utils.helpers import (
17+
append_artifact_to_task,
18+
build_text_artifact,
19+
create_task_obj,
20+
validate,
21+
)
22+
2023

2124
# --- Helper Data ---
2225
TEXT_PART_DATA: dict[str, Any] = {'type': 'text', 'text': 'Hello'}

tests/utils/test_telemetry.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import pytest
21
import asyncio
2+
33
from unittest import mock
4-
from a2a.utils.telemetry import trace_function, trace_class
4+
5+
import pytest
6+
7+
from a2a.utils.telemetry import trace_class, trace_function
58

69

710
@pytest.fixture
811
def mock_span():
9-
span = mock.MagicMock()
10-
return span
12+
return mock.MagicMock()
1113

1214

1315
@pytest.fixture

0 commit comments

Comments
 (0)