USFEMA_FloodInsuranceClaims - #2177
Open
kartik-s21 wants to merge 43 commits into
Open
Conversation
Code fix unenergy
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a direct bulk download option for the FEMA NFIP claims dataset as a faster and more reliable alternative to API pagination, which remains as a fallback. It also increases the pagination page size, improves error handling, and refines CSV chunk merging. The review feedback highlights two key improvements: raising an exception on bulk download failures to ensure proper logging instead of a silent fallback, and adding a check to prevent writing empty newlines when a downloaded chunk contains only a header.
balit-raibot
self-requested a review
August 25, 2026 11:05
balit-raibot
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR optimizes and stabilizes the data download pipeline for the FEMA NFIP Flood Insurance Claims import.
Key Changes
Direct Bulk Download Support:
bulk_urlsupport to download the full dataset (FimaNfipClaims.csv) directly from OpenFEMA as the primary method, significantly speeding up the download process.Error Handling & Fallback Visibility:
CSV Chunk Concatenation Fixes:
exist_ok=Trueand cleanup infinallyblocks).Testing & Coverage:
fema_download_test.pycovering:Verification