Skip to content
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

fix: serialize BaseModel subclasses and avoid calling methods on types #4479

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This pull request addresses the serialization of BaseModel subclasses by ensuring that type objects are handled separately. The changes prevent type objects from being incorrectly serialized as instances, improving the overall serialization logic. This update enhances the robustness of the serialization process for models derived from BaseModel.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 8, 2024
@ogabrielluiz ogabrielluiz enabled auto-merge (squash) November 8, 2024 19:55
@dosubot dosubot bot added the bug Something isn't working label Nov 8, 2024
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Nov 8, 2024
Copy link

codspeed-hq bot commented Nov 8, 2024

CodSpeed Performance Report

Merging #4479 will degrade performances by 14.95%

Comparing fix-serialization-issubclass (956d9d2) with main (8681c56)

Summary

⚡ 1 improvements
❌ 3 regressions
✅ 11 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main fix-serialization-issubclass Change
test_invalid_run_with_input_type_chat 14.8 ms 17.4 ms -14.95%
test_successful_run_with_input_type_text 449.8 ms 527.2 ms -14.67%
test_successful_run_with_output_type_any 453.7 ms 322.8 ms +40.54%
test_successful_run_with_output_type_debug 451.6 ms 530 ms -14.78%

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 9, 2024
@ogabrielluiz ogabrielluiz merged commit 69a1c16 into main Nov 9, 2024
28 checks passed
@ogabrielluiz ogabrielluiz deleted the fix-serialization-issubclass branch November 9, 2024 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants