Skip to content

Commit aa892d4

Browse files
committed
spelling: pydantic
Signed-off-by: Josh Soref <[email protected]>
1 parent 7a84f45 commit aa892d4

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/google/adk/evaluation/agent_evaluator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from .eval_sets_manager import EvalSetsManager
4444
from .evaluator import EvalStatus
4545
from .in_memory_eval_sets_manager import InMemoryEvalSetsManager
46-
from .local_eval_sets_manager import convert_eval_set_to_pydanctic_schema
46+
from .local_eval_sets_manager import convert_eval_set_to_pydantic_schema
4747

4848
logger = logging.getLogger("google_adk." + __name__)
4949

@@ -299,7 +299,7 @@ def _get_eval_set_from_old_format(
299299
"data": data,
300300
"initial_session": initial_session,
301301
}
302-
return convert_eval_set_to_pydanctic_schema(
302+
return convert_eval_set_to_pydantic_schema(
303303
eval_set_id=str(uuid.uuid4()), eval_set_in_json_format=[eval_data]
304304
)
305305

src/google/adk/evaluation/local_eval_sets_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def _convert_invocation_to_pydantic_schema(
8585
)
8686

8787

88-
def convert_eval_set_to_pydanctic_schema(
88+
def convert_eval_set_to_pydantic_schema(
8989
eval_set_id: str,
9090
eval_set_in_json_format: list[dict[str, Any]],
9191
) -> EvalSet:
@@ -183,7 +183,7 @@ def load_eval_set_from_file(
183183
except ValidationError:
184184
# We assume that the eval data was specified in the old format and try
185185
# to convert it to the new format.
186-
return convert_eval_set_to_pydanctic_schema(
186+
return convert_eval_set_to_pydantic_schema(
187187
eval_set_id, json.loads(content)
188188
)
189189

tests/unittests/evaluation/test_local_eval_sets_manager.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424
from google.adk.evaluation.eval_case import Invocation
2525
from google.adk.evaluation.eval_set import EvalSet
2626
from google.adk.evaluation.local_eval_sets_manager import _EVAL_SET_FILE_EXTENSION
27-
from google.adk.evaluation.local_eval_sets_manager import convert_eval_set_to_pydanctic_schema
27+
from google.adk.evaluation.local_eval_sets_manager import convert_eval_set_to_pydantic_schema
2828
from google.adk.evaluation.local_eval_sets_manager import load_eval_set_from_file
2929
from google.adk.evaluation.local_eval_sets_manager import LocalEvalSetsManager
3030
from google.genai import types as genai_types
3131
from pydantic import ValidationError
3232
import pytest
3333

3434

35-
class TestConvertEvalSetToPydancticSchema:
36-
"""Tests convert_eval_set_to_pydanctic_schema method."""
35+
class TestConvertEvalSetToPydanticSchema:
36+
"""Tests convert_eval_set_to_pydantic_schema method."""
3737

38-
def test_convert_eval_set_to_pydanctic_schema_complete(self):
38+
def test_convert_eval_set_to_pydantic_schema_complete(self):
3939
eval_set_id = "test_eval_set"
4040
eval_set_in_json_format = [{
4141
"name": "roll_17_sided_dice_twice",
@@ -71,7 +71,7 @@ def test_convert_eval_set_to_pydanctic_schema_complete(self):
7171
},
7272
}]
7373

74-
eval_set = convert_eval_set_to_pydanctic_schema(
74+
eval_set = convert_eval_set_to_pydantic_schema(
7575
eval_set_id, eval_set_in_json_format
7676
)
7777

@@ -93,14 +93,14 @@ def test_convert_eval_set_to_pydanctic_schema_complete(self):
9393
== 1
9494
)
9595

96-
def test_convert_eval_set_to_pydanctic_schema_minimal(self):
96+
def test_convert_eval_set_to_pydantic_schema_minimal(self):
9797
eval_set_id = "test_eval_set"
9898
eval_set_in_json_format = [{
9999
"name": "minimal_case",
100100
"data": [{"query": "Hello", "reference": "World"}],
101101
}]
102102

103-
eval_set = convert_eval_set_to_pydanctic_schema(
103+
eval_set = convert_eval_set_to_pydantic_schema(
104104
eval_set_id, eval_set_in_json_format
105105
)
106106

@@ -117,7 +117,7 @@ def test_convert_eval_set_to_pydanctic_schema_minimal(self):
117117
== "World"
118118
)
119119

120-
def test_convert_eval_set_to_pydanctic_schema_empty_tool_use_and_intermediate_responses(
120+
def test_convert_eval_set_to_pydantic_schema_empty_tool_use_and_intermediate_responses(
121121
self,
122122
):
123123
eval_set_id = "test_eval_set"
@@ -131,7 +131,7 @@ def test_convert_eval_set_to_pydanctic_schema_empty_tool_use_and_intermediate_re
131131
}],
132132
}]
133133

