-
Notifications
You must be signed in to change notification settings - Fork 28
fix: ontology_bump skip to support '||' separator. #1467
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 enhances the ontology bump dry run script to support both comma (,) and double-pipe (||) delimiters when parsing ontology term IDs, improving robustness for different data formats.
- Added conditional logic to handle both
,and||separators in ontology term ID parsing - Refactored tests to use parameterized testing for both delimiter types
- Added proper whitespace trimming for parsed term IDs
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ontology_bump_dry_run.py | Enhanced map_deprecated_terms function to support both comma and double-pipe delimited ontology term IDs |
| test_ontology_bump_dry_run.py | Refactored test to use pytest parametrize for testing both delimiter types |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if "," in ontology_term["ontology_term_id"]: | ||
| ontology_term_ids = [term_id.strip() for term_id in ontology_term["ontology_term_id"].split(",")] | ||
| elif "||" in ontology_term["ontology_term_id"]: | ||
| ontology_term_ids = [term_id.strip() for term_id in ontology_term["ontology_term_id"].split("||")] | ||
| else: | ||
| ontology_term_ids = [ontology_term["ontology_term_id"]] |
Copilot
AI
Oct 6, 2025
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.
The conditional logic will fail for strings containing both ',' and '||' delimiters. If a string contains both separators, only the comma logic will execute, potentially leaving '||' separators unparsed. Consider defining a priority order or handling mixed delimiters explicitly.
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.
I think the proper delimiter here is " || ", per the schema. Else we'll have leading + trailing whitespaces. Verify that assumption and update here and in the tests
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1467 +/- ##
==========================================
+ Coverage 89.22% 89.33% +0.10%
==========================================
Files 23 23
Lines 2738 2756 +18
==========================================
+ Hits 2443 2462 +19
+ Misses 295 294 -1
🚀 New features to boost your workflow:
|
Reason for Change
This pull request enhances the handling of ontology term IDs in the ontology bump dry run script and improves the associated test coverage. The main improvements are the ability to support both comma- and double-pipe-delimited ontology term IDs, and a refactored, parameterized test to ensure both cases are properly handled.
Ontology term ID parsing improvements:
map_deprecated_termsinontology_bump_dry_run.pyto support both comma (,) and double-pipe (||) delimiters when splittingontology_term_idvalues, ensuring robust parsing of multiple term IDs.Testing enhancements:
test_ontology_bump_dry_run.pyto usepytest.mark.parametrize, covering both comma and double-pipe delimiters and generalizing the expected output file selection.