-
Notifications
You must be signed in to change notification settings - Fork 0
Add unit tests for map_data.py #212
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
Conversation
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.
Pull request overview
This PR adds comprehensive unit test coverage for the map_data.py module and includes supporting test data files. The changes also include a bug fix in the tsv_stream function to properly copy the headers list.
- Adds 570 lines of unit tests covering all major functions in map_data.py
- Includes test schemas and specifications in toy_data directory for integration testing
- Fixes a bug where headers list was referenced instead of copied in tsv_stream
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_map_data.py | Comprehensive unit tests for DataLoader, file discovery, streaming functions, transformation logic, and the main processing pipeline |
| toy_data/specs/person-spec.yaml | LinkML mapping specification for transforming demographics data to Person entity |
| toy_data/specs/participant-spec.yaml | LinkML mapping specification for transforming subject data to Participant entity |
| toy_data/schemas/source-schema.yaml | Source schema definition for demographics and subject data structures |
| toy_data/schemas/target-schema.yaml | Target schema definition for Person and Participant entity structures |
| toy_data/linkml-map-data/example-data_bdchm_updated_3.yaml | Removed unused example data file |
| src/dm_bip/map_data/map_data.py | Bug fix: Changed headers assignment to use list() for proper copy instead of reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@amc-corey-cox I've opened a new pull request, #224, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@amc-corey-cox I've opened a new pull request, #225, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: amc-corey-cox <[email protected]>
Co-authored-by: amc-corey-cox <[email protected]>
Align test pattern with production code in get_spec_files call
Align test search patterns with production regex usage
|
Per a conversation with @amc-corey-cox, I'm going to add type annotations before reviewing. |
|
Patrick, I'm going to merge this so we have a test suite before we do a refactor. If you were just adding type annotations, I'd want to do that first but the refactor to split out the streams (which I agree with) will break these tests and I want to have something to test with first. |
This adds a file to cover unit testing for map_data.py.