refactor: remove unused @model_serializer decorators across chart classes#513
Merged
palewire merged 4 commits intochekos:mainfrom Nov 14, 2025
Merged
refactor: remove unused @model_serializer decorators across chart classes#513palewire merged 4 commits intochekos:mainfrom
palewire merged 4 commits intochekos:mainfrom
Conversation
…sses Remove @model_serializer decorator from serialize_model methods in all chart classes (area, arrow, bar, column, line, multiple_column, etc.) and update pydantic imports accordingly. The serialize_model methods are still present but no longer decorated, suggesting a change in serialization strategy or that explicit decoration is no longer needed for the current implementation. This cleanup reduces unnecessary decorator usage while maintaining the serialization functionality.
Replace all instances of `model_dump()` and `model_dump(by_alias=True)` with the new `serialize_model()` method across integration tests. This standardizes serialization to use a consistent custom method that handles aliasing and other serialization requirements internally. Changes: - Updated test_base_metadata_structure.py - Updated test_base_serialization.py - Updated test_multiple_column_chart.py This improves code maintainability by centralizing serialization logic and provides a cleaner API for converting chart models to dictionaries.
Refactor scatter chart and stacked bar chart integration tests to use the new `serialize_model()` method instead of directly calling `model_dump(by_alias=True)`. This change standardizes serialization across the test suite and uses the proper abstraction layer for model serialization.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove @model_serializer decorator from serialize_model methods in all chart classes (area, arrow, bar, column, line, multiple_column, etc.) and update pydantic imports accordingly. The serialize_model methods are still present but no longer decorated, suggesting a change in serialization strategy or that explicit decoration is no longer needed for the current implementation.
This cleanup reduces unnecessary decorator usage while maintaining the serialization functionality.