Skip to content

refactor: remove unused @model_serializer decorators across chart classes#513

Merged
palewire merged 4 commits intochekos:mainfrom
palewire:cut-serialize
Nov 14, 2025
Merged

refactor: remove unused @model_serializer decorators across chart classes#513
palewire merged 4 commits intochekos:mainfrom
palewire:cut-serialize

Conversation

@palewire
Copy link
Collaborator

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.

…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.
@palewire palewire merged commit cce4e03 into chekos:main Nov 14, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant