Skip to content

4.14.0 — 2026-07-13

← 4.15.0 | 4.13.2 → | ↑ 4.x series

Added

Adapters - Elasticsearch

  • Document Scanning - Added scan() to ElasticsearchPort and async scan() to AsyncElasticsearchPort, delegating to elasticsearch.helpers.scan and elasticsearch.helpers.async_scan for scroll-based iteration over large result sets without manual scroll lifecycle management.
  • Bulk Action Types - Added ElasticsearchBulkActionType and ElasticsearchBulkResultType aliases for helper-format bulk actions and (success_count, error_count_or_error_list) return tuples.

Adapters - Redis

  • INCREX Window Counter - Added increx to RedisPort and AsyncRedisPort (and adapters/mocks), wrapping the Redis 8.8 INCREX command for atomic counter increments with optional bounds (lbound, ubound, saturate), expiration (ex, px, exat, pxat, persist, enx), and float or integer step sizes (byfloat, byint).
  • Array Data Structure - Added Redis 8.8 array commands to sync and async ports and adapters.
    • arset to write contiguous values at a starting index.
    • arget to read a single index.
    • arlen to return the array length.
    • ardel to delete one or more indices.
    • arring to append into a fixed-size ring buffer.
  • Sorted Set Aggregators - Added zunion and zinter to sync and async ports and adapters, including support for the Redis 8.8 COUNT aggregator that scores members by the number of input sets containing them (or weighted sum when per-set weights are provided).
  • Runtime Configuration - Added config_set and config_get to sync and async ports and adapters for reading and updating Redis server parameters (for example notify-keyspace-events for keyspace and subkey notifications).

Helpers - FastAPI Rate Limit

  • Atomic Rate Limiting - FastAPIRestRateLimitHandler now uses Redis INCREX with saturate=True, enx=True, and millisecond expiry instead of separate GET/SET/INCRBY/PTTL calls, eliminating check-then-act races under concurrent requests.

Changed

Adapters - Elasticsearch

  • Bulk Helper Integration - bulk() and async bulk() now delegate to elasticsearch.helpers.bulk and elasticsearch.helpers.async_bulk instead of the low-level client bulk API.
    • actions accepts any Iterable[ElasticsearchBulkActionType] (generators supported) instead of requiring a materialized list[dict[str, Any]].
    • Added stats_only parameter to return only success and error counts.
    • Return type changed from ElasticsearchResponseType to ElasticsearchBulkResultType — a (success_count, error_count_or_error_list) tuple. Update callers that previously parsed the raw client response.
    • Failures raise BulkIndexError when raise_on_error is true (default helper behaviour).

Tests

Tests - Elasticsearch Adapter

  • Bulk and Scan Scenarios - Added sync and async BDD scenarios for helper-format bulk operations (index, update, delete) and document scanning.
  • Step Refactor - Updated Elasticsearch step definitions to assert helper bulk result tuples and scan hit counts.

Tests - Redis Adapter

  • Redis 8.8 Feature Coverage - Added BDD scenarios for array operations (arset, arget, arlen, ardel, arring), INCREX rate-limit semantics, ZUNION/ZINTER with COUNT aggregator, and hash subkey notifications via config_set + PSUBSCRIBE.
  • Sync and Async Parity - New scenarios cover mock, container, and cluster adapter types for sync paths; container and cluster for async paths where applicable.
  • Test Image - Bumped Redis test container image to redis:8.8.0-alpine in .env.test to exercise Redis 8.8 commands.

Tests - FastAPI Rate Limit

  • Rate Limit Feature Suite - Added features/fastapi_rate_limit.feature with scenarios for within-limit success, 429 rejection with Retry-After, window expiry reset, and per-client isolation using X-Real-IP.

Documentation

Tutorials - Elasticsearch

  • Bulk and Scan Guides - Expanded the Elasticsearch adapter tutorial with helper-format bulk action generators, stats_only usage, scan() / async scan() examples, BulkIndexError troubleshooting, and performance guidance for batch writes and large result iteration.

Tutorials - Redis

  • INCREX Window Counter - Added sync and async increx() examples, parameter reference, Redis 8.8 requirement, and cross-link to the FastAPI rate limiting guide.

Tutorials - Interceptors

  • FastAPI Rate Limiting - Added a FastAPIRestRateLimitHandler dependency guide covering installation, Depends usage, INCREX-backed atomic limiting, client identification headers, and per-query-parameter buckets.

Dependencies

  • Python Packages - Bumped anyio 4.14.14.14.2.
  • Dev Tools - Updated ty 0.0.580.0.59 and types-boto3 stubs 7.0.0.202605187.0.0.20260713.