Skip to content

Conversation

@amc-corey-cox
Copy link
Collaborator

This adds a file to cover unit testing for map_data.py.

Copy link
Contributor

Copilot AI left a 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.

Copy link
Contributor

Copilot AI commented Dec 15, 2025

@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.

Copy link
Contributor

Copilot AI commented Dec 15, 2025

@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.

Copilot AI and others added 4 commits December 15, 2025 20:32
Align test pattern with production code in get_spec_files call
Align test search patterns with production regex usage
@ptgolden
Copy link
Collaborator

Per a conversation with @amc-corey-cox, I'm going to add type annotations before reviewing.

@amc-corey-cox
Copy link
Collaborator Author

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.

@amc-corey-cox amc-corey-cox merged commit e958296 into main Dec 19, 2025
2 checks passed
@amc-corey-cox amc-corey-cox deleted the map_tests_210 branch December 19, 2025 14:01
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.

3 participants