Reconcile own indices with pre-existing OHDSI-standard indices#36
Draft
nicoloesch wants to merge 11 commits into
Draft
Reconcile own indices with pre-existing OHDSI-standard indices#36nicoloesch wants to merge 11 commits into
nicoloesch wants to merge 11 commits into
Conversation
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.
Note before merging
This PR targets the branch
staging-overhaul. It depends onReservedSchema.STAGING/orm_loader.backends.STAGING_SCHEMA, which only exists onstaging-overhaul. To restore the history of this branch and exclude the staging changes again, we need to merge it after #29 was merged into main usingSummary
_is_plain_index,_find_equivalent_index,_find_shape_conflictincli_indexes.py) soindexes enablerecognizes an index that already exists under a foreign name (e.g. from the official OHDSI CDM DDL script) and never creates a duplicate.dropped_indexestable in a new reserved schema,omop_alchemy_maintenanceon PostgreSQL) soindexes disablecan safely drop such a foreign-named index for bulk-load speed, and a laterindexes enablerestores it under its original name. Includes schema-scoping to prevent collisions across two schemas.ReservedSchemaStrEnum (_cli_utils.py) centralizingSTAGINGandMAINTENANCE, guarded viareject_reserved_schema()wired into theomop_commanddecorator so every maintenance CLI command is protected, not justvocab load-vocab-source.cli_schema_reconcile.pyso a foreign-named equivalent index reports a single"renamed"issue instead of a misleading"missing"+"unexpected"pair, and doesn't count as drift. This includes the CLUSTER comparison and in thedoctor/summary rendering layers.cli_vocab.py's bulk vocabulary loader silently discardingindexes disable's warning results; they now surface onVocabularyLoadReport.index_warningsand render as a dedicated panel.indexes disablerun (without an interveningenable) when a different foreign index appears on the same columns now degrades gracefully instead of raising an uncaughtIntegrityError.load_vocab_source()'s reserved-schema guard only coveringSTAGING, notMAINTENANCE, when called directly (bypassing the CLI)._resolve_physical_cluster_name()helper used by bothmanage_indexes()'s cluster step and the standaloneindexes clustercommand, fixing a hardcodedunique=Falsein the latter and removing a duplicated resolution policy that could have drifted out of sync.status: strfield across all tencli_*.pymaintenance modules with one shared typedStatusStrEnum, each member carrying aSeverity(OK/INFO/WARNING/ERROR, itself carrying a renderstyle).FullTextResult/FullTextActionfromomop_alchemy/backends/base.pytoomop_alchemy/maintenance/cli_fulltext.py.manage_indexes()'s independentOptionaloutcome locals into a single_IndexOutcomediscriminated dataclass, so two of them being set simultaneously by a future edit becomes structurally impossible