Create prerequisite table models - #11
Merged
Merged
Conversation
Co-Authored-By: Nick Wang <122407085+NickWang8@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This constraint is fulfilled transiently by the Prerequisite_Nesting class
Not sure why we kept these in.
This reverts commit 900eb28.
Also includes a small change in which the list of table names in test_create_tables is converted to a set for more efficient asserts.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new SQLAlchemy models to represent parsed prerequisite trees (nesting + leaf course requirements) so prerequisite data can be persisted and served via the API, aligning the schema with the previously documented design.
Changes:
- Introduces
Prerequisite_Nesting/Prerequisite_Coursetables plus aPrerequisiteNestingTypeEnumto model AND/OR prerequisite groupings. - Updates model-creation tests to assert the new tables are created.
- Updates
pyproject.tomlmetadata (adds an author; removes thekeywordsfield).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
carpi_data_model/models.py |
Adds prerequisite enum + two new prerequisite-related table models and foreign key constraints. |
tests/test_models.py |
Extends schema-creation test to include the new tables. |
pyproject.toml |
Metadata-only update (authors formatting/addition; removes keywords). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jzgom067
approved these changes
Apr 9, 2026
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.
What?
This pull request contains the addition of the prerequisite nesting and prerequisite course table models that we've had defined in our Google Doc schema from a while back.
A small but unrelated change also included in this PR is the removal of the keywords field from
pyproject.toml, which I don't think served any purpose.This is a remake of closed pull request #10 since I changed the branch name to use a dash instead of underscore.
Why?
Now that the prerequisite parser in the SIS scraper has been completed, we need these tables to store the data from the parser and to serve it to our API, which can then be used by our website. All for the end goal of helping our (potential) users make more informed course plans.
How?
Nick and I created some new table models in
models.py, along with a new enumerator class to support the prerequisite nesting table.Testing?
I added the prerequisite tables to the tests. The tests pass.