Skip to content

Commit 7e11b54

Browse files
Update scripts/us_fema/floods/fema_download.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent d27cf04 commit 7e11b54

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/us_fema/floods/fema_download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ def download_fema_csv(api_url, filename="fema_nfip_claims.csv"):
134134
f_final.write(content)
135135
else:
136136
# For subsequent chunks, strip the header before writing.
137-
content_without_header = content.split(b'\n', 1)[1]
138-
f_final.write(content_without_header)
137+
content_parts = content.split(b'\n', 1)
138+
f_final.write(content_parts[1] if len(content_parts) > 1 else b'')
139139

140140
# Check how many records were in the chunk
141141
num_records_in_chunk = len(content.split(b'\n')) - 1

0 commit comments

Comments
 (0)