-
Notifications
You must be signed in to change notification settings - Fork 11
Implement Library for Data Warehouse #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request implements a foundational data layer for a committee meeting data platform using SQLModel ORM and Alembic for database migrations. It introduces database models for committees, meetings, recordings, and transcripts, along with the infrastructure to manage schema changes.
Changes:
- Added four SQLModel database models (Committee, CommitteeMeeting, Recording, Transcript) with relationships and enum types
- Configured Alembic migration system with initial schema migration
- Implemented database connection utilities with environment variable support and SQLite fallback
- Updated build configuration to support migration tasks
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/committee_meeting/src/committee_meeting/committee.py | Defines Committee model with Chamber enum for congressional committees |
| packages/committee_meeting/src/committee_meeting/committee_meeting.py | Defines CommitteeMeeting model for tracking meeting events |
| packages/committee_meeting/src/committee_meeting/recording.py | Defines Recording model with RecordingType enum for video recordings |
| packages/committee_meeting/src/committee_meeting/transcript.py | Defines Transcript model with TranscriptSource enum for meeting transcripts |
| packages/committee_meeting/src/committee_meeting/connection.py | Provides database connection utilities with URL configuration |
| packages/committee_meeting/src/committee_meeting/init.py | Exports public API for the package |
| packages/committee_meeting/src/committee_meeting/migrations/env.py | Configures Alembic environment for SQLModel integration |
| packages/committee_meeting/src/committee_meeting/migrations/versions/6ca51869ca35_initial_schema.py | Initial database schema migration with table definitions |
| packages/committee_meeting/src/committee_meeting/migrations/script.py.mako | Template for generating future migration scripts |
| packages/committee_meeting/src/committee_meeting/alembic.ini | Alembic configuration file |
| packages/committee_meeting/pyproject.toml | Adds dependencies for alembic and sqlmodel |
| packages/committee_meeting/package.json | Adds npm scripts for migration commands |
| packages/committee_meeting/turbo.json | Configures Turborepo tasks for migrations |
| packages/committee_meeting/src/committee_meeting/main.py | Removed placeholder main.py file |
| .gitignore | Adds pattern to ignore local SQLite database files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/committee_meeting/src/committee_meeting/committee_meeting.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...s/committee_meeting/src/committee_meeting/migrations/versions/6ca51869ca35_initial_schema.py
Show resolved
Hide resolved
| end_time: Optional[datetime] = Field(default=None) | ||
| committee_id: Optional[str] = Field(default=None, foreign_key="committee.committee_id") | ||
| committee: Optional["Committee"] = Relationship(back_populates="meetings") | ||
| recordings: list["Recording"] = Relationship(back_populates="meeting") |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CommitteeMeeting model's relationship with Recording is defined as One-to-Many (line 32: recordings: list["Recording"]), but the README documentation describes this as a One-to-One relationship (line 98: "each meeting has exactly one recording"). Additionally, the README shows recording_id as a foreign key in CommitteeMeeting (line 28, 71), but the implementation has meeting_id as a foreign key in Recording instead. This is a significant architectural discrepancy. Clarify whether meetings can have multiple recordings or just one, and update either the code or documentation accordingly.
| video_id: str = Field(default=None) | ||
| video_title: str = Field(default=None) | ||
| upload_date: datetime = Field(default=None) |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Recording model defines non-Optional fields with default=None, which creates an inconsistency between the model definition and database schema. Fields like video_id, video_title, and upload_date are typed as non-Optional (str and datetime) but have default=None. This means:
- The migration correctly interprets these as nullable=False in the database
- But the Python code will allow None values to be set, which will fail at database insertion time
Either make these fields Optional[str] and Optional[datetime] to match the default=None, or remove the default=None to enforce required values.
| video_id: str = Field(default=None) | |
| video_title: str = Field(default=None) | |
| upload_date: datetime = Field(default=None) | |
| video_id: str = Field() | |
| video_title: str = Field() | |
| upload_date: datetime = Field() |
Summary: Add SQLModel database models and Alembic migrations for committee meeting data
Resolves #78 : Implement Library for Data Warehouse
Description
This change introduces the foundational data layer for the committee meeting data platform using SQLModel ORM and Alembic for database migrations.
Models Added
Infrastructure
Testing
Run migrations locally: