Add TopicModelEvent ORM model to augur_data.py#3405
Merged
sgoggins merged 2 commits intoaugurlabs:mainfrom Nov 14, 2025
Merged
Conversation
Migration 36 created the topic_model_event table in the database, but the corresponding SQLAlchemy model was not added to augur_data.py. This caused ORM-level access to the event table to fail. This commit adds the TopicModelEvent class with: - All table columns (event_id, ts, repo_id, model_id, event, level, payload) - Index definitions for ix_tme_repo_ts and ix_tme_event - Foreign key constraints to repo and topic_model_meta tables - Relationship mappings to Repo and TopicModelMeta models This enables the application to query and manipulate topic modeling events through the ORM layer. Related: augur/application/schema/alembic/versions/36_add_topic_model_event.py Signed-off-by: Xiaoha <blairjade183@gmail.com>
d2f88b2 to
382e7b7
Compare
Ensure repo_id column type matches migration definition (sa.Integer) for complete schema consistency between ORM and database. Signed-off-by: Xiaoha <blairjade183@gmail.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.
Description
Add missing TopicModelEvent ORM model to complete schema implementation from PR #3397.
PR #3397 added database migrations for
topic_model_metaandtopic_model_eventtables, but theTopicModelEventSQLAlchemy model was inadvertently omitted fromaugur_data.py. This caused ORM-level access failures when attempting to query or manipulate event records.This PR adds the
TopicModelEventclass to complete the ORM layer for the topic modeling schema.Changes
Added TopicModelEvent ORM model (
augur/application/db/models/augur_data.py):event_id,ts,repo_id,model_id,event,level,payloadix_tme_repo_ts,ix_tme_eventrepoandtopic_model_metatablesRepoandTopicModelMetamodelsWhy This PR?
After merging #3397, it was discovered that while migration 36 created the
topic_model_eventtable in the database, the corresponding ORM model was missing. This prevented the application from accessing event data through SQLAlchemy.This is a follow-up PR to ensure the ORM layer matches the database schema created by the migrations.
Related
augur/application/schema/alembic/versions/36_add_topic_model_event.pyNotes for Reviewers
Signed commits