-
Notifications
You must be signed in to change notification settings - Fork 2.7k
bugfix: Write JSON formatted string #3994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
bb7e82a
3e83554
7575627
f2b9bdd
acb35ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,7 +88,7 @@ def test_save_eval_set_result(self, mocker): | |
| actual_eval_set_result_json = json.load(f) | ||
|
|
||
| # need to convert eval_set_result to json | ||
| expected_eval_set_result_json = self.eval_set_result.model_dump_json() | ||
| expected_eval_set_result_json = self.eval_set_result.model_dump(mode="json") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change correctly aligns the test with the fix in the application code. However, similar to the main code, the variable |
||
| assert expected_eval_set_result_json == actual_eval_set_result_json | ||
|
|
||
| def test_get_eval_set_result(self, mocker): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this change correctly fixes the serialization bug, the variable
eval_set_result_jsonnow holds a Python dictionary rather than a JSON string, making the name misleading. For improved code clarity, I recommend renaming it to something likeeval_set_result_dataoreval_set_result_dict. Note that this would also require updating the variable name on line 64.