Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
neg.json
Rule_underscores.json
pos.json
This PR updates the get_codelist_attributes operator for rule cg0288. The operation now correctly works for blank rows, only returns CT for rows that have a CT package corresponding with the CT from the operation params. To test-- run the rule above (has an exists clause that the editor test data does not)
Key changes include:
Refactoring and Enhancements to Codelist Attribute Extraction:
_get_codelist_attributesinget_codelist_attributes.pyto use a new row-wise mapping approach for determining CT package names, supporting both pandas and Dask datasets, and mapping packages to codelist sets more efficiently. [1] [2]Improvements to Controlled Terminology Package Handling:
ct_packageparameter in favor of the pluralct_packageseverywhere, simplifying parameter handling and reducing confusion. [1] [2] [3]Test Suite Updates:
get_codelist_attributesto match the new CT package structure, includingsubmission_lookupand detailed term metadata, ensuring tests reflect the new logic and data model. [1] [2] [3]Bug Fixes and Data Handling:
is_contained_byto ensure compatibility with pandasisinand vectorized operations.These changes collectively make the codebase more robust, easier to maintain, and ready for future extensions in codelist and controlled terminology processing.