Fix/update cropus name embeddings model lang#16
Merged
Conversation
sandragjacinto
approved these changes
Mar 31, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the corpus_related.corpus_name_embedding_model_lang materialized view to expose additional metadata (corpus/model IDs, used_since, category_id) and keep only the latest embedding model per (corpus, language), then aligns the SQLAlchemy read-only model and bumps the package version.
Changes:
- Recreates the
corpus_name_embedding_model_langmaterialized view with extra columns and aROW_NUMBER()-based “latest per corpus/lang” selection. - Extends the
CorpusNameEmbeddingModelLangSQLAlchemy model to match the new view schema. - Bumps project version from
1.4.0to1.4.2.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| welearn_database/data/models/corpus_related.py | Adds new fields to the ORM model representing the updated materialized view. |
| welearn_database/alembic/versions/b049924f7067_modify_corpus_name_embedding_model_lang_.py | Drops/recreates the materialized view with updated projection and “latest per corpus/lang” logic. |
| pyproject.toml | Version bump to reflect the schema/model change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
This pull request updates the materialized view for corpus embedding models to include additional metadata and ensures the corresponding SQLAlchemy model and versioning are in sync. The core change is a migration that drops and recreates the
corpus_name_embedding_model_langmaterialized view with more fields and improved logic, and updates the data model accordingly.Database migration and schema changes:
b049924f7067_modify_corpus_name_embedding_model_lang_) that drops and recreates thecorpus_related.corpus_name_embedding_model_langmaterialized view. The new view now includescorpus_id,embedding_model_id,used_since, andcategory_id, and ensures only the latest embedding model per corpus and language is kept using a window function.CorpusNameEmbeddingModelLangSQLAlchemy model incorpus_related.pyto add new fields:corpus_id,embedding_model_id,used_since, andcategory_id, matching the new view schema.Versioning:
pyproject.tomlfrom1.4.0to1.4.2to reflect the schema and model changes.