Skip to content

Create prerequisite table models - #11

Merged
jzgom067 merged 14 commits into
mainfrom
prerequisite-models
Apr 9, 2026
Merged

Create prerequisite table models#11
jzgom067 merged 14 commits into
mainfrom
prerequisite-models

Conversation

@ramonechen

@ramonechen ramonechen commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

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.

ramonechen and others added 12 commits April 7, 2026 17:21
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.
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.
@ramonechen
ramonechen marked this pull request as ready for review April 9, 2026 17:56
@ramonechen
ramonechen requested a review from Copilot April 9, 2026 17:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_Course tables plus a PrerequisiteNestingTypeEnum to model AND/OR prerequisite groupings.
  • Updates model-creation tests to assert the new tables are created.
  • Updates pyproject.toml metadata (adds an author; removes the keywords field).

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.

Comment thread carpi_data_model/models.py
Comment thread carpi_data_model/models.py Outdated
@ramonechen
ramonechen requested a review from jzgom067 April 9, 2026 18:01
@jzgom067
jzgom067 merged commit e4ed202 into main Apr 9, 2026
2 checks passed
@jzgom067
jzgom067 deleted the prerequisite-models branch April 9, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants