fix: replace removed SampleBaseDataset in kg_emb#953
Open
capccode wants to merge 1 commit intosunlabuiuc:masterfrom
Open
fix: replace removed SampleBaseDataset in kg_emb#953capccode wants to merge 1 commit intosunlabuiuc:masterfrom
capccode wants to merge 1 commit intosunlabuiuc:masterfrom
Conversation
…was deleted in PyHealth 2 refactor breaking all imports from pretrained_embeddings, add pandarallel to graph optional deps
jhnwu3
requested changes
Apr 8, 2026
Collaborator
jhnwu3
left a comment
There was a problem hiding this comment.
Ah I see, there's an entirely separate SampleKGDataset here. Can you work with @joshuasteier later after our deadliens here to revamp it towards the graph/ module here.
The problem is we still want it to all follow through the PyHealth pipeline here, i.e like we do with GraphCare's implementation as technically Graphs are not disjoint from any other modality here. We just have a bunch of old technical debt that's stuck here.
Will hopefully get to your GRASP PR at some point.
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.
Summary
Closes #952
SampleBaseDatasetwas deleted in the PyHealth 2.0 dataset refactor (commit 62df8d8), breaking all imports ofpyhealth.medcode.pretrained_embeddings. Anyone importing the kg_emb module gets anImportError.SampleKGDatasetnow inherits fromtorch.utils.data.Datasetdirectly, inlining the three fields (samples,dataset_name,task_name) and__len__that the deleted parent providedfrom pyhealth.datasets import SampleBaseDatasetimport and type annotations from 5 model files and the splitterpandaralleltographoptional dependencies (required byumls.py)Files changed (8):
kg_emb/datasets/sample_kg_dataset.py— new parent class + inlined fieldskg_emb/datasets/splitter.py— removed broken importkg_emb/models/kg_base.py,complex.py,distmult.py,rotate.py,transe.py— removed broken importpyproject.toml— addedpandarallelto[project.optional-dependencies] graphTest plan
from pyhealth.medcode.pretrained_embeddings import *no longer crashesSampleKGDatasetworks withtorch.utils.data.DataLoaderkg_emb.datasets.splitter.split()workslm_embis unaffected (noSampleBaseDatasetreferences)