SOC export moves a course to a new org when its title changes #69
Labels
No labels
bug
chore
data
feature
frontend
good first issue
intermediate
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/cal#69
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's wrong
COURSE orgs are keyed by name, and the name includes the title:
"15-112 <course title>"(soc_org_course.pyL9-15).upsert_orgs()upsertson_conflict="name", andupsert_courses()setscourses.org_idto this run's org (upsert oncourse_number). When a title changes between semesters:courses.org_idmoves to it, and so doescourse_agent(which readscourses.org_idincourse_agent/app/db/repositories.py);Related: continuation rows append a subtitle to the name (
monitors/academic/schedule_of_classes.pyL179-181). In Fall 2026, 71 course numbers have more than one name in the same semester (e.g. "Digital Photography I" and "Digital Photography I TBA"). The org takes the first row's name andcourses.course_nametakes the last row's.How to reproduce
On prod (read-only):
Expected
One org per course number across semesters. A title change renames that org instead of creating a new one.
Where to look
api/scraper/transforms/soc_org_course.py,api/scraper/persistence/supabase_org_course.py(upsert_orgs()L4-34,upsert_courses()L37-81).courses.org_idfirst; decide (with leads) how to merge existing duplicates.2c5f2e9.Done when
api/tests/scraper_monitors/test_upsert_orgs.py(it already has a fake Supabase table) for a renamed course