Repository navigation
fixed script WorldBank_IDS - #2291
Open
niveditasing wants to merge 2 commits into
Open
niveditasing wants to merge 2 commits into
niveditasing wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds new entries to the InputlendingEntity.csv mapping and refactors the World Bank data download script to implement a robust retry mechanism with exponential backoff and a fallback to year-based chunking. The feedback recommends narrowing down the exception handling in both retry loops from a broad Exception to specific transient errors, such as requests.exceptions.RequestException, to prevent masking programming or configuration bugs.
balit-raibot
self-requested a review
October 23, 2026 10:38
balit-raibot
approved these changes
Oct 23, 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.
Summary
Fixes two failures in the
WorldBank_IDS(statvar_imports/world_bank/worldbank_ids:WorldBank_IDS) auto-refresh import:Download failure (
HTTP 524origin timeout /AttributeError: 'NoneType' object has no attribute 'rename'):1970–current_year + 6) for an indicator in a single World Bank API call intermittently triggers CloudflareHTTP 524timeouts, causingbblocks(get_indicator_data) to returnNoneand crash inDebtIDS._get_indicator(data.rename(...)).download.pyto fetch each indicator individually with bounded retries and exponential backoff (MAX_RETRIES = 3), and fall back to 20-year chunks (YEAR_CHUNK_SIZE = 20) if full-range requests still fail.WorldBankDataimport fromdownload.py.Validation failure (
check_lint_error_count/Sanity_InvalidChars_dcidoninput0):counterpart_areavalues (Africa Finance CorporationandUganda) that were missing fromInputlendingEntity.csv.currency(input0),configs/currency_pvmap.csvfell back tolendingEntity: {Data}, generating a provisional schema nodeNode: dcid:Africa Finance Corporation(containing spaces) incurrency_stat_vars_schema.mcfand failinggenmcflint validation (Sanity_InvalidChars_dcid).interest,principal, anddisbursed(input1–input3), rows for these two unmapped lenders lacked alendingEntityproperty and collided withWorldStatVars (error-statvar-with-dup-svobs).Africa Finance Corporation -> Africa_Finance_CorporationandUganda -> country/UGAtoInputlendingEntity.csv.Files Changed
statvar_imports/world_bank/worldbank_ids/download.pystatvar_imports/world_bank/worldbank_ids/InputlendingEntity.csv