134-
eval_set = convert_eval_set_to_pydanctic_schema(
134+
eval_set = convert_eval_set_to_pydantic_schema(
135135
eval_set_id, eval_set_in_json_format
136136
)
137137

@@ -150,22 +150,22 @@ def test_convert_eval_set_to_pydanctic_schema_empty_tool_use_and_intermediate_re
150150
== 0
151151
)
152152

153-
def test_convert_eval_set_to_pydanctic_schema_empty_initial_session(self):
153+
def test_convert_eval_set_to_pydantic_schema_empty_initial_session(self):
154154
eval_set_id = "test_eval_set"
155155
eval_set_in_json_format = [{
156156
"name": "empty_session",
157157
"data": [{"query": "Test", "reference": "Test Ref"}],
158158
"initial_session": {},
159159
}]
160160

161-
eval_set = convert_eval_set_to_pydanctic_schema(
161+
eval_set = convert_eval_set_to_pydantic_schema(
162162
eval_set_id, eval_set_in_json_format
163163
)
164164

165165
assert eval_set.eval_set_id == eval_set_id
166166
assert eval_set.eval_cases[0].session_input is None
167167

168-
def test_convert_eval_set_to_pydanctic_schema_invalid_data(self):
168+
def test_convert_eval_set_to_pydantic_schema_invalid_data(self):
169169
# This test implicitly checks for potential validation errors during Pydantic
170170
# object creation
171171
eval_set_id = "test_eval_set"
@@ -190,7 +190,7 @@ def test_convert_eval_set_to_pydanctic_schema_invalid_data(self):
190190
}]
191191

192192
with pytest.raises(ValidationError):
193-
convert_eval_set_to_pydanctic_schema(eval_set_id, eval_set_in_json_format)
193+
convert_eval_set_to_pydantic_schema(eval_set_id, eval_set_in_json_format)
194194

195195

196196
class TestLoadEvalSetFromFile:
@@ -300,14 +300,14 @@ def test_load_eval_set_from_file_invalid_json(self, tmp_path):
300300
def test_load_eval_set_from_file_invalid_data(self, tmp_path, mocker):
301301
# Create a dummy file with invalid data that fails both Pydantic validation
302302
# and the old format conversion. We mock the
303-
# convert_eval_set_to_pydanctic_schema function to raise a ValueError
303+
# convert_eval_set_to_pydantic_schema function to raise a ValueError
304304
# so that we can assert that the exception is raised.
305305
file_path = tmp_path / "invalid_data.json"
306306
with open(file_path, "w", encoding="utf-8") as f:
307307
f.write('{"invalid": "data"}')
308308

309309
mocker.patch(
310-
"google.adk.evaluation.local_eval_sets_manager.convert_eval_set_to_pydanctic_schema",
310+
"google.adk.evaluation.local_eval_sets_manager.convert_eval_set_to_pydantic_schema",
311311
side_effect=ValueError(),
312312
)
313313

0 commit comments

Comments
 (0)