Skip to content

Add vocabulary-grouped embedding counts and filtered concept-id enumeration - #41

Merged
nicoloesch merged 1 commit into
mainfrom
26-embedding-catalogue
Jul 20, 2026
Merged

nicoloesch merged 1 commit into
mainfrom
26-embedding-catalogue

Conversation

@nicoloesch

@nicoloesch nicoloesch commented Jul 10, 2026 •

Copy link
Copy Markdown
Collaborator

Depends on AustralianCancerDataNetwork/omop-alchemy#57. Requires pyproject.toml version update for oa-configurator, orm-loader, and omop-alchemy

Summary

Root cause

  • relationship-classification was writing outside the configured CDM schema
    • a stale DROP TYPE no-op plus unqualified staging-table SQL.
  • The OAK-lib adapter (OMOPAlchemyImplementation) resolved a database URL but discarded its schema_translate_map, silently ignoring the configured schema for all ontology/concept traversal
  • omop_resource()/ OMOPAlchemyImplementation never wired a configured split vocabulary connection through to a real second engine at all
    • KnowledgeGraph silently collapsed to one connection whenever a caller, including every production path, omitted vocab_engine explicitly.

Fix

  • relationship-classification now respects the configured CDM schema end to end
  • The OAK-lib adapter carries its schema_translate_map through to the engine it builds, and skips engine construction entirely when a caller injects kg= directly.
  • omop_resource() now builds both the primary and vocabulary engines via oa-configurator's create_engines(), and OMOPAlchemyImplementation accepts and forwards a real vocab_engine
    • a genuinely separate vocabulary connection is now supported end to end in production
  • relationship_classification's DROP/CREATE is now wrapped in guard_schema_provenance_for to prevent schema drift
  • New test_schema_provenance_guard.py + test_relationship_classification_guard_fires_on_reconfigured_schema, proving the guard actually fires against a reconfigured schema
  • Adopts open_connection from oa-configurator, replacing a local hand-rolled _open_connection
  • Adopts physical_schema_of

Checklist

  • Applied exactly one label (breaking, feature, fix, dependencies, or chore)
  • Tests pass locally (uv run pytest -q): 46 passed
  • Lint passes (uv run ruff check .)

@nicoloesch

Copy link
Copy Markdown
Collaborator Author

Lint PR is failing because it is not adhering to our current CI/CD. Related to #39 and the decisions there.

@nicoloesch
nicoloesch requested a review from gkennos July 10, 2026 03:49
Comment thread src/omop_emb/interface.py
@gkennos
gkennos self-requested a review July 19, 2026 14:23
@nicoloesch nicoloesch added the feature New backwards-compatible functionality. MINOR: x.y+1.z label Jul 20, 2026
@nicoloesch
nicoloesch force-pushed the 26-embedding-catalogue branch from 144d3c6 to 667e5a9 Compare July 20, 2026 06:56
@nicoloesch
nicoloesch merged commit 5aaacb1 into main Jul 20, 2026
2 checks passed
@nicoloesch
nicoloesch deleted the 26-embedding-catalogue branch July 20, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New backwards-compatible functionality. MINOR: x.y+1.z

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants