-
Notifications
You must be signed in to change notification settings - Fork 2
Migration Guide
Welcome to the WarEra Python Client migration guide! Find your target version below to see what changes you need to make to upgrade.
Version 0.2.3 is a feature-rich upgrade bringing the Python wrapper to the absolute cutting edge, including massive new architectural controls over batching, caching, and concurrency.
If upgrading from 0.2.2, no code changes are required! Just bump your package version.
However, you can now take advantage of the following new architectural features:
- CancellationScope (AbortController Parity): You can now gracefully cancel complex async workflows or pagination loops. Background batch engines will automatically prune cancelled tasks before they are sent over the network!
-
Persistent Caching: The SWR Cache engine now supports pluggable
CacheBackendimplementations. You can natively persistgameConfigand static lookup data across bot restarts using the built-inSQLiteCacheBackend. -
Request Priority Queuing: You can tag requests with
priority=RequestPriority.HIGH. The batching engine will surgically slice these critical tasks into the very next physical HTTP chunk, bypassing massive background queues. -
Customizable Batch Limits: You can now safely customize the underlying HTTP chunk limits via
max_batch_sizeduring client instantiation, giving you strict memory control for IoT or constrained environments. -
Built-in Telemetry Hooks: You can pass a
TelemetryHooksobject to observe internal rate-limit sleep durations, chunk payload efficiencies, and cache hit ratios for Datadog/Prometheus tracking.
Version 0.2.2 introduces massive internal stability and memory-safety patches following a comprehensive architecture audit. The public API surface is completely backwards-compatible, but the underlying engines have changed.
If you are upgrading from 0.2.0 or 0.2.1, no code changes are required! Just bump your package version.
However, note the following behavioral improvements:
-
OOM Memory Protection: The background synchronous thread wrapper now utilizes backpressure on the generator queue. If you use
get_paginated(auto_items=True)in synchronous mode over thousands of items, it will no longer bloat your RAM. -
Cache Safety:
async_memoizenow enforces a strict 1000-item LRU cap, and properly hashes complex dictionary arguments to prevent cache collisions. -
Cursor Parsing: JS Date string truncation was rebuilt robustly (
split(" GMT")[0]) to prevent timezone parsing crashes on pagination endpoints. -
Batching Resilience: The
InvalidStateErrorrace conditions in_auto_batch_flushwere resolved, and rate-limit headers properly track out-of-order network responses.
If you are upgrading from 0.1.x, please read the v0.2.0 Migration Guide as there were massive breaking changes to the pagination engines, including the removal of paginate() and auto_paginate=True in favor of get_paginated(auto_items=True) and collect_all().
- action_log
- alliance
- article
- battle
- battle_loot_summary
- battle_order
- battle_ranking
- company
- country
- donation
- election
- event
- game_config
- game_stat
- government
- inventory
- item_trading
- mercenary_contract_auction
- mu
- mu_member
- party
- ranking
- region
- round
- search
- tournament
- transaction
- upgrade
- user
- work
- work_offer
- worker