Skip to content

[v2.0] Stop reading OmopEmbConfig deep inside EmbeddingClient and resolve_backend#50

Open
nicoloesch wants to merge 2 commits into
mainfrom
45-remove-config-reads
Open

[v2.0] Stop reading OmopEmbConfig deep inside EmbeddingClient and resolve_backend#50
nicoloesch wants to merge 2 commits into
mainfrom
45-remove-config-reads

Conversation

@nicoloesch

Copy link
Copy Markdown
Collaborator

OmopEmbConfig.get_config() was being called deep inside EmbeddingClient's constructor/embedding_dim property and inside resolve_backend(), instead of once at CLI entry points. Two of the three call sites silently swallowed config errors (except FileNotFoundError / bare except Exception) rather than surfacing misconfiguration. Config is now resolved exactly once per CLI command and threaded down as plain arguments:

  • EmbeddingClient gains embedding_dim, document_embedding_prefix, query_embedding_prefix constructor parameters; property getters no longer read config internally.
  • resolve_backend(backend_type, *, sqlite_path=None) no longer reads config at all; a new resolve_backend_from_config(cfg) is the one place backend selection touches OmopEmbConfig.
  • New load_omop_emb_config() also catches ConfigurationError (missing required resource), previously uncaught anywhere and left to propagate as a raw ValueError.

@nicoloesch nicoloesch added the breaking Incompatible API change. MAJOR: x+1.y.z label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Incompatible API change. MAJOR: x+1.y.z

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: remove config reads from property getters and factory functions

1 participant