Skip to content

Commit cb7c8d2

Browse files
committed
Fix incorrect mapping paths being used in output
1 parent 2baf63d commit cb7c8d2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

app/scrapers/sis_scraper.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,41 +390,49 @@ async def main(
390390
try:
391391
# Load code maps for codifying scraped data in post-processing
392392
logger.info(
393-
f"Attempting to load existing subject code mappings from {_CODE_MAPPINGS_DIR}"
393+
f"Attempting to load existing subject code mappings from {_SUBJ_NAME_CODE_MAP_PATH}"
394394
)
395395
if _SUBJ_NAME_CODE_MAP_PATH.exists():
396396
with _SUBJ_NAME_CODE_MAP_PATH.open("r", encoding="utf-8") as f:
397397
subject_name_code_map = json.load(f)
398398
logger.info(f" Loaded {len(subject_name_code_map)} subject code mappings")
399+
else:
400+
logger.info(" No existing subject code mappings found")
399401

400402
logger.info(
401-
f"Attempting to load existing known instructor RCSIDs from {_CODE_MAPPINGS_DIR}"
403+
f"Attempting to load existing known instructor RCSIDs from {_KNOWN_INSTRUCTOR_RCSIDS_PATH}"
402404
)
403405
if _KNOWN_INSTRUCTOR_RCSIDS_PATH.exists():
404406
with _KNOWN_INSTRUCTOR_RCSIDS_PATH.open("r", encoding="utf-8") as f:
405407
known_rcsid_list = json.load(f)
406408
known_rcsid_set = set(known_rcsid_list)
407409
logger.info(f" Loaded {len(known_rcsid_set)} known instructor RCSIDs")
410+
else:
411+
logger.info(" No existing known instructor RCSIDs found")
408412

409413
logger.info(
410-
f"Attempting to load existing restriction code mappings from {_CODE_MAPPINGS_DIR}"
414+
f"Attempting to load existing restriction code mappings from {_RESTRICTION_NAME_CODE_MAP_PATH}"
411415
)
412416
if _RESTRICTION_NAME_CODE_MAP_PATH.exists():
413417
with _RESTRICTION_NAME_CODE_MAP_PATH.open("r", encoding="utf-8") as f:
414418
restriction_name_code_map = json.load(f)
415419
logger.info(
416420
f" Loaded {len(restriction_name_code_map)} restriction code mappings"
417421
)
422+
else:
423+
logger.info(" No existing restriction code mappings found")
418424

419425
logger.info(
420-
f"Attempting to load existing attribute code mappings from {_CODE_MAPPINGS_DIR}"
426+
f"Attempting to load existing attribute code mappings from {_ATTRIBUTE_NAME_CODE_MAP_PATH}"
421427
)
422428
if _ATTRIBUTE_NAME_CODE_MAP_PATH.exists():
423429
with _ATTRIBUTE_NAME_CODE_MAP_PATH.open("r", encoding="utf-8") as f:
424430
attribute_name_code_map = json.load(f)
425431
logger.info(
426432
f" Loaded {len(attribute_name_code_map)} attribute code mappings"
427433
)
434+
else:
435+
logger.info(" No existing attribute code mappings found")
428436

429437
# Limit concurrent client sessions and simultaneous connections
430438
semaphore = asyncio.Semaphore(semaphore_val)

0 commit comments

Comments
 (0)