chore: fix problem with enrollment scraper

rpp-main
rebuilt 10 months ago
parent 2e89d78aa6
commit 34c0b21e9c

@ -22,16 +22,16 @@ module Dese
end
def student_count(filepath:, dese_id:, year:)
@students ||= {}
if @students.count == 0
@student_count ||= {}
if @student_count.count == 0
CSV.parse(File.read(filepath), headers: true).map do |row|
academic_year = row['Academic Year']
school_id = row['DESE ID'].to_i
school_id = row['School Code'].to_i
total = row['Total'].gsub(',', '').to_i
@students[[school_id, academic_year]] = total
@student_count[[school_id, academic_year]] = total
end
end
@students[[dese_id, year]]
@student_count[[dese_id, year]]
end
end
end

@ -56,7 +56,7 @@ class SurveyItemValues
def recorded_date
@recorded_date ||= begin
recorded_date = value_from(pattern: /Recorded\s*Date/i)
date = if recorded_date.match(%r{\d+/\d+/\d+})
if recorded_date.match(%r{\d+/\d+/\d+})
Date.strptime(recorded_date, "%m/%d/%Y")
elsif recorded_date.match(/\d+-\d+-\d+(T|\s)\d+:\d+:\d+/)
Date.parse(recorded_date)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save