GH-17: feat(pipeline): Add serialization for pipeline features#59
GH-17: feat(pipeline): Add serialization for pipeline features#59
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements serialization of the features attribute from getML Pipeline objects by adding new Pydantic models and updating the pipeline serialization process.
- Adds
FeatureandFeaturesPydantic models to represent feature metadata including name, index, target, importance, correlation, and SQL - Updates
PipelineInformationto include thefeaturesfield and implements theserialize_featuresfunction - Adds comprehensive unit tests and updates integration test data to validate the new functionality
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/getml_io/getml/features.py | Defines new Feature and Features Pydantic models for feature metadata |
| src/getml_io/metadata/pipeline_information.py | Updates PipelineInformation to include features field |
| src/getml_io/serialize/pipeline.py | Implements serialize_features function and updates pipeline serialization |
| tests/unit/types.py | Adds type definitions for testing feature types |
| tests/unit/conftest.py | Adds mock fixtures for testing feature serialization |
| tests/unit/serialize/test_pipeline.py | Adds unit test for serialize_features function |
| tests/unit/serialize/test_pipeline_information.py | Updates expected data to include empty features field |
| tests/unit/metadata/test_pipeline_information.py | Updates test data with comprehensive feature examples |
| tests/integration/data/ | Updates integration test data with actual feature serialization output |
Comments suppressed due to low confidence (1)
tests/unit/types.py:54
- [nitpick] The trailing comma should be retained for consistency with the rest of the type union. Consider changing this to
| Sequence[str]without removing the comma on the next line.
| float
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request successfully implements the serialization of the features attribute from a getML Pipeline object. It introduces new Pydantic models for features, updates the PipelineInformation model, and adds the corresponding serialization logic. The changes are well-tested with new unit tests and updated integration test data. The code is clean and follows good practices. I have one suggestion for a minor improvement in the serialization logic to enhance conciseness and robustness.
c418d16 to
8e973bd
Compare
be86507 to
7e4293c
Compare
Implements the serialization of the `features` attribute from a getML `Pipeline` object. - Adds new Pydantic models `Feature` and `Features` to represent feature metadata. - Updates `PipelineInformation` to include the `features` field. - Implements the `serialize_features` function to convert getML features into the new Pydantic model. - Adds comprehensive unit tests and updates integration test data.
8e973bd to
a34c757
Compare
Implements the serialization of the
featuresattribute from a getMLPipelineobject.FeatureandFeaturesto represent feature metadata.PipelineInformationto include thefeaturesfield.serialize_featuresfunction to convert getML features into the new Pydantic model.