Skip to content

Remove redundant config re-resolution in doctor diagnostics#38

Open
nicoloesch wants to merge 4 commits into
mainfrom
remove-redundant-config
Open

Remove redundant config re-resolution in doctor diagnostics#38
nicoloesch wants to merge 4 commits into
mainfrom
remove-redundant-config

Conversation

@nicoloesch

Copy link
Copy Markdown
Collaborator

Summary

collect_doctor_report() was calling get_cdm_context() a second time even though collect_maintenance_info() (called immediately before it) already resolves the same config. This results in three independent config reads for one doctor CLI invocation once the @omop_command decorator's own resolution is counted.

Now threads the already-resolved result through instead of re-reading. collect_maintenance_info()'s own independent resolution is intentionally left as-is (it's a diagnostic health-check whose job is to test config resolution fresh, not a case of "caller already has it") . Its broad except Exception around that resolution is narrowed to avoid mislabeling unrelated bugs as a generic engine-resolution error.

@nicoloesch nicoloesch added the fix Bug fix, backwards-compatible. PATCH: x.y.z+1 label Jul 22, 2026
@nicoloesch
nicoloesch requested a review from gkennos July 22, 2026 23:19
@nicoloesch

Copy link
Copy Markdown
Collaborator Author

Removing the Liskov Substitution Principle fix that got picked up by ty>=0.0.62 as privately discussed. The respective bug is now reported here:
#41

Pinning ty to 0.0.61 to pass the static typing check.

Comment thread omop_alchemy/maintenance/cli_schema_doctor.py Outdated
Comment thread omop_alchemy/maintenance/cli_schema_doctor.py Outdated
@nicoloesch
nicoloesch requested a review from gkennos July 24, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix, backwards-compatible. PATCH: x.y.z+1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants