Skip to content

Fix ImportError in kg_emb caused by SampleBaseDataset rename#1140

Open
MadhukarJukanti wants to merge 1 commit intosunlabuiuc:masterfrom
MadhukarJukanti:fix/kg-emb-import-error
Open

Fix ImportError in kg_emb caused by SampleBaseDataset rename#1140
MadhukarJukanti wants to merge 1 commit intosunlabuiuc:masterfrom
MadhukarJukanti:fix/kg-emb-import-error

Conversation

@MadhukarJukanti
Copy link
Copy Markdown

Fixes #952.

SampleBaseDataset was renamed to SampleDataset during the PyHealth 2.0
upgrade, but 7 files in the kg_emb module were never updated. Any user
importing from pyhealth.medcode.pretrained_embeddings.kg_emb hit an
immediate ImportError because SampleBaseDataset no longer exists in
pyhealth.datasets.

Updated all imports and type annotations across the affected files:

  • datasets/sample_kg_dataset.py
  • datasets/splitter.py
  • models/kg_base.py
  • models/complex.py
  • models/distmult.py
  • models/rotate.py
  • models/transe.py

Test plan

  • from pyhealth.medcode.pretrained_embeddings.kg_emb.datasets import SampleKGDataset no longer raises
    ImportError
  • from pyhealth.medcode.pretrained_embeddings.kg_emb.models import ComplEx, DistMult, RotatE, TransE no
    longer raises ImportError

And a short commit message (no body needed since the PR description covers it):

fix: update kg_emb imports from SampleBaseDataset to SampleDataset

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.

fix: kg_emb broken import in PyHealth 2.0

1 participant