Skip to content

bug(medcat): CU-869cqnmtk Fix RelCAT typing issue#388

Merged
mart-r merged 3 commits intomainfrom
bug/medcat/CU-869cqnmtk-fix-relcat-typing-issue
Apr 1, 2026
Merged

bug(medcat): CU-869cqnmtk Fix RelCAT typing issue#388
mart-r merged 3 commits intomainfrom
bug/medcat/CU-869cqnmtk-fix-relcat-typing-issue

Conversation

@mart-r
Copy link
Copy Markdown
Collaborator

@mart-r mart-r commented Apr 1, 2026

This PR fixes a typing issue in RelCAT.

Was surfaced by the nightly stability workflow:
https://github.com/CogStack/cogstack-nlp/actions/runs/23831367419/job/69465708972

Run uv run --python 3.10 python -m mypy --follow-imports=normal medcat
Uninstalled 1 package in 10ms
Installed 1 package in 2ms
medcat/components/addons/relation_extraction/config.py:20: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/components/addons/relation_extraction/modernbert/model.py:92: error: Cannot access instance-only attribute "pretrained_model_name_or_path" on class object  [misc]
medcat/components/addons/relation_extraction/llama/model.py:221: error: Cannot access instance-only attribute "pretrained_model_name_or_path" on class object  [misc]
medcat/components/addons/relation_extraction/bert/model.py:87: error: Cannot access instance-only attribute "pretrained_model_name_or_path" on class object  [misc]
medcat/plugins/registry.py:33: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/components/ner/trf/transformers_ner.py:366: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:43: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:44: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:45: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:46: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:47: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:48: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:49: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:50: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:51: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/stats/stats.py:52: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
medcat/pipeline/speed_utils.py:142: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
Found 3 errors in 3 files (checked 152 source files)

Honestly not quite sure why this wasn't found before. My best guess is that either transformers changed (e.g in v5 the config is a data class) or mypy had an update.

@mart-r mart-r merged commit b43c22e into main Apr 1, 2026
22 checks passed
@mart-r mart-r deleted the bug/medcat/CU-869cqnmtk-fix-relcat-typing-issue branch April 1, 2026 09:15
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.

2 participants