|
2 | 2 |
|
3 | 3 | ## [Unreleased] |
4 | 4 |
|
| 5 | +### Added |
| 6 | +- **Async API Support** — All modules now have async counterparts: `sgs.async_get()`, `sgs.async_get_json()`, `currency.async_get()`, `ODataQuery.async_text()`, `ODataQuery.async_collect()`, `Endpoint.async_get()` for concurrent data fetching with `asyncio.gather()` |
| 7 | +- **Logging Infrastructure** — Debug-level logging for all HTTP requests/responses (URL, status, response length) and warning-level logging for connection retry attempts across currency, sgs, and odata modules |
| 8 | +- **Comprehensive Test Coverage** — Added 36 new tests: 12 negative tests for currency API (404/429/500 errors, malformed CSV), 15 negative tests for SGS API (malformed JSON, invalid inputs), 9 async tests; total 103 unit tests with proper mock isolation |
| 9 | +- **Example Scripts** — Added `examples/` directory with 4 comprehensive usage examples: SGS time series, currency exchange rates, OData queries with filters/sorting, and async API usage |
| 10 | +- **Enhanced Documentation** — Added "Which Module to Use?" decision table and FAQ section to README covering module differences, data coverage, async usage, error handling, logging setup, caching, and long-running applications |
| 11 | +- **Factory Functions** in tests/conftest.py — Parameterizable mock data generators: `make_currency_id_list_html()`, `make_currency_list_csv()`, `make_currency_rate_csv()`, `make_sgs_response()`, `make_odata_metadata_xml()`, `make_odata_query_response()` |
| 12 | +- **Cache Clearing Fixtures** — Added automatic OData metadata cache clearing between tests to prevent pytest-httpx mock assertion errors |
| 13 | + |
| 14 | +### Changed |
| 15 | +- **Exception Handling** — Updated `bcb/currency.py` `get()` function to wrap `_get_symbol()` calls in try-except, allowing skipping of missing currencies while maintaining fail-fast for internal errors (per Phase 2 architecture) |
| 16 | +- **Test Organization** — Added `clear_odata_cache` fixture for proper test isolation; fixed `test_clear_cache` to use new `_ThreadSafeCache` API; renamed `test_get_symbol_unknown_currency_returns_none` to `test_get_symbol_unknown_currency_raises` to match fail-fast semantics |
| 17 | +- **Cache Management** — Added explicit `_CacheKey` namedtuple for structured cache keys in currency module; enhanced thread-safe cache with clear, get, set operations |
| 18 | + |
| 19 | +### Fixed |
| 20 | +- **Cache State Issues** — Resolved pytest-httpx unused mock assertions by implementing `clear_odata_cache` fixture that clears global `_METADATA_CACHE` between tests |
| 21 | +- **Test Failures** — Fixed 2 failing tests (`test_clear_cache`, `test_get_symbol_unknown_currency_returns_none`) to work with Phase 2 architecture changes and Phase 3 cache refactor |
| 22 | + |
5 | 23 | ## [0.3.5] - 2026-02-27 |
6 | 24 | - Added `output="text"` parameter to `sgs.get()`, `currency.get()`, `EndpointQuery.collect()`, and `Endpoint.get()` — returns raw API response text (JSON for SGS and OData, CSV for currency) instead of a DataFrame; multi-code/symbol calls return `dict[key, str]`; default behavior unchanged |
7 | 25 | - Migrated from Poetry to uv for package management (PEP 621 + hatchling build backend) |
|
0 commit comments