Skip to content

Conversation

@Bento007
Copy link
Contributor

@Bento007 Bento007 commented Oct 6, 2025

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:

  • Updated map_deprecated_terms in ontology_bump_dry_run.py to support both comma (,) and double-pipe (||) delimiters when splitting ontology_term_id values, ensuring robust parsing of multiple term IDs.

Testing enhancements:

  • Refactored the test for multi-delimited ontology term IDs in test_ontology_bump_dry_run.py to use pytest.mark.parametrize, covering both comma and double-pipe delimiters and generalizing the expected output file selection.

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

Comment on lines 54 to 59
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"]]
Copy link

Copilot AI Oct 6, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

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
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.33%. Comparing base (1d262b2) to head (68d8465).
⚠️ Report is 1 commits behind head on main.

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     
Components Coverage Δ
cellxgene_schema_cli 89.79% <ø> (+0.04%) ⬆️
migration_assistant 91.26% <ø> (ø)
schema_bump_dry_run_genes 79.74% <ø> (ø)
schema_bump_dry_run_ontologies 99.55% <100.00%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Bento007 Bento007 merged commit 0137a60 into main Oct 7, 2025
16 of 17 checks passed
@Bento007 Bento007 deleted the tsmith/ontology_bump branch October 7, 2025 19:05
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.

4 participants