Skip to content

Commit 3db431b

Browse files
committed
fix: also output null locaton_id
1 parent 2a326e3 commit 3db431b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ferry/transform/import_courses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,12 @@ def to_course_meetings(times_by_day: str):
354354
course_meetings = course_meetings.explode().dropna().apply(pd.Series).reset_index()
355355
# Merge rows with the same start/end/location
356356
course_meetings = (
357-
course_meetings.groupby(["course_id", "start_time", "end_time", "location_id"])
357+
course_meetings.groupby(["course_id", "start_time", "end_time", "location_id"], dropna=False)
358358
.agg({"days_of_week": lambda x: sum(1 << i for i in x)})
359359
.reset_index()
360360
)
361361
course_meetings["days_of_week"] = course_meetings["days_of_week"].astype(int)
362-
course_meetings["location_id"] = course_meetings["location_id"].astype(int)
362+
course_meetings["location_id"] = course_meetings["location_id"].astype(pd.Int64Dtype())
363363
return course_meetings, locations, buildings
364364

365365

0 commit comments

Comments
 (0)