Update to current linkml versions#165
Conversation
0f960a3 to
19114c1
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR updates LinkML dependencies to their current versions while also making adjustments to test expectations and internal type annotations in the codebase. Key changes include:
- Updating expected slot counts in the RDFS importer test.
- Adjusting type annotations and adding duplicate slot handling in the RDFS import engine.
- Extending slot inference tests in the CSV data generalizer and updating dependency versions in project configuration.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_importers/test_rdfs_importer.py | Adjusted test expectations to account for new slots. |
| tests/test_generalizers/test_csv_data_generalizer.py | Added new test cases for date and datetime inference. |
| schema_automator/importers/rdfs_import_engine.py | Updated type annotations and added duplicate slot warning; introduced slot range normalization. |
| schema_automator/generalizers/csv_data_generalizer.py | Refined inference logic for date versus datetime. |
| schema_automator/annotators/schema_annotator.py | Updated imports to remove conflicts. |
| pyproject.toml | Updated dependency versions. |
| .github/workflows/check-pull-request.yaml | Upgraded the cache action to v3. |
| if all( | ||
| not hasattr(parse(str(v)), 'hour') or | ||
| (parse(str(v)).hour == 0 and parse(str(v)).minute == 0 and parse(str(v)).second == 0) |
There was a problem hiding this comment.
Consider caching the result of parse(str(v)) in the loop to avoid computing it multiple times for the same value, which may improve performance.
| if all( | |
| not hasattr(parse(str(v)), 'hour') or | |
| (parse(str(v)).hour == 0 and parse(str(v)).minute == 0 and parse(str(v)).second == 0) | |
| parsed_values = {str(v): parse(str(v)) for v in nn_vals} | |
| if all( | |
| not hasattr(parsed_values[str(v)], 'hour') or | |
| (parsed_values[str(v)].hour == 0 and parsed_values[str(v)].minute == 0 and parsed_values[str(v)].second == 0) |
|
|
||
| for slot in self.generate_rdfs_properties(g, cls_slots): | ||
| sb.add_slot(slot) | ||
| if slot.name in sb.schema.slots: |
There was a problem hiding this comment.
[nitpick] Add a comment clarifying why duplicate slots are skipped, to improve code readability and maintainability.
Test were failing while importing the HCA project after updating linkml-runtime to 1.9.x because the schema for the file core ontology was trying to import this file: tests/outputs/hca/core/file/module/ontology/file_content_ontology.yaml when it was trying to import this file: tests/outputs/hca/module/ontology/file_content_ontology.yaml This was happening because it was importing "module/ontology/file_content_ontology.yaml" and expected to be importing from the root of the project. This was the behavior of linkml runtime before 1.9.x, but that changed in this PR, which was merged and released with 1.9.1: <linkml/linkml-runtime#368> The fix is to make this a relative path-- that is, the value `../../module/ontology/file_content_ontology.yaml`. Luckily, the value of the relative prefix was already in the code! It just wasn't being appended to the module path. This might have been an oversight that wasn't added since the code worked.
|
Typo in my last commit. I wrote:
I meant to write:
If this were my own branch, I'd force push a typo fix, but it's not! |
Trying to update to current versions of linkml and linkml-runtime.