Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #71 from mozilla/phil/robust-date
Browse files Browse the repository at this point in the history
fix(scripts): count from the end when parsing date from file name

#71

r=vbudhram
  • Loading branch information
philbooth committed Apr 13, 2017
2 parents 04647d5 + 2f91989 commit cb7c4ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion import_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ def get_unpopulated_days():
print message
for key in s3.list(prefix=s3_prefix):
filename = path.basename(key.name)
day = "-".join(filename[:-4].split("-")[1:])
# Ignore the last four characters (".csv") then join the last
# three parts ("YYYY-MM-DD") of the hyphen-split string.
day = "-".join(filename[:-4].split("-")[-3:])
if is_candidate_day(day) and not is_day_populated(day):
days.append(day)
return days
Expand Down

0 comments on commit cb7c4ab

Please sign in to comment.