diff --git a/scripts/migrate_csv_to_db.py b/scripts/migrate_csv_to_db.py index cade220..7891bd3 100644 --- a/scripts/migrate_csv_to_db.py +++ b/scripts/migrate_csv_to_db.py @@ -114,11 +114,12 @@ def load_csv_data(data_dir: Path) -> pd.DataFrame: if not year: continue - csv_files = list(folder.glob("*.csv")) - if not csv_files: + # Specifically look for the KS2 results file + ks2_file = folder / "england_ks2final.csv" + if not ks2_file.exists(): continue - csv_file = csv_files[0] + csv_file = ks2_file print(f" Loading {csv_file.name} (year {year})...") try: