Fix PatientLinkageMIMIC3Task crashing on invalid processor names - #1204
Merged
Conversation
lehendo
commented
Aug 25, 2026
Collaborator
- input_schema used "integer"/"string"/"datetime" processor-type strings, none of which are registered in pyhealth.processors, so dataset.set_task() failed immediately with ValueError: Unknown processor. Fixed to use "raw" (pass-through), the correct processor for these metadata fields
- Fix the class docstring's example, which referenced a non-existent patient_linkage_mimic3 importable name instead of the class itself
- Add the missing docs page for PatientLinkageMIMIC3Task
- examples/patient_linkage_mimic3_medlink.py uses this exact class and was broken by the same bug plus two unrelated .stat()/.stats() typos; fix the typos and confirm data loading + task application now run and produce real samples
- input_schema used "integer"/"string"/"datetime" processor-type strings, none of which are registered in pyhealth.processors, so dataset.set_task() failed immediately with ValueError: Unknown processor. Fixed to use "raw" (pass-through), the correct processor for these metadata fields. Verified end-to-end against real MIMIC-III data. - Fix the class docstring's example, which referenced a non-existent patient_linkage_mimic3 importable name instead of the class itself. - Add the missing docs page for PatientLinkageMIMIC3Task. - examples/patient_linkage_mimic3_medlink.py uses this exact class and was broken by the same bug plus two unrelated .stat()/.stats() typos; fix the typos and confirm data loading + task application now run and produce real samples. The rest of that example (MedLink model training, BM25, ranking metrics) is unverified and out of scope here.
Contributor
|
|
…kage example A reviewer (DarylOkeke) on PR sunlabuiuc#1204 pointed out that even after fixing PatientLinkageMIMIC3Task's processor-name crash, the example script still failed one line later: SampleDataset has no .samples attribute (only __iter__/__getitem__/__len__), so convert_to_ir_format(sample_dataset.samples) raised AttributeError. Confirmed directly: reproduced the exact AttributeError against real MIMIC-III demo data. convert_to_ir_format() only iterates its argument, so passing sample_dataset directly (dropping .samples) works -- confirmed via a new regression test that runs the real set_task() -> convert_to_ir_format() pipeline end to end.
Collaborator
Author
|
@DarylOkeke fixed. Pls let me know if we are good to merge. |
Contributor
|
Looks good. |
Contributor
Looks good!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.