Skip to content

Commit db42ff8

Browse files
authored
Merge pull request #1018 from cmu-delphi/fix_quidel_covidtest
add try-except for non-datestring folder names
2 parents 7248fc8 + 2bdfb8f commit db42ff8

File tree

1 file changed

+7
-4
lines changed
  • quidel_covidtest/delphi_quidel_covidtest

1 file changed

+7
-4
lines changed

quidel_covidtest/delphi_quidel_covidtest/pull.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ def get_from_s3(start_date, end_date, bucket):
3333
for obj in bucket.objects.all():
3434
if "-sars" in obj.key:
3535
date_string = obj.key.split("/")[1]
36-
yy = int(date_string.split("_")[0])
37-
mm = int(date_string.split("_")[1])
38-
dd = int(date_string.split("_")[2])
39-
received_date = datetime(yy, mm, dd)
36+
try:
37+
yy = int(date_string.split("_")[0])
38+
mm = int(date_string.split("_")[1])
39+
dd = int(date_string.split("_")[2])
40+
received_date = datetime(yy, mm, dd)
41+
except ValueError:
42+
continue
4043
if received_date not in s3_files.keys():
4144
s3_files[received_date] = [obj.key]
4245
else:

0 commit comments

Comments
 (0)