Remove redundant config re-resolution in doctor diagnostics#38
Open
nicoloesch wants to merge 3 commits into
Open
Remove redundant config re-resolution in doctor diagnostics#38nicoloesch wants to merge 3 commits into
nicoloesch wants to merge 3 commits into
Conversation
3 tasks
Collaborator
Author
|
Removing the Liskov Substitution Principle fix that got picked up by Pinning |
gkennos
requested changes
Jul 24, 2026
| Already-resolved CDM engine (from the ``@omop_command`` decorator), | ||
| reused for the deep checks below instead of re-resolving config. | ||
| """ | ||
| info = collect_maintenance_info(vocabulary_included=vocabulary_included) |
Member
There was a problem hiding this comment.
the call here still has unbounded except within collect_maintenance_info - noted since the PR is aiming to clean up the broad exceptions here
maybe (in cli_schema_info.py)
except (FileNotFoundError, ValueError, ValidationError, KeyError) as exc:
engine_error = f"Could not resolve engine configuration: {exc}"
else:
try:
engine = create_cdm_engine(resolved)
engine_created = True
except RuntimeError as exc:
engine_error = str(exc)|
|
||
| def collect_doctor_report( | ||
| *, | ||
| engine: sa.engine.Engine, |
Member
There was a problem hiding this comment.
this API change makes it technically breaking - shouldn't matter if this is being absorbed into the intended 2.0 upversion anyway?
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
collect_doctor_report()was callingget_cdm_context()a second time even thoughcollect_maintenance_info()(called immediately before it) already resolves the same config. This results in three independent config reads for onedoctorCLI invocation once the@omop_commanddecorator'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 broadexcept Exceptionaround that resolution is narrowed to avoid mislabeling unrelated bugs as a generic engine-resolution error.