Skip to content

v2.1.0

Choose a tag to compare

@jm-rivera jm-rivera released this 14 Aug 13:40
· 2 commits to main since this release
8c95a05

Before you upgrade

weo.fetch_data() was returning the wrong release. Version resolution keyed off each dataflow's lastUpdatedAt annotation, which is inverted on the IMF's live WEO dataflows, so fetch_data(("October", 2025)) returned the April 2026 release under an October 2025 label. About 35% of overlapping observations differed beyond rounding. World real GDP growth for 2025 came back as 3.441 where the IMF published 3.163.

Resolution now reads PUBLICATION_DATE from the data itself. fetch_data(("October", 2025)) returns the October 2025 release, 354,240 rows reaching 2030, and get_weo_versions() gains ("April", 2026).

Two things to do. Run imf_reader.cache.clear_cache() if you are on an editable or git install, since those stay inside the same version segment and an entry written before this release can keep serving the mislabelled data. And re-pull any extract you saved to disk labelled "October 2025", which may hold April 2026 under the wrong label.

Restored and new columns

LASTACTUALDATE and NOTES held nulls on every API-served release while the IMF published their contents. Both are populated, from a per-series metadata sidecar. A new COUNTRY_UPDATE_DATE column carries the date each country's data was last revised, appended after SCALE_LABEL, so the first 15 columns and any positional access to them are unaffected.

Two gotchas remain, both documented. LASTACTUALDATE collapses fiscal-year forms such as FY2023/24 to 2023, which affects about a tenth of series and discards the boundary. NOTES carries bulk-archive text before April 2025 and the API's METHODOLOGY_NOTES after it, with no column marking which, so searching that text across concatenated releases mixes two vocabularies.

Wider pandas support

The pandas floor is pandas>=2.2.2, down from pandas>=3.0.0 in 2.0.1. pandas 2.2.2 returns the same frame as 3.0.5 against the live API, with the same 16 columns in the same order, the same dtypes and the same values. pyarrow>=16.0 is required, since pyarrow 14 was built against numpy 1.x and cannot import alongside numpy 2.

Other changes

fetch_data(version) with an explicit version raises when the API cannot serve it, where it previously fell back and returned a different release under the requested label. Automatic roll-back applies to fetch_data() with no version, walks the published release list, and stops after three attempts.

A dataflow catalogue that responds without a usable WEO dataflow raises DataflowDiscoveryError. That response previously produced an empty version mapping, which resolved "latest" to April 2025.

Cache entries are written atomically, an unreadable entry is treated as a miss and removed, and a removal that fails on a read-only cache directory is logged and the call proceeds.

sdr.fetch_latest_allocations_holdings_date() raises ValueError naming the page when the IMF changes its layout.

Documentation: https://docs.one.org/tools/imf-reader/

Full changelog: v2.0.1...v2.1.0