@@ -56,7 +56,7 @@ def get_source_data(params, logger):
56
56
57
57
# Generate file names of source files to download
58
58
dates = pd .date_range (start = params ["patch" ]["start_issue" ], end = params ["patch" ]["end_issue" ])
59
- primary_source_files = [f"{ date .strftime (" %Y%m%d" )} .csv.gz" for date in dates ]
59
+ primary_source_files = [f"{ date .strftime (' %Y%m%d' )} .csv.gz" for date in dates ]
60
60
secondary_source_files = [f"{ date .strftime ('%Y%m%d' )} _secondary.csv.gz" for date in dates ]
61
61
remote_source_files = primary_source_files + secondary_source_files
62
62
@@ -79,6 +79,7 @@ def get_source_data(params, logger):
79
79
logger .warning (
80
80
"Source backup for this date does not exist on the remote server." , missing_filename = remote_file_name
81
81
)
82
+ continue
82
83
sftp .get (remote_file_name , local_file_path , callback = callback_for_filename )
83
84
logger .info ("Transfer finished" , remote_file_name = remote_file_name , local_file_path = local_file_path )
84
85
num_files_transferred += 1
@@ -136,7 +137,7 @@ def pull_with_socrata_api(socrata_token: str, dataset_id: str):
136
137
137
138
138
139
def pull_nssp_data (socrata_token : str , backup_dir : str , custom_run : bool , issue_date : Optional [str ] = None , logger : Optional [logging .Logger ] = None ):
139
- """Pull the latest NSSP ER visits primary dataset.
140
+ """Pull the NSSP ER visits primary dataset.
140
141
141
142
https://data.cdc.gov/Public-Health-Surveillance/NSSP-Emergency-Department-Visit-Trajectories-by-St/rdmq-nq56/data_preview
142
143
@@ -213,7 +214,7 @@ def secondary_pull_nssp_data(
213
214
elif custom_run and logger .name == "delphi_nssp.patch" :
214
215
if issue_date is None :
215
216
raise ValueError ("Issue date is required for patching" )
216
- source_filename = f"{ backup_dir } /secondary_ { issue_date } .csv.gz"
217
+ source_filename = f"{ backup_dir } /{ issue_date } _secondary .csv.gz"
217
218
df_ervisits = pd .read_csv (source_filename )
218
219
logger .info (
219
220
"Number of records grabbed" ,
0 commit comments