From 2bf22758c18f463dce09eb0f969c33e2ab85dcd1 Mon Sep 17 00:00:00 2001 From: Nelson Jovel Date: Thu, 16 May 2024 15:09:14 -0700 Subject: [PATCH] chore: add a way to print out errors in dese id when cleaning files --- app/services/cleaner.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/services/cleaner.rb b/app/services/cleaner.rb index 57083ad1..91d28a4d 100644 --- a/app/services/cleaner.rb +++ b/app/services/cleaner.rb @@ -78,7 +78,10 @@ class Cleaner CSV.parse(lines.join, headers:).map do |row| values = SurveyItemValues.new(row:, headers:, survey_items: all_survey_items, schools:, academic_years:) - next unless values.valid_school? + unless values.valid_school? + # puts "row #{values.response_id}: dese id :#{values.dese_id} : could not find school, skipping row for file #{file.path}" + next + end data << values values.valid? ? clean_csv << values.to_a : log_csv << (values.to_a << values.valid_duration?.to_s << values.valid_progress?.to_s << values.valid_grade?.to_s << values.valid_sd?.to_s